24 #ifndef DIGIKAM_TABLE_VIEW_MODEL_H
25 #define DIGIKAM_TABLE_VIEW_MODEL_H
29 #include <QAbstractItemModel>
43 class ItemFilterModel;
44 class ItemFilterSettings;
47 class TableViewColumn;
48 class TableViewColumnConfiguration;
49 class TableViewColumnDescription;
50 class TableViewColumnFactory;
51 class TableViewColumnProfile;
95 const int targetColumn = -1);
97 const int targetColumn = -1);
112 QModelIndex
toCol0(
const QModelIndex& anIndex)
const;
124 qlonglong
imageId(
const QModelIndex& anIndex)
const;
141 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent = QModelIndex())
const override;
142 QModelIndex
parent(
const QModelIndex& childIndex)
const override;
144 int columnCount(
const QModelIndex& i)
const override;
145 QVariant
data(
const QModelIndex& i,
int role)
const override;
147 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
157 const QModelIndex&
parent)
override;
158 QMimeData*
mimeData(
const QModelIndexList& indexes)
const override;
162 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder)
override;
166 void slotPopulateModelWithNotifications();
167 void slotPopulateModel(
const bool sendNotifications);
169 void slotColumnDataChanged(
const qlonglong
imageId);
170 void slotColumnAllDataChanged();
172 void slotSourceModelAboutToBeReset();
173 void slotSourceModelReset();
174 void slotSourceRowsAboutToBeInserted(
const QModelIndex&
parent,
int start,
int end);
175 void slotSourceRowsInserted(
const QModelIndex&
parent,
int start,
int end);
176 void slotSourceRowsAboutToBeRemoved(
const QModelIndex&
parent,
int start,
int end);
177 void slotSourceRowsRemoved(
const QModelIndex&
parent,
int start,
int end);
178 void slotSourceRowsAboutToBeMoved(
const QModelIndex& sourceParent,
int sourceStart,
int sourceEnd,
179 const QModelIndex& destinationParent,
int destinationRow);
180 void slotSourceRowsMoved(
const QModelIndex& sourceParent,
int sourceStart,
int sourceEnd,
181 const QModelIndex& destinationParent,
int destinationRow);
182 void slotSourceLayoutAboutToBeChanged();
183 void slotSourceLayoutChanged();
185 void slotDatabaseImageChanged(
const ImageChangeset& imageChangeset);
188 void slotResortModel();
189 void slotClearModel(
const bool sendNotifications);
201 Item* createItemFromSourceIndex(
const QModelIndex& imageFilterModelIndex);
202 void addSourceModelIndex(
const QModelIndex& imageModelIndex,
const bool sendNotifications);
208 const QScopedPointer<Private> d;
Definition: coredbfields.h:389
Definition: coredbchangesets.h:48
Definition: itemfiltersettings.h:98
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
Definition: tableview_columnfactory.h:50
Definition: tableview_columnfactory.h:81
Definition: tableview_columnfactory.h:324
Definition: tableview_columnfactory.h:196
Definition: tableview_model.h:71
void addChild(Item *const newChild)
Definition: tableview_model.cpp:71
Item * parent
Definition: tableview_model.h:85
Item()
Definition: tableview_model.cpp:59
Item * findChildWithImageId(const qlonglong searchImageId)
Definition: tableview_model.cpp:90
~Item()
Definition: tableview_model.cpp:66
QList< Item * > children
Definition: tableview_model.h:86
void takeChild(Item *const oldChild)
Definition: tableview_model.cpp:85
void insertChild(const int pos, Item *const newChild)
Definition: tableview_model.cpp:78
qlonglong imageId
Definition: tableview_model.h:84
Definition: tableview_model.h:54
QModelIndex fromItemFilterModelIndex(const QModelIndex &imageFilterModelIndex)
Definition: tableview_model.cpp:978
Qt::DropActions supportedDropActions() const override
drag-and-drop related functions
Definition: tableview_model.cpp:1284
QModelIndex toItemFilterModelIndex(const QModelIndex &i) const
Definition: tableview_model.cpp:218
DatabaseFields::Hash< QVariant > DatabaseFieldsHashRaw
Definition: tableview_model.h:66
QVariant data(const QModelIndex &i, int role) const override
Definition: tableview_model.cpp:242
DatabaseFieldsHashRaw itemDatabaseFieldsRaw(Item *const item, const DatabaseFields::Set &requestedSet)
Definition: tableview_model.cpp:1028
Item * itemFromImageId(const qlonglong imageId) const
Definition: tableview_model.cpp:959
QList< ItemInfo > allItemInfo() const
Definition: tableview_model.cpp:1386
QModelIndex toItemModelIndex(const QModelIndex &i) const
Definition: tableview_model.cpp:230
QList< Item * > sortItems(const QList< Item * > &itemList)
Definition: tableview_model.cpp:1178
Item * itemFromIndex(const QModelIndex &i) const
Definition: tableview_model.cpp:964
~TableViewModel() override
Definition: tableview_model.cpp:203
QVariant itemDatabaseFieldRaw(Item *const item, const DatabaseFields::Set &requestedField)
Definition: tableview_model.cpp:1036
QList< TableViewColumn * > getColumnObjects()
Definition: tableview_model.cpp:765
ItemInfo infoFromItem(Item *const item) const
Definition: tableview_model.cpp:1006
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: tableview_model.cpp:751
int deepRowCount() const
Definition: tableview_model.cpp:1494
int rowCount(const QModelIndex &parent) const override
Definition: tableview_model.cpp:313
void signalGroupingModeChanged()
QModelIndex indexFromImageId(const qlonglong imageId, const int columnIndex) const
Definition: tableview_model.cpp:1060
QList< ItemInfo > imageInfos(const QModelIndexList &indexList) const
Definition: tableview_model.cpp:1105
QModelIndex parent(const QModelIndex &childIndex) const override
Definition: tableview_model.cpp:290
TableViewColumn * getColumnObject(const int columnIndex)
Definition: tableview_model.cpp:458
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
Definition: tableview_model.cpp:1355
QModelIndex itemIndex(Item *const item) const
Definition: tableview_model.cpp:1343
GroupingMode groupingMode() const
Definition: tableview_model.cpp:1391
QModelIndex toCol0(const QModelIndex &anIndex) const
Definition: tableview_model.cpp:1530
QModelIndex deepRowIndex(const int rowNumber) const
Definition: tableview_model.cpp:1407
TableViewModel(TableViewShared *const sharedObject, QObject *const parent=nullptr)
Definition: tableview_model.cpp:138
QStringList mimeTypes() const override
Definition: tableview_model.cpp:1289
QMimeData * mimeData(const QModelIndexList &indexes) const override
Definition: tableview_model.cpp:1256
ItemInfo imageInfo(const QModelIndex &index) const
Definition: tableview_model.cpp:1131
GroupingMode
Definition: tableview_model.h:60
@ GroupingShowSubItems
Definition: tableview_model.h:63
@ GroupingHideGrouped
Definition: tableview_model.h:61
@ GroupingIgnoreGrouping
Definition: tableview_model.h:62
void slotSetActive(const bool isActive)
Definition: tableview_model.cpp:1589
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: tableview_model.cpp:257
void removeColumnAt(const int columnIndex)
Definition: tableview_model.cpp:443
int indexToDeepRowNumber(const QModelIndex &index) const
Definition: tableview_model.cpp:1447
void loadColumnProfile(const TableViewColumnProfile &columnProfile)
Definition: tableview_model.cpp:476
int columnCount(const QModelIndex &i) const override
Definition: tableview_model.cpp:208
ItemInfoList infosFromItems(const QList< Item * > &items) const
Definition: tableview_model.cpp:1016
QList< qlonglong > imageIds(const QModelIndexList &indexList) const
Definition: tableview_model.cpp:1079
void addColumnAt(const TableViewColumnDescription &description, const int targetColumn=-1)
Definition: tableview_model.cpp:349
int findChildSortedPosition(Item *const parentItem, Item *const childItem)
Definition: tableview_model.cpp:1602
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
Definition: tableview_model.cpp:1301
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Definition: tableview_model.cpp:1189
void setGroupingMode(const GroupingMode newGroupingMode)
Definition: tableview_model.cpp:1396
int firstDeepRowNotInList(const QList< QModelIndex > &needleList)
Definition: tableview_model.cpp:1535
QModelIndex fromItemModelIndex(const QModelIndex &imageModelIndex)
Definition: tableview_model.cpp:992
TableViewColumnProfile getColumnProfile() const
Definition: tableview_model.cpp:463
qlonglong imageId(const QModelIndex &anIndex) const
Definition: tableview_model.cpp:1374
bool lessThan(Item *const itemA, Item *const itemB)
Definition: tableview_model.cpp:1219
void scheduleResort()
Definition: tableview_model.cpp:1331
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: tableview_model.cpp:330
Definition: tableview_shared.h:44
Definition: piwigotalker.h:48
@ Orientation
Definition: coredbfields.h:86
@ LessThan
Definition: coredbsearchxml.h:71
Definition: datefolderview.cpp:43
DropAction
Definition: itemdragdrop.cpp:60