|
enum | Category { CategoryLocal = 0
, CategoryRemovable = 1
, CategoryRemote = 2
, NumberOfCategories
} |
|
enum | Columns {
ColumnStatus = 0
, ColumnName = 1
, ColumnPath = 2
, ColumnAppendButton = 3
,
ColumnUpdateButton = 4
, ColumnDeleteButton = 5
, NumberOfColumns
} |
|
enum | SetupCollectionDataRole {
IsCategoryRole = Qt::UserRole
, CategoryButtonDisplayRole = Qt::UserRole + 1
, CategoryButtonMapId = Qt::UserRole + 2
, IsAppendRole = Qt::UserRole + 3
,
AppendDecorationRole = Qt::UserRole + 4
, AppendMapId = Qt::UserRole + 5
, IsUpdateRole = Qt::UserRole + 6
, UpdateDecorationRole = Qt::UserRole + 7
,
UpdateMapId = Qt::UserRole + 8
, IsDeleteRole = Qt::UserRole + 9
, DeleteDecorationRole = Qt::UserRole + 10
, DeleteMapId = Qt::UserRole + 11
} |
| SetupCollectionModel is a model specialized for use in SetupCollectionTreeView. More...
|
|
|
| SetupCollectionModel (QObject *const parent=nullptr) |
| Internal data structure:
|
|
void | apply () |
| Apply the changed settings to CollectionManager.
|
|
QList< QModelIndex > | categoryIndexes () const |
|
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
|
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| QAbstractItemModel implementation.
|
|
Qt::ItemFlags | flags (const QModelIndex &index) const override |
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
|
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
|
QModelIndex | indexForCategory (Category category) const |
|
void | loadCollections () |
| Read collections from CollectionManager.
|
|
QModelIndex | parent (const QModelIndex &index) const override |
|
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
|
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
|
void | setParentWidgetForDialogs (QWidget *const widget) |
| Set a widget used as parent for dialogs and message boxes.
|
|
Digikam::SetupCollectionModel::SetupCollectionModel |
( |
QObject *const |
parent = nullptr | ) |
|
|
explicit |
The category entries get a model index with INTERNALID and are identified by their row(). The item entries get the index in m_collections as INTERNALID. No item is ever removed from m_collections, deleted entries are only marked as such.
Items have a location, a parentId, and a name and label field. parentId always contains the category, needed to implement parent(). The location is the location if it exists, or is null if the item was added. Name and label are null if unchanged, then the values from location are used. They are valid if edited (label) or the location was added (both valid, location null).