Skip to content

Class QfDeltaChangesModel

ClassList > QfDeltaChangesModel

More...

  • #include <qfdeltachangesmodel.h>

Inherits the following classes: QAbstractListModel

Public Types

Type Name
enum ColumnRole
enum DeltaMethod

Public Properties

Type Name
property QfDeltaFileWrapper * deltaFileWrapper

Public Signals

Type Name
signal void deltaFileWrapperChanged

Public Functions

Type Name
QfDeltaChangesModel (QObject * parent=nullptr)
QVariant data (const QModelIndex & index, int role) override const
Returns the data at given index with given__role .
QfDeltaFileWrapper * deltaFileWrapper () const
Returns the attached delta file wrapper, if any.
Q_INVOKABLE int layerChangesCount (const QString & layerId) const
Returns how many pending changes the layer with the given layerId carries.
Q_INVOKABLE Qgis::GeometryType layerGeometryType (const QString & layerId) const
Returns the geometry type of the layer with the given layerId .
Q_INVOKABLE QString layerName (const QString & layerId) const
Returns the name of the layer with the given layerId .
QHash< int, QByteArray > roleNames () override const
Returns the model role names.
int rowCount (const QModelIndex & parent=QModelIndex()) override const
Returns number of rows.
void setDeltaFileWrapper (QfDeltaFileWrapper * deltaFileWrapper)
Attaches the deltaFileWrapper the rows are read from, pass NULLPTR to detach and clear the model.

Detailed Description

A list model of the deltas not uploaded to QFieldCloud yet, one row per changed feature, sorted so that the rows of a layer are adjacent and a view can section them by LayerId.

Public Types Documentation

enum ColumnRole

enum QfDeltaChangesModel::ColumnRole {
    LayerIdRole = Qt::UserRole + 1,
    MethodRole,
    FeatureNameRole,
    AttributeChangesRole,
    HasGeometryChangeRole
};

enum DeltaMethod

enum QfDeltaChangesModel::DeltaMethod {
    UnknownMethod,
    CreateMethod,
    PatchMethod,
    DeleteMethod
};

Public Properties Documentation

property deltaFileWrapper [1/2]

QfDeltaFileWrapper * QfDeltaChangesModel::deltaFileWrapper;

Public Signals Documentation

signal deltaFileWrapperChanged

void QfDeltaChangesModel::deltaFileWrapperChanged;

Public Functions Documentation

function QfDeltaChangesModel

explicit QfDeltaChangesModel::QfDeltaChangesModel (
    QObject * parent=nullptr
) 

function data

Returns the data at given index with given__role .

QVariant QfDeltaChangesModel::data (
    const QModelIndex & index,
    int role
) override const


function deltaFileWrapper [2/2]

Returns the attached delta file wrapper, if any.

QfDeltaFileWrapper * QfDeltaChangesModel::deltaFileWrapper () const


function layerChangesCount

Returns how many pending changes the layer with the given layerId carries.

Q_INVOKABLE int QfDeltaChangesModel::layerChangesCount (
    const QString & layerId
) const


function layerGeometryType

Returns the geometry type of the layer with the given layerId .

Q_INVOKABLE Qgis::GeometryType QfDeltaChangesModel::layerGeometryType (
    const QString & layerId
) const


function layerName

Returns the name of the layer with the given layerId .

Q_INVOKABLE QString QfDeltaChangesModel::layerName (
    const QString & layerId
) const


function roleNames

Returns the model role names.

QHash< int, QByteArray > QfDeltaChangesModel::roleNames () override const


function rowCount

Returns number of rows.

int QfDeltaChangesModel::rowCount (
    const QModelIndex & parent=QModelIndex()
) override const


function setDeltaFileWrapper

Attaches the deltaFileWrapper the rows are read from, pass NULLPTR to detach and clear the model.

void QfDeltaChangesModel::setDeltaFileWrapper (
    QfDeltaFileWrapper * deltaFileWrapper
) 



The documentation for this class was generated from the following file src/core/qfieldcloud/qfdeltachangesmodel.h