Skip to content

Class QfCloudAttachmentsModel

ClassList > QfCloudAttachmentsModel

More...

  • #include <qfcloudattachmentsmodel.h>

Inherits the following classes: QAbstractListModel

Public Types

Type Name
enum ColumnRole
enum Status

Public Properties

Type Name
property QfCloudConnection * cloudConnection
property QfCloudProject * cloudProject

Public Signals

Type Name
signal void cloudConnectionChanged
signal void cloudProjectChanged

Public Functions

Type Name
QfCloudAttachmentsModel (QObject * parent=nullptr)
QfCloudConnection * cloudConnection () const
Returns the cloud connection used to read the pending attachments and the attachments upload history.
QfCloudProject * cloudProject () const
Returns the cloud project whose attachments are listed.
QVariant data (const QModelIndex & index, int role) override const
Returns the data at given index with given__role .
Q_INVOKABLE void refresh ()
Reloads the attachments not yet uploaded, the pending attachments and the attachments upload history.
QHash< int, QByteArray > roleNames () override const
Returns the model role names.
int rowCount (const QModelIndex & parent=QModelIndex()) override const
Returns number of rows.
void setCloudConnection (QfCloudConnection * cloudConnection)
Sets the cloudConnection used to read the pending attachments and the attachments upload history.
void setCloudProject (QfCloudProject * cloudProject)
Sets the cloudProject whose attachments are listed.

Detailed Description

A model listing the attachments of a QFieldCloud project that are not yet uploaded or pending upload, alongside the outcome of past attachment uploads.

Public Types Documentation

enum ColumnRole

enum QfCloudAttachmentsModel::ColumnRole {
    FilePathRole = Qt::UserRole + 1,
    FileNameRole,
    StatusRole,
    HttpCodeRole,
    TimestampRole
};

enum Status

enum QfCloudAttachmentsModel::Status {
    LocalStatus,
    PendingStatus,
    UploadedStatus,
    FailedStatus
};

Public Properties Documentation

property cloudConnection [1/2]

QfCloudConnection * QfCloudAttachmentsModel::cloudConnection;

property cloudProject [1/2]

QfCloudProject * QfCloudAttachmentsModel::cloudProject;

Public Signals Documentation

signal cloudConnectionChanged

void QfCloudAttachmentsModel::cloudConnectionChanged;

signal cloudProjectChanged

void QfCloudAttachmentsModel::cloudProjectChanged;

Public Functions Documentation

function QfCloudAttachmentsModel

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

function cloudConnection [2/2]

Returns the cloud connection used to read the pending attachments and the attachments upload history.

QfCloudConnection * QfCloudAttachmentsModel::cloudConnection () const


function cloudProject [2/2]

Returns the cloud project whose attachments are listed.

QfCloudProject * QfCloudAttachmentsModel::cloudProject () const


function data

Returns the data at given index with given__role .

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


function refresh

Reloads the attachments not yet uploaded, the pending attachments and the attachments upload history.

Q_INVOKABLE void QfCloudAttachmentsModel::refresh () 


function roleNames

Returns the model role names.

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


function rowCount

Returns number of rows.

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


function setCloudConnection

Sets the cloudConnection used to read the pending attachments and the attachments upload history.

void QfCloudAttachmentsModel::setCloudConnection (
    QfCloudConnection * cloudConnection
) 


function setCloudProject

Sets the cloudProject whose attachments are listed.

void QfCloudAttachmentsModel::setCloudProject (
    QfCloudProject * cloudProject
) 



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