Skip to content

Class QfLocalFilesModel

ClassList > QfLocalFilesModel

Inherits the following classes: QAbstractListModel

Public Types

Type Name
enum ItemMetaType
enum ItemType
enum Role

Public Properties

Type Name
property int currentDepth
property QString currentPath
property QString currentTitle
property bool inSelectionMode
property bool isDeletedAllowedInCurrentPath

Public Signals

Type Name
signal void currentPathChanged
signal void inSelectionModeChanged

Public Functions

Type Name
QfLocalFilesModel (QObject * parent=nullptr)
Q_INVOKABLE void addToFavorites (const QString & path)
Adds the path to the favorites list.
Q_INVOKABLE void clearSelection ()
Set checked state of all items to false.
int currentDepth () const
Returns the current navigation history depth.
QString currentPath () const
Returns the current path.
QString currentTitle () const
Returns the current title derived from the current path.
QVariant data (const QModelIndex & index, int role) override const
Q_INVOKABLE QfLocalFileItem get (int index) const
Returns the QfLocalFileItem at the given__index .
bool inSelectionMode ()
Returns whether list is in multi-selection mode or not.
bool isDeletedAllowedInCurrentPath () const
Q_INVOKABLE bool isPathFavoriteEditable (const QString & path)
Returns whether path's favorite state is editable.
Q_INVOKABLE void moveUp ()
Walks the navigation history back up on step.
Q_INVOKABLE void removeFromFavorites (const QString & path)
Removes the path to the favorites list.
Q_INVOKABLE void resetToPath (const QString & path)
Resets the model and sets the first navigation history item to the provided path .
Q_INVOKABLE void resetToRoot ()
Resets the model and sets the first navigation history item to root.
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent) override const
Q_INVOKABLE void setChecked (const int & mIdx, const bool & checked)
Set checked state of an item in list.
void setCurrentPath (const QString & path)
Appends the provided path to the navigation history.

Public Types Documentation

enum ItemMetaType

enum QfLocalFilesModel::ItemMetaType {
    Favorite,
    Folder,
    File,
    Project,
    Dataset
};

enum ItemType

enum QfLocalFilesModel::ItemType {
    ApplicationFolder,
    QfExternalStorage,
    SimpleFolder,
    ProjectFile,
    VectorDataset,
    RasterDataset,
    OtherFile
};

enum Role

enum QfLocalFilesModel::Role {
    ItemMetaTypeRole = Qt::UserRole,
    ItemTypeRole,
    ItemTitleRole,
    ItemFormatRole,
    ItemPathRole,
    ItemSizeRole,
    ItemHasThumbnailRole,
    ItemIsFavoriteRole,
    ItemHasWebdavConfigurationRole,
    ItemCheckedRole
};

Public Properties Documentation

property currentDepth [1/2]

int QfLocalFilesModel::currentDepth;

property currentPath [1/2]

QString QfLocalFilesModel::currentPath;

property currentTitle [1/2]

QString QfLocalFilesModel::currentTitle;

property inSelectionMode [1/2]

bool QfLocalFilesModel::inSelectionMode;

property isDeletedAllowedInCurrentPath [1/2]

bool QfLocalFilesModel::isDeletedAllowedInCurrentPath;

Public Signals Documentation

signal currentPathChanged

void QfLocalFilesModel::currentPathChanged;

signal inSelectionModeChanged

void QfLocalFilesModel::inSelectionModeChanged;

Public Functions Documentation

function QfLocalFilesModel

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

function addToFavorites

Adds the path to the favorites list.

Q_INVOKABLE void QfLocalFilesModel::addToFavorites (
    const QString & path
) 


function clearSelection

Set checked state of all items to false.

Q_INVOKABLE void QfLocalFilesModel::clearSelection () 


function currentDepth [2/2]

Returns the current navigation history depth.

inline int QfLocalFilesModel::currentDepth () const


function currentPath [2/2]

Returns the current path.

QString QfLocalFilesModel::currentPath () const


function currentTitle [2/2]

Returns the current title derived from the current path.

QString QfLocalFilesModel::currentTitle () const


function data

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

function get

Returns the QfLocalFileItem at the given__index .

Q_INVOKABLE QfLocalFileItem QfLocalFilesModel::get (
    int index
) const


function inSelectionMode [2/2]

Returns whether list is in multi-selection mode or not.

bool QfLocalFilesModel::inSelectionMode () 


function isDeletedAllowedInCurrentPath [2/2]

bool QfLocalFilesModel::isDeletedAllowedInCurrentPath () const

Returns TRUE if deletation of files and folders is allow in the current path

Note:

Currently, deletion is only allowed when the path is a sub-child of an application directory


function isPathFavoriteEditable

Returns whether path's favorite state is editable.

Q_INVOKABLE bool QfLocalFilesModel::isPathFavoriteEditable (
    const QString & path
) 


function moveUp

Walks the navigation history back up on step.

Q_INVOKABLE void QfLocalFilesModel::moveUp () 


function removeFromFavorites

Removes the path to the favorites list.

Q_INVOKABLE void QfLocalFilesModel::removeFromFavorites (
    const QString & path
) 


function resetToPath

Resets the model and sets the first navigation history item to the provided path .

Q_INVOKABLE void QfLocalFilesModel::resetToPath (
    const QString & path
) 


function resetToRoot

Resets the model and sets the first navigation history item to root.

Q_INVOKABLE void QfLocalFilesModel::resetToRoot () 


function roleNames

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

function rowCount

int QfLocalFilesModel::rowCount (
    const QModelIndex & parent
) override const

function setChecked

Set checked state of an item in list.

Q_INVOKABLE void QfLocalFilesModel::setChecked (
    const int & mIdx,
    const bool & checked
) 


function setCurrentPath

Appends the provided path to the navigation history.

void QfLocalFilesModel::setCurrentPath (
    const QString & path
) 



The documentation for this class was generated from the following file src/gui/qflocalfilesmodel.h