digiKam
|
Public Types | |
enum | ShowfotoItemModelRoles { ShowfotoItemModelPointerRole = Qt::UserRole , ShowfotoItemModelInternalId = Qt::UserRole + 1 , ThumbnailRole = Qt::UserRole + 2 , ExtraDataRole = Qt::UserRole + 3 , ExtraDataDuplicateCount = Qt::UserRole + 6 , FilterModelRoles = Qt::UserRole + 100 } |
Public Slots | |
void | reAddingFinished () |
void | reAddShowfotoItemInfos (const ShowfotoItemInfoList &infos) |
void | slotFileDeleted (const QString &folder, const QString &file, bool status) |
void | slotFileUploaded (const ShowfotoItemInfo &info) |
void | slotThumbInfoLoaded (const ShowfotoItemInfo &info, const QImage &thumbnailImage) |
Signals | |
void | allRefreshingFinished () |
void | itemInfosAboutToBeAdded (const QList< ShowfotoItemInfo > &infos) |
void | itemInfosAboutToBeRemoved (const QList< ShowfotoItemInfo > &infos) |
void | itemInfosAdded (const QList< ShowfotoItemInfo > &infos) |
void | itemInfosRemoved (const QList< ShowfotoItemInfo > &infos) |
void | preprocess (const QList< ShowfotoItemInfo > &infos) |
void | processAdded (const QList< ShowfotoItemInfo > &infos) |
void | readyForIncrementalRefresh () |
void | signalItemThumbnail (const ShowfotoItemInfo &info, const QPixmap &pix) |
void | signalThumbInfo (const ShowfotoItemInfo &info, const QImage &thumbnailImage) const |
void | thumbnailAvailable (const QModelIndex &index, int requestedSize) |
void | thumbnailFailed (const QModelIndex &index, int requestedSize) |
Public Member Functions | |
void | addShowfotoItemInfo (const ShowfotoItemInfo &info) |
void | addShowfotoItemInfos (const QList< ShowfotoItemInfo > &infos) |
void | addShowfotoItemInfosSynchronously (const QList< ShowfotoItemInfo > &infos) |
void | addShowfotoItemInfoSynchronously (const ShowfotoItemInfo &info) |
void | clearShowfotoItemInfos () |
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 | getThumbnail (const ShowfotoItemInfo &itemInfo, QImage &thumbnail) const |
bool | hasImage (const ShowfotoItemInfo &info) const |
bool | hasImage (qlonglong id) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
QList< QModelIndex > | indexesForShowfotoItemId (qlonglong id) const |
QList< QModelIndex > | indexesForShowfotoItemInfo (const ShowfotoItemInfo &info) const |
QList< QModelIndex > | indexesForUrl (const QUrl &fileUrl) const |
QModelIndex | indexForShowfotoItemId (qlonglong id) const |
QModelIndex | indexForShowfotoItemInfo (const ShowfotoItemInfo &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 |
QMimeData * | mimeData (const QModelIndexList &indexes) const |
QStringList | mimeTypes () const |
int | numberOfIndexesForShowfotoItemId (qlonglong id) const |
int | numberOfIndexesForShowfotoItemInfo (const ShowfotoItemInfo &info) const |
bool | pixmapForItem (const QString &url, QPixmap &pix) const |
void | removeIndex (const QModelIndex &index) |
void | removeIndexs (const QList< QModelIndex > &indexes) |
void | removeShowfotoItemInfo (const ShowfotoItemInfo &info) |
void | removeShowfotoItemInfos (const QList< ShowfotoItemInfo > &infos) |
int | rowCount (const QModelIndex &parent) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole) override |
void | setDragDropHandler (AbstractItemDragDropHandler *handler) |
void | setEmitDataChanged (bool emitSignal) |
void | setExifRotate (bool rotate) |
void | setKeepsFileUrlCache (bool keepCache) |
void | setPreloadThumbnails (bool preload) |
void | setPreloadThumbnailSize (const ThumbnailSize &thumbSize) |
DECLARE_MODEL_DRAG_DROP_METHODS void | setSendRemovalSignals (bool send) |
void | setShowfotoItemInfos (const QList< ShowfotoItemInfo > &infos) |
void | setThumbnailLoadThread (ThumbnailLoadThread *thread) |
void | setThumbnailSize (const ThumbnailSize &thumbSize) |
qlonglong | showfotoItemId (const QModelIndex &index) const |
qlonglong | showfotoItemId (int row) const |
QList< qlonglong > | showfotoItemIds () const |
QList< qlonglong > | showfotoItemIds (const QList< QModelIndex > &indexes) const |
ShowfotoItemInfo | showfotoItemInfo (const QModelIndex &index) const |
ShowfotoItemInfo | showfotoItemInfo (const QUrl &fileUrl) const |
ShowfotoItemInfo | showfotoItemInfo (int row) const |
ShowfotoItemInfo & | showfotoItemInfoRef (const QModelIndex &index) const |
ShowfotoItemInfo & | showfotoItemInfoRef (int row) const |
QList< ShowfotoItemInfo > | showfotoItemInfos () const |
ShowfotoItemInfoList | showfotoItemInfos (const QList< QModelIndex > &indexes) const |
QList< ShowfotoItemInfo > | showfotoItemInfos (const QUrl &fileUrl) const |
ShowfotoThumbnailModel (QObject *const parent) | |
Qt::DropActions | supportedDropActions () const |
ThumbnailLoadThread * | thumbnailLoadThread () const |
ThumbnailSize | thumbnailSize () const |
QList< ShowfotoItemInfo > | uniqueShowfotoItemInfos () const |
~ShowfotoThumbnailModel () override | |
Static Public Member Functions | |
static qlonglong | retrieveShowfotoItemId (const QModelIndex &index) |
static ShowfotoItemInfo | retrieveShowfotoItemInfo (const QModelIndex &index) |
Protected Slots | |
void | slotThumbnailLoaded (const LoadingDescription &loadingDescription, const QPixmap &thumb) |
Protected Member Functions | |
void | emitDataChangedForAll () |
void | emitDataChangedForSelections (const QItemSelection &selection) |
void | finishIncrementalRefresh () |
void | requestIncrementalRefresh () |
virtual void | showfotoItemInfosAboutToBeRemoved (int, int) |
void | showfotoItemInfosCleared () override |
void | startIncrementalRefresh () |
Protected Attributes | |
AbstractItemDragDropHandler * | m_dragDropHandler |
|
inherited |
|
explicit |
An ItemModel that supports thumbnail loading. You need to set a ThumbnailLoadThread to enable thumbnail loading. Adjust the thumbnail size to your needs. Note that setKeepsFilePatindexesForPathhCache is enabled per default.
References signalThumbInfo(), and slotThumbInfoLoaded().
|
override |
References showfotoItemInfosCleared().
|
inherited |
References ShowFoto::ShowfotoItemModel::addShowfotoItemInfos().
Referenced by ShowFoto::ShowfotoItemModel::slotFileUploaded().
|
inherited |
|
inherited |
References ShowFoto::ShowfotoItemModel::processAdded().
Referenced by ShowFoto::ShowfotoItemModel::addShowfotoItemInfoSynchronously().
|
inherited |
addShowfotoItemInfo() 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 ShowFoto::ShowfotoItemModel::addShowfotoItemInfosSynchronously().
|
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 |
Clears the ShowfotoItemInfos and resets the model.
References ShowFoto::ShowfotoItemModel::itemInfosAboutToBeRemoved(), ShowFoto::ShowfotoItemModel::itemInfosRemoved(), and ShowFoto::ShowfotoItemModel::showfotoItemInfosCleared().
Referenced by ShowFoto::ShowfotoItemModel::setShowfotoItemInfos().
|
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 ShowFoto::ShowfotoItemModel::data(), ShowFoto::ShowfotoItemInfo::folder, getThumbnail(), ShowFoto::ShowfotoItemModel::index(), ShowFoto::ShowfotoItemInfo::isNull(), ShowFoto::ShowfotoItemInfo::name, pixmapForItem(), ShowFoto::ShowfotoItemModel::showfotoItemInfo(), signalThumbInfo(), ShowFoto::ShowfotoItemModel::ThumbnailRole, and ShowFoto::ShowfotoItemInfo::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 |
|
overrideinherited |
bool ShowFoto::ShowfotoThumbnailModel::getThumbnail | ( | const ShowfotoItemInfo & | itemInfo, |
QImage & | thumbnail | ||
) | const |
References ShowFoto::ShowfotoItemInfo::folder, and ShowFoto::ShowfotoItemInfo::name.
Referenced by data().
|
inherited |
References ShowFoto::ShowfotoItemInfo::url.
|
inherited |
|
overrideinherited |
|
overrideinherited |
Referenced by ShowFoto::ShowfotoItemModel::data(), data(), ShowFoto::ShowfotoItemModel::flags(), ShowFoto::ShowfotoItemModel::indexForShowfotoItemId(), ShowFoto::ShowfotoItemModel::removeIndex(), ShowFoto::ShowfotoItemModel::removeIndexs(), ShowFoto::ShowfotoItemModel::retrieveShowfotoItemInfo(), setData(), ShowFoto::ShowfotoItemModel::showfotoItemInfo(), ShowFoto::ShowfotoItemModel::showfotoItemInfoRef(), ShowFoto::ShowfotoItemModel::showfotoItemInfos(), slotThumbInfoLoaded(), and slotThumbnailLoaded().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
References ShowFoto::ShowfotoItemModel::index().
|
inherited |
Return the index of a given ShowfotoItemInfo, if it exists in the model.
References ShowFoto::ShowfotoItemModel::indexForUrl(), and ShowFoto::ShowfotoItemInfo::url.
Referenced by ShowFoto::ShowfotoItemModel::removeShowfotoItemInfo(), and ShowFoto::ShowfotoItemModel::removeShowfotoItemInfos().
|
inherited |
Returns the index or ShowfotoItemInfo 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.
Referenced by ShowFoto::ShowfotoItemModel::indexForShowfotoItemInfo().
|
virtualinherited |
Referenced by Digikam::DragDropModelImplementation::dragDropFlagsV2().
|
virtualinherited |
Referenced by Digikam::DragDropModelImplementation::dragDropFlagsV2().
|
inherited |
|
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 ShowfotoItemInfos 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 clearShowfotoItemInfos().
Referenced by ShowFoto::ShowfotoItemModel::clearShowfotoItemInfos().
|
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 ShowfotoItemInfos 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 clearShowfotoItemInfos().
Referenced by ShowFoto::ShowfotoItemModel::clearShowfotoItemInfos().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
bool ShowFoto::ShowfotoThumbnailModel::pixmapForItem | ( | const QString & | url, |
QPixmap & | pix | ||
) | const |
Referenced by data().
|
signalinherited |
Connect to this signal only if you are the current preprocessor.
|
signalinherited |
|
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.
|
inherited |
Remove the given infos or indexes directly from the model.
References ShowFoto::ShowfotoItemModel::index(), and ShowFoto::ShowfotoItemModel::removeIndexs().
Referenced by ShowFoto::ShowfotoItemModel::removeShowfotoItemInfo(), and ShowFoto::ShowfotoItemModel::removeShowfotoItemInfos().
|
inherited |
References ShowFoto::ShowfotoItemModel::index().
Referenced by ShowFoto::ShowfotoItemModel::removeIndex().
|
inherited |
|
inherited |
|
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.
|
staticinherited |
|
staticinherited |
Retrieve the ShowfotoItemInfo object from the data() function of the given index The index may be from a QSortFilterProxyModel as long as an ShowfotoItemModel is at the end.
References ShowFoto::ShowfotoItemModel::index(), ShowFoto::ShowfotoItemModel::showfotoItemInfo(), ShowFoto::ShowfotoItemModel::ShowfotoItemModelInternalId, and ShowFoto::ShowfotoItemModel::ShowfotoItemModelPointerRole.
Referenced by ShowFoto::ShowfotoCoordinatesOverlay::checkIndex(), and ShowFoto::ShowfotoDelegate::paint().
|
overrideinherited |
QAbstractListModel implementations
|
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 ShowFoto::ShowfotoItemModel::index(), ShowFoto::ShowfotoItemModel::ThumbnailRole, and value.
|
inherited |
Set a drag drop handler.
References Digikam::DragDropModelImplementation::m_dragDropHandler.
Referenced by Digikam::DigikamItemView::DigikamItemView(), and Digikam::ImportIconView::ImportIconView().
void ShowFoto::ShowfotoThumbnailModel::setEmitDataChanged | ( | bool | emitSignal | ) |
Enable emitting dataChanged() when a thumbnail becomes available. The thumbnailAvailable() signal will be emitted in any case. Default is true.
void ShowFoto::ShowfotoThumbnailModel::setExifRotate | ( | bool | rotate | ) |
|
inherited |
If a cache is kept, lookup by file path is fast, without a cache it is O(n). Default is false.
void ShowFoto::ShowfotoThumbnailModel::setPreloadThumbnails | ( | bool | preload | ) |
Enable preloading of thumbnails: If preloading is enabled, for every entry in the model a thumbnail generation is started. Default: false.
void ShowFoto::ShowfotoThumbnailModel::setPreloadThumbnailSize | ( | const ThumbnailSize & | thumbSize | ) |
If you want to fix a size for preloading, do it here.
|
inherited |
DragDrop methods Enable sending of itemInfosAboutToBeRemoved and itemsInfosRemoved signals. Default: false
|
inherited |
Clears and adds infos.
References ShowFoto::ShowfotoItemModel::addShowfotoItemInfos(), and ShowFoto::ShowfotoItemModel::clearShowfotoItemInfos().
void ShowFoto::ShowfotoThumbnailModel::setThumbnailLoadThread | ( | ThumbnailLoadThread * | thread | ) |
Enable thumbnail loading and set the thread that shall be used. The thumbnail size of this thread will be adjusted.
References slotThumbnailLoaded().
void ShowFoto::ShowfotoThumbnailModel::setThumbnailSize | ( | const ThumbnailSize & | thumbSize | ) |
Set the thumbnail size to use.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Returns the ShowfotoItemInfo object, reference from the underlying data pointed to by the index. For ShowfotoItemInfo and ShowfotoItemInfoId If the index is not valid they will return a null ShowfotoItemInfo, and 0 respectively, ShowfotoItemInfoRef must not be called with an invalid index as it will crash.
References ShowFoto::ShowfotoItemModel::index().
Referenced by data(), ShowFoto::ShowfotoItemModel::retrieveShowfotoItemInfo(), ShowFoto::ShowfotoSortFilterModel::showfotoItemInfo(), ShowFoto::ShowfotoItemModel::showfotoItemInfos(), ShowFoto::ShowfotoItemModel::slotFileDeleted(), and slotThumbnailLoaded().
|
inherited |
References ShowFoto::ShowfotoItemInfo::url.
|
inherited |
Returns the ShowfotoItemInfo object, reference from the underlying data of the given row (parent is the invalid QModelIndex, column is 0). Note that ShowfotoItemInfoRef must not be called with an invalid index as it will crash.
|
inherited |
References ShowFoto::ShowfotoItemModel::index().
|
inherited |
|
inherited |
|
inherited |
References ShowFoto::ShowfotoItemModel::index(), and ShowFoto::ShowfotoItemModel::showfotoItemInfo().
Referenced by ShowFoto::ShowfotoDragDropHandler::createMimeData().
|
inherited |
References ShowFoto::ShowfotoItemInfo::url.
|
inlineprotectedvirtualinherited |
Called before rowsAboutToBeRemoved
|
overrideprotectedvirtual |
Called when the internal storage is cleared.
Reimplemented from ShowFoto::ShowfotoItemModel.
Referenced by ~ShowfotoThumbnailModel().
|
signal |
Referenced by slotThumbnailLoaded().
|
signal |
Referenced by data(), and ShowfotoThumbnailModel().
|
slotinherited |
References ShowFoto::ShowfotoItemModel::showfotoItemInfo().
|
slotinherited |
|
slot |
|
protectedslot |
References Digikam::LoadingDescription::filePath, ShowFoto::ShowfotoItemModel::index(), ShowFoto::ShowfotoItemModel::indexesForUrl(), Digikam::LoadingDescription::previewParameters, ShowFoto::ShowfotoItemModel::showfotoItemInfo(), signalItemThumbnail(), Digikam::LoadingDescription::PreviewParameters::size, thumbnailAvailable(), and thumbnailFailed().
Referenced by setThumbnailLoadThread().
|
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().
|
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 |
Referenced by slotThumbInfoLoaded(), and slotThumbnailLoaded().
|
signal |
Referenced by slotThumbInfoLoaded(), and slotThumbnailLoaded().
ThumbnailLoadThread * ShowFoto::ShowfotoThumbnailModel::thumbnailLoadThread | ( | ) | const |
ThumbnailSize ShowFoto::ShowfotoThumbnailModel::thumbnailSize | ( | ) | const |
|
inherited |
|
protectedinherited |