digiKam
|
Public Types | |
enum | ImportItemModelRoles { ImportItemModelPointerRole = Qt::UserRole , ImportItemModelInternalId = Qt::UserRole + 1 , ThumbnailRole = Qt::UserRole + 2 , ExtraDataRole = Qt::UserRole + 3 , ExtraDataDuplicateCount = Qt::UserRole + 6 , FilterModelRoles = Qt::UserRole + 100 } |
Public Slots | |
void | addCamItemInfo (const CamItemInfo &info) |
void | addCamItemInfos (const CamItemInfoList &infos) |
void | reAddCamItemInfos (const CamItemInfoList &infos) |
void | reAddingFinished () |
void | slotFileDeleted (const QString &folder, const QString &file, bool status) |
void | slotFileUploaded (const CamItemInfo &info) |
Signals | |
void | allRefreshingFinished () |
void | itemInfosAboutToBeAdded (const QList< CamItemInfo > &infos) |
void | itemInfosAboutToBeRemoved (const QList< CamItemInfo > &infos) |
void | itemInfosAdded (const QList< CamItemInfo > &infos) |
void | itemInfosRemoved (const QList< CamItemInfo > &infos) |
void | preprocess (const QList< CamItemInfo > &infos) |
void | processAdded (const QList< CamItemInfo > &infos) |
void | readyForIncrementalRefresh () |
void | thumbnailAvailable (const QModelIndex &index, int requestedSize) |
void | thumbnailFailed (const QModelIndex &index, int requestedSize) |
Public Member Functions | |
void | addCamItemInfosSynchronously (const Digikam::CamItemInfoList &infos) |
void | addCamItemInfoSynchronously (const CamItemInfo &info) |
qlonglong | camItemId (const QModelIndex &index) const |
qlonglong | camItemId (int row) const |
QList< qlonglong > | camItemIds () const |
QList< qlonglong > | camItemIds (const QList< QModelIndex > &indexes) const |
CamItemInfo | camItemInfo (const QModelIndex &index) const |
CamItemInfo | camItemInfo (const QUrl &fileUrl) const |
CamItemInfo | camItemInfo (int row) const |
CamItemInfo & | camItemInfoRef (const QModelIndex &index) const |
CamItemInfo & | camItemInfoRef (int row) const |
QList< CamItemInfo > | camItemInfos () const |
CamItemInfoList | camItemInfos (const QList< QModelIndex > &indexes) const |
QList< CamItemInfo > | camItemInfos (const QUrl &fileUrl) const |
void | clearCamItemInfos () |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
virtual Qt::ItemFlags | dragDropFlags (const QModelIndex &index) const |
Qt::ItemFlags | dragDropFlagsV2 (const QModelIndex &index) const |
AbstractItemDragDropHandler * | dragDropHandler () const |
bool | dropMimeData (const QMimeData *, Qt::DropAction, int, int, const QModelIndex &) |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | hasImage (const CamItemInfo &info) const |
bool | hasImage (qlonglong id) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
ImportThumbnailModel (QObject *const parent) | |
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
QList< QModelIndex > | indexesForCamItemId (qlonglong id) const |
QList< QModelIndex > | indexesForCamItemInfo (const CamItemInfo &info) const |
QList< QModelIndex > | indexesForUrl (const QUrl &fileUrl) const |
QModelIndex | indexForCamItemId (qlonglong id) const |
QModelIndex | indexForCamItemInfo (const CamItemInfo &info) const |
QModelIndex | indexForUrl (const QUrl &fileUrl) const |
virtual bool | isDragEnabled (const QModelIndex &index) const |
virtual bool | isDropEnabled (const QModelIndex &index) const |
bool | isEmpty () const |
bool | isRefreshing () const |
bool | keepsFileUrlCache () const |
QMimeData * | mimeData (const QModelIndexList &indexes) const |
QStringList | mimeTypes () const |
int | numberOfIndexesForCamItemId (qlonglong id) const |
int | numberOfIndexesForCamItemInfo (const CamItemInfo &info) const |
void | removeCamItemInfo (const CamItemInfo &info) |
void | removeCamItemInfos (const QList< CamItemInfo > &infos) |
void | removeIndex (const QModelIndex &index) |
void | removeIndexs (const QList< QModelIndex > &indexes) |
int | rowCount (const QModelIndex &parent) const override |
QAbstractListModel implementation. More... | |
void | setCameraThumbsController (CameraThumbsCtrl *const thumbsCtrl) override |
Sets the camera thumbs controller which is used to get the thumbnails for item infos. More... | |
void | setCamItemInfos (const CamItemInfoList &infos) |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole) override |
void | setDragDropHandler (AbstractItemDragDropHandler *handler) |
void | setEmitDataChanged (bool emitSignal) |
void | setKeepsFileUrlCache (bool keepCache) |
DECLARE_MODEL_DRAG_DROP_METHODS void | setSendRemovalSignals (bool send) |
DragDrop methods. More... | |
Qt::DropActions | supportedDropActions () const |
ThumbnailSize | thumbnailSize () const |
Get the thumbnail size. More... | |
QList< CamItemInfo > | uniqueCamItemInfos () const |
~ImportThumbnailModel () override | |
Static Public Member Functions | |
static qlonglong | retrieveCamItemId (const QModelIndex &index) |
static CamItemInfo | retrieveCamItemInfo (const QModelIndex &index) |
Protected Member Functions | |
virtual void | camItemInfosCleared () |
void | emitDataChangedForAll () |
void | emitDataChangedForSelections (const QItemSelection &selection) |
void | finishIncrementalRefresh () |
void | finishRefresh () |
bool | hasIncrementalRefreshPending () const |
virtual void | itemInfosAboutToBeRemoved (int, int) |
void | requestIncrementalRefresh () |
void | startIncrementalRefresh () |
void | startRefresh () |
Protected Attributes | |
AbstractItemDragDropHandler * | m_dragDropHandler |
|
inherited |
|
explicit |
This model provides thumbnail loading, it uses the Camera Controller to retrieve thumbnails for CamItemInfos. It also provides preloading of thumbnails, and caching facility. Thumbnails size can be adjusted.
References Digikam::ImportItemModel::setKeepsFileUrlCache().
|
override |
|
slotinherited |
References Digikam::ImportItemModel::addCamItemInfos().
Referenced by Digikam::ImportItemModel::slotFileUploaded().
|
slotinherited |
|
inherited |
References Digikam::ImportItemModel::processAdded().
Referenced by Digikam::ImportItemModel::addCamItemInfoSynchronously().
|
inherited |
addCamItemInfo() is asynchronous if a prepocessor is set. This method first adds the info, synchronously. Only afterwards, the preprocessor will have the opportunity to process it. This method also bypasses any incremental updates.
References Digikam::ImportItemModel::addCamItemInfosSynchronously().
|
signalinherited |
Signals that the model has finished currently with all scheduled refreshing, full or incremental, and all preprocessing. The model is in polished, clean situation right now.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
References Digikam::ImportItemModel::camItemId(), and Digikam::ImportItemModel::index().
|
inherited |
Returns the CamItemInfo object, reference from the underlying data pointed to by the index. For camItemInfo and camItemInfoId If the index is not valid they will return a null CamItemInfo, and 0 respectively, camItemInfoRef must not be called with an invalid index as it will crash.
References Digikam::ImportItemModel::index().
Referenced by Digikam::ImportSortFilterModel::camItemInfo(), Digikam::ImportItemModel::camItemInfos(), data(), Digikam::ImportItemModel::retrieveCamItemInfo(), and Digikam::ImportItemModel::slotFileDeleted().
|
inherited |
References Digikam::ImportItemModel::index(), and Digikam::CamItemInfo::url().
|
inherited |
Returns the CamItemInfo object, reference from the underlying data of the given row (parent is the invalid QModelIndex, column is 0). Note that camItemInfoRef must not be called with an invalid index as it will crash.
|
inherited |
References Digikam::ImportItemModel::index().
Referenced by Digikam::ImportIconView::assignColorLabel(), Digikam::ImportIconView::assignColorLabelToSelected(), Digikam::ImportIconView::assignPickLabel(), Digikam::ImportIconView::assignPickLabelToSelected(), Digikam::ImportIconView::assignRating(), Digikam::ImportThumbnailBar::assignRating(), Digikam::ImportIconView::assignRatingToSelected(), Digikam::ImportIconView::assignTagToSelected(), Digikam::ImportIconView::camItemInfoRef(), Digikam::ImportIconView::removeTagFromSelected(), and Digikam::ImportRatingOverlay::updateRating().
|
inherited |
|
inherited |
|
inherited |
References Digikam::ImportItemModel::camItemInfo(), and Digikam::ImportItemModel::index().
Referenced by Digikam::ImportDragDropHandler::createMimeData().
|
inherited |
References Digikam::ImportItemModel::index(), and Digikam::CamItemInfo::url().
|
inlineprotectedvirtualinherited |
Called when the internal storage is cleared.
Referenced by Digikam::ImportItemModel::clearCamItemInfos().
|
inherited |
Clears the CamItemInfos and resets the model.
References Digikam::ImportItemModel::camItemInfosCleared().
Referenced by Digikam::ImportItemModel::setCamItemInfos().
|
override |
Handles the ThumbnailRole. If the pixmap is available, returns it in the QVariant. If it still needs to be loaded, returns a null QVariant and emits thumbnailAvailable() as soon as it is available.
References Digikam::ImportItemModel::camItemInfo(), Digikam::ImportItemModel::data(), Digikam::ImportItemModel::index(), Digikam::CamItemInfo::isNull(), Digikam::CamItemInfo::previewPossible, Digikam::ImportItemModel::ThumbnailRole, and Digikam::CamItemInfo::url().
|
virtualinherited |
Call from your flags() method, adding the relevant drag drop flags. Default implementation enables both drag and drop on the index if a drag drop handler is set. Reimplement to fine-tune. Note: There is an alternative below.
References Digikam::DragDropModelImplementation::m_dragDropHandler.
Referenced by Digikam::ItemModel::flags(), ShowFoto::ShowfotoItemModel::flags(), and Digikam::ImportItemModel::flags().
|
inherited |
This is an alternative approach to dragDropFlags(). dragDropFlagsV2 calls the virtual methods isDragEnabled() and isDropEnabled() which you then reimplement. Use simple dragDropFlags() if you need not customization, or reimplement dragDropFlags() if you fine-tune it yourself.
References Digikam::DragDropModelImplementation::isDragEnabled(), and Digikam::DragDropModelImplementation::isDropEnabled().
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
overrideinherited |
|
inherited |
References Digikam::CamItemInfo::url().
|
inherited |
|
protectedinherited |
|
overrideinherited |
|
overrideinherited |
Referenced by Digikam::ImportItemModel::camItemId(), Digikam::ImportItemModel::camItemIds(), Digikam::ImportItemModel::camItemInfo(), Digikam::ImportItemModel::camItemInfoRef(), Digikam::ImportItemModel::camItemInfos(), Digikam::ImportItemModel::data(), data(), Digikam::ImportItemModel::flags(), Digikam::ImportItemModel::indexForCamItemId(), Digikam::ImportItemModel::removeCamItemInfos(), Digikam::ImportItemModel::removeIndex(), Digikam::ImportItemModel::removeIndexs(), Digikam::ImportItemModel::retrieveCamItemId(), Digikam::ImportItemModel::retrieveCamItemInfo(), and setData().
|
inherited |
|
inherited |
References Digikam::CamItemInfo::id, and Digikam::ImportItemModel::indexesForCamItemId().
|
inherited |
References Digikam::ImportItemModel::indexesForCamItemId().
|
inherited |
|
inherited |
Return the index of a given CamItemInfo, if it exists in the model.
References Digikam::CamItemInfo::id, and Digikam::ImportItemModel::indexForCamItemId().
|
inherited |
Returns the index or CamItemInfo object from the underlying data for the given file url. In case of multiple occurrences of the same file, the simpler overrides returns any one found first, use the QList methods to retrieve all occurrences.
References Digikam::ImportItemModel::indexForCamItemId().
|
virtualinherited |
Referenced by Digikam::DragDropModelImplementation::dragDropFlagsV2().
|
virtualinherited |
Referenced by Digikam::DragDropModelImplementation::dragDropFlagsV2().
|
inherited |
|
inherited |
Returns true if this model is currently refreshing. For a preprocessor this means that, although the preprocessor may currently have processed all it got, more batches are to be expected.
|
signalinherited |
Informs that ItemInfos will be added to the model. This signal is sent before the model data is changed and views are informed.
|
signalinherited |
Informs that CamItemInfos will be removed from the model. This signal is sent before the model data is changed and views are informed. Note: You need to explicitly enable sending of this signal. It is not sent in clearCamItemInfos().
|
inlineprotectedvirtualinherited |
Called before rowsAboutToBeRemoved
|
signalinherited |
Informs that ItemInfos have been added to the model. This signal is sent after the model data is changed and views are informed.
|
signalinherited |
Informs that CamItemInfos have been removed from the model. This signal is sent after the model data is changed and views are informed. Note: You need to explicitly enable sending of this signal. It is not sent in clearCamItemInfos().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Referenced by Digikam::ImportItemModel::numberOfIndexesForCamItemInfo().
|
inherited |
|
signalinherited |
Connect to this signal only if you are the current preprocessor.
|
signalinherited |
Referenced by Digikam::ImportItemModel::addCamItemInfosSynchronously().
|
slotinherited |
|
slotinherited |
|
signalinherited |
Signals that the model is right now ready to start an incremental refresh. This is guaranteed only for the scope of emitting this signal.
Referenced by Digikam::ImportItemModel::requestIncrementalRefresh().
|
inherited |
References Digikam::ImportItemModel::removeCamItemInfos().
Referenced by Digikam::ImportItemModel::slotFileDeleted().
|
inherited |
|
inherited |
Remove the given infos or indexes directly from the model.
References Digikam::ImportItemModel::index(), and Digikam::ImportItemModel::removeIndexs().
|
inherited |
References Digikam::ImportItemModel::index().
Referenced by Digikam::ImportItemModel::removeIndex().
|
protectedinherited |
As soon as the model is ready to start an incremental refresh, the signal readyForIncrementalRefresh() will be emitted. The signal will be emitted inline if the model is ready right now.
References Digikam::ImportItemModel::readyForIncrementalRefresh().
|
staticinherited |
|
staticinherited |
Retrieve the CamItemInfo object from the data() function of the given index The index may be from a QSortFilterProxyModel as long as an ImportItemModel is at the end.
References Digikam::ImportItemModel::camItemInfo(), Digikam::ImportItemModel::ImportItemModelInternalId, Digikam::ImportItemModel::ImportItemModelPointerRole, and Digikam::ImportItemModel::index().
Referenced by Digikam::ImportCoordinatesOverlay::checkIndex(), Digikam::ImportLockOverlay::checkIndex(), Digikam::ImportDownloadOverlay::checkIndex(), Digikam::ImportRotateOverlay::checkIndex(), and Digikam::ImportDelegate::paint().
|
overrideinherited |
QAbstractListModel implementation.
|
overridevirtual |
Sets the camera thumbs controller which is used to get the thumbnails for item infos.
Reimplemented from Digikam::ImportItemModel.
References Digikam::ImportItemModel::setCameraThumbsController().
|
inherited |
Clears and adds infos.
References Digikam::ImportItemModel::addCamItemInfos(), and Digikam::ImportItemModel::clearCamItemInfos().
|
override |
You can override the current thumbnail size by giving an integer value for ThumbnailRole. Set a null QVariant to use the thumbnail size set by setThumbnailSize() again. The index given here is ignored for this purpose.
References Digikam::ImportItemModel::index(), Digikam::ImportItemModel::ThumbnailRole, and value.
|
inherited |
Set a drag drop handler.
References Digikam::DragDropModelImplementation::m_dragDropHandler.
Referenced by Digikam::DigikamItemView::DigikamItemView(), and Digikam::ImportIconView::ImportIconView().
void Digikam::ImportThumbnailModel::setEmitDataChanged | ( | bool | emitSignal | ) |
Enable emitting dataChanged() when a thumbnail becomes available. The thumbnailAvailable() signal will be emitted in any case. Default is true.
|
inherited |
If a cache is kept, lookup by file path is fast, without a cache it is O(n). Default is false.
Referenced by ImportThumbnailModel().
|
inherited |
DragDrop methods.
Enable sending of itemInfosAboutToBeRemoved and itemsInfosRemoved signals. Default: false
|
slotinherited |
|
slotinherited |
References Digikam::ImportItemModel::addCamItemInfo().
Referenced by Digikam::ImportItemModel::setCameraThumbsController().
|
protectedinherited |
Starts an incremental refresh operation. You shall only call this method from a slot connected to readyForIncrementalRefresh(). To initiate an incremental refresh, call requestIncrementalRefresh().
|
protectedinherited |
Subclasses that add CamItemInfos in batches shall call startRefresh() when they start sending batches and finishRefresh() when they have finished. No incremental refreshes will be started while listing. A clearCamItemInfos() always stops listing, calling finishRefresh() is then not necessary.
|
inherited |
Implements the relevant QAbstractItemModel methods for drag and drop. All functionality is redirected to the handler. dropMimeData() always returns false, leaving implementation to the view.
References Digikam::CopyAction, and Digikam::MoveAction.
|
signal |
|
signal |
ThumbnailSize Digikam::ImportThumbnailModel::thumbnailSize | ( | ) | const |
Get the thumbnail size.
|
inherited |
References Digikam::CamItemInfo::id.
|
protectedinherited |