InstalledListModel Class
class ScreenPlay::InstalledListModelLists all installed wallpapers, widgets etc. from a given Path. More...
Header: | #include <InstalledListModel> |
Public Functions
InstalledListModel(const std::shared_ptr<GlobalVariables> &globalVariables, QObject *parent = nullptr) | |
int | count() const |
Reimplemented Public Functions
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
virtual QHash<int, QByteArray> | roleNames() const override |
virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const override |
Public Slots
void | append(const QJsonObject &obj, const QString &folderName) |
void | init() |
void | loadInstalledContent() |
void | setCount(int count) |
Signals
void | countChanged(int count) |
Detailed Description
Currently we only support one path for the user content. Via a QFileSystemWatcher we automatically reload the list. Dynamic insert and remove is not yet implemented. Otherwhise it is a regular QAbstractListModel based list model.
Member Function Documentation
InstalledListModel::InstalledListModel(const std::shared_ptr<GlobalVariables> &globalVariables, QObject *parent = nullptr)
Constructor.
[slot]
void InstalledListModel::append(const QJsonObject &obj, const QString &folderName)
[slot]
void InstalledListModel::init()
Init function that needs to be called after the constructor because we need the GlobalVariables to finish loading.
[slot]
void InstalledListModel::loadInstalledContent()
[override virtual]
QVariant InstalledListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Retruns the data member of the ProjectFile.
[override virtual]
QHash<int, QByteArray> InstalledListModel::roleNames() const
Returns the variable names for QML.
[override virtual]
int InstalledListModel::rowCount(const QModelIndex &parent = QModelIndex()) const
Returns the length of the installed items.