digiKam
|
Public Types | |
enum | AdditionalRoles { CategoryDisplayRole = 0x17CE990A , CategorySortRole = 0x27857E60 } |
enum | ImportFilterModelRoles { CategorizationModeRole = ImportItemModel::FilterModelRoles + 1 , SortOrderRole = ImportItemModel::FilterModelRoles + 2 , CategoryFormatRole = ImportItemModel::FilterModelRoles + 3 , CategoryDateRole = ImportItemModel::FilterModelRoles + 4 , ImportFilterModelPointerRole = ImportItemModel::FilterModelRoles + 50 } |
Public Slots | |
void | setCameraThumbsController (CameraThumbsCtrl *const thumbsCtrl) |
void | setCategorizationMode (CamItemSortSettings::CategorizationMode mode) |
void | setFilter (Filter *) |
void | setSortOrder (CamItemSortSettings::SortOrder order) |
void | setSortRole (CamItemSortSettings::SortRole role) |
void | setStringTypeNatural (bool natural) |
Signals | |
void | camItemInfosAboutToBeRemoved (const QList< CamItemInfo > &infos) |
void | camItemInfosAdded (const QList< CamItemInfo > &infos) |
Public Member Functions | |
qlonglong | camItemId (const QModelIndex &index) const |
QList< qlonglong > | camItemIds (const QList< QModelIndex > &indexes) const |
CamItemInfo | camItemInfo (const QModelIndex &index) const |
QList< CamItemInfo > | camItemInfos (const QList< QModelIndex > &indexes) const |
QList< CamItemInfo > | camItemInfosSorted () const |
CamItemSortSettings | camItemSortSettings () const |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
ImportFilterModel * | importFilterModel () const override |
Returns this, any chained ImportFilterModel, or 0. More... | |
ImportFilterModel (QObject *const parent=nullptr) | |
QModelIndex | indexForCamItemId (qlonglong id) const |
QModelIndex | indexForCamItemInfo (const CamItemInfo &info) const |
QModelIndex | indexForPath (const QString &filePath) const |
bool | isCategorizedModel () const |
QModelIndex | mapFromDirectSourceToSourceImportModel (const QModelIndex &sourceModelIndex) const |
QModelIndex | mapFromSourceImportModel (const QModelIndex &importModelIndex) const |
QList< QModelIndex > | mapListFromSource (const QList< QModelIndex > &sourceIndexes) const |
QList< QModelIndex > | mapListToSource (const QList< QModelIndex > &indexes) const |
QModelIndex | mapToSourceImportModel (const QModelIndex &proxyIndex) const |
void | setCamItemSortSettings (const CamItemSortSettings &sorter) |
void | setCategorizedModel (bool categorizedModel) |
void | setSendCamItemInfoSignals (bool sendSignals) |
Enables sending camItemInfosAdded and camItemInfosAboutToBeRemoved. More... | |
void | setSortCategoriesByNaturalComparison (bool sortCategoriesByNaturalComparison) |
void | setSourceFilterModel (ImportSortFilterModel *const sourceModel) |
void | setSourceImportModel (ImportItemModel *const sourceModel) |
void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override |
bool | sortCategoriesByNaturalComparison () const |
int | sortColumn () const |
Qt::SortOrder | sortOrder () const |
ImportSortFilterModel * | sourceFilterModel () const |
ImportItemModel * | sourceImportModel () const |
~ImportFilterModel () override | |
Protected Slots | |
void | slotProcessAdded (const QList< CamItemInfo > &) |
void | slotRowsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
void | slotRowsInserted (const QModelIndex &parent, int start, int end) |
Protected Member Functions | |
virtual QString | categoryIdentifier (const CamItemInfo &info) const |
int | compareCategories (const QModelIndex &left, const QModelIndex &right) const override |
virtual int | compareInfosCategories (const CamItemInfo &left, const CamItemInfo &right) const |
bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override |
virtual bool | infosLessThan (const CamItemInfo &left, const CamItemInfo &right) const |
bool | lessThan (const QModelIndex &left, const QModelIndex &right) const override |
void | setDirectSourceImportModel (ImportItemModel *const sourceModel) override |
Reimplement if needed. Called only when model shall be set as (direct) sourceModel. More... | |
void | setSourceModel (QAbstractItemModel *sourceModel) override |
bool | subSortLessThan (const QModelIndex &left, const QModelIndex &right) const override |
Protected Attributes | |
ImportFilterModelPrivate *const | d_ptr |
ImportSortFilterModel * | m_chainedModel |
|
inherited |
|
explicit |
References d_ptr.
|
override |
|
inherited |
|
inherited |
References Digikam::ImportSortFilterModel::camItemId().
|
inherited |
References Digikam::ImportItemModel::camItemInfo(), Digikam::ImportSortFilterModel::mapToSourceImportModel(), and Digikam::ImportSortFilterModel::sourceImportModel().
Referenced by Digikam::ImportIconView::camItemInfo(), Digikam::ImportSortFilterModel::camItemInfos(), Digikam::ImportSortFilterModel::camItemInfosSorted(), slotRowsAboutToBeRemoved(), and slotRowsInserted().
|
inherited |
References Digikam::ImportSortFilterModel::camItemInfo().
|
signal |
Referenced by slotRowsAboutToBeRemoved().
|
signal |
Changes the current image filter settings and refilters. Changes the current image sort settings and resorts. These signals need to be explicitly enabled with setSendItemInfoSignals().
Referenced by slotRowsInserted().
|
inherited |
Returns a list of all camera infos, sorted according to this model. If you do not need a sorted list, use ImportItemModel's camItemInfo() method.
References Digikam::ImportSortFilterModel::camItemInfo().
CamItemSortSettings Digikam::ImportFilterModel::camItemSortSettings | ( | ) | const |
|
protectedvirtual |
Returns a unique identifier for the category if info. The string need not be for user display.
References Digikam::CamItemSortSettings::CategoryByDate, Digikam::CamItemSortSettings::CategoryByFolder, Digikam::CamItemSortSettings::CategoryByFormat, Digikam::CamItemInfo::ctime, Digikam::CamItemInfo::folder, Digikam::CamItemInfo::mime, and Digikam::CamItemSortSettings::NoCategories.
Referenced by data().
|
overrideprotectedvirtual |
This method compares the category of the left
index with the category of the right
index.
Internally and if not reimplemented, this method will ask for left
and right
models for role CategorySortRole. In order to correctly sort categories, the data() method of the model should return a qlonglong (or numeric) value, or a QString object. QString objects will be sorted with QString::localeAwareCompare if sortCategoriesByNaturalComparison() is true.
This means that QString() will be sorted the first one, while QString(QChar(QChar::ObjectReplacementCharacter)) and QString(QChar(QChar::ReplacementCharacter)) will be sorted in last position.
left
should be placed before the category of right
. 0 if left
and right
are on the same category, and a positive value if the category of left
should be placed after the category of right
. Reimplemented from Digikam::DCategorizedSortFilterProxyModel.
References compareInfosCategories().
|
protectedvirtual |
Reimplement to customize category sorting, Return negative if category of left < category right, Return 0 if left and right are in the same category, else return positive.
Referenced by compareCategories().
|
override |
|
overrideprotected |
|
overridevirtual |
Returns this, any chained ImportFilterModel, or 0.
Reimplemented from Digikam::ImportSortFilterModel.
|
inherited |
|
inherited |
|
inherited |
|
protectedvirtual |
Reimplement to customize sorting. Do not take categories into account here.
Referenced by subSortLessThan().
|
inherited |
References Digikam::DCategorizedSortFilterProxyModel::Private::categorizedModel.
Referenced by Digikam::DCategorizedView::categorizedIndexesIn(), Digikam::DCategorizedView::categoryAt(), Digikam::DCategorizedView::categoryRange(), Digikam::DCategorizedView::categoryVisualRect(), Digikam::DCategorizedView::currentChanged(), Digikam::DCategorizedView::dragMoveEvent(), Digikam::DCategorizedView::indexAt(), Digikam::DCategorizedView::mouseMoveEvent(), Digikam::DCategorizedView::mouseReleaseEvent(), Digikam::DCategorizedView::moveCursor(), Digikam::DCategorizedView::paintEvent(), Digikam::DCategorizedView::resizeEvent(), Digikam::DCategorizedView::rowsInserted(), Digikam::DCategorizedView::rowsRemoved(), Digikam::DCategorizedView::setSelection(), Digikam::DCategorizedView::slotLayoutChanged(), Digikam::DCategorizedView::updateGeometries(), and Digikam::DCategorizedView::visualRect().
|
overrideprotectedinherited |
Overridden from QSortFilterProxyModel. If you are subclassing DCategorizedSortFilterProxyModel, you will probably not need to reimplement this method.
It calls compareCategories() to sort by category. If the both items are in the same category (i.e. compareCategories returns 0), then subSortLessThan is called.
left
is less than the item right
when sorting.References Digikam::DCategorizedSortFilterProxyModel::Private::categorizedModel, Digikam::DCategorizedSortFilterProxyModel::compareCategories(), and Digikam::DCategorizedSortFilterProxyModel::subSortLessThan().
|
inherited |
|
inherited |
References Digikam::ImportSortFilterModel::m_chainedModel, and Digikam::ImportSortFilterModel::mapFromSourceImportModel().
Referenced by Digikam::ImportSortFilterModel::indexForCamItemId(), Digikam::ImportSortFilterModel::indexForCamItemInfo(), Digikam::ImportSortFilterModel::indexForPath(), Digikam::ImportSortFilterModel::mapFromSourceImportModel(), and Digikam::ImportSortFilterModel::mapListFromSource().
|
inherited |
References Digikam::ImportSortFilterModel::mapToSourceImportModel().
Referenced by Digikam::ImportThumbnailBar::assignRating().
|
inherited |
Convenience methods mapped to ImportItemModel. Mentioned indexes returned come from the source import image model.
References Digikam::ImportSortFilterModel::m_chainedModel, and Digikam::ImportSortFilterModel::mapToSourceImportModel().
Referenced by Digikam::ImportSortFilterModel::camItemId(), Digikam::ImportSortFilterModel::camItemInfo(), Digikam::ImportSortFilterModel::mapFromDirectSourceToSourceImportModel(), Digikam::ImportSortFilterModel::mapListToSource(), and Digikam::ImportSortFilterModel::mapToSourceImportModel().
|
slot |
void Digikam::ImportFilterModel::setCamItemSortSettings | ( | const CamItemSortSettings & | sorter | ) |
|
slot |
References setCamItemSortSettings().
|
inherited |
Enables or disables the categorization feature.
categorizedModel | whether to enable or disable the categorization feature. |
References Digikam::DCategorizedSortFilterProxyModel::Private::categorizedModel.
Referenced by Digikam::CategorizedItemModel::createFilterModel(), Digikam::ActionItemModel::createFilterModel(), setCamItemSortSettings(), Digikam::ItemFilterModel::setItemSortSettings(), and ShowFoto::ShowfotoFilterModel::setShowfotoItemSortSettings().
|
overrideprotectedvirtual |
Reimplement if needed. Called only when model shall be set as (direct) sourceModel.
Reimplemented from Digikam::ImportSortFilterModel.
References Digikam::ImportSortFilterModel::setSourceModel(), and slotProcessAdded().
|
slot |
void Digikam::ImportFilterModel::setSendCamItemInfoSignals | ( | bool | sendSignals | ) |
Enables sending camItemInfosAdded and camItemInfosAboutToBeRemoved.
References slotRowsAboutToBeRemoved(), and slotRowsInserted().
|
inherited |
Set if the sorting using CategorySortRole will use a natural comparison in the case that strings were returned. If enabled, QCollator will be used for sorting.
sortCategoriesByNaturalComparison | whether to sort using a natural comparison or not. |
References Digikam::DCategorizedSortFilterProxyModel::sortCategoriesByNaturalComparison(), and Digikam::DCategorizedSortFilterProxyModel::Private::sortCategoriesByNaturalComparison.
|
slot |
References setCamItemSortSettings().
|
slot |
References setCamItemSortSettings().
|
inherited |
|
inherited |
References Digikam::ImportSortFilterModel::m_chainedModel, Digikam::ImportSortFilterModel::setDirectSourceImportModel(), and Digikam::ImportSortFilterModel::setSourceImportModel().
Referenced by Digikam::ImportSortFilterModel::setSourceFilterModel(), and Digikam::ImportSortFilterModel::setSourceImportModel().
|
overrideprotectedinherited |
|
slot |
References setCamItemSortSettings().
|
protectedslot |
Referenced by setDirectSourceImportModel().
|
protectedslot |
References Digikam::ImportSortFilterModel::camItemInfo(), and camItemInfosAboutToBeRemoved().
Referenced by setSendCamItemInfoSignals().
|
protectedslot |
References Digikam::ImportSortFilterModel::camItemInfo(), and camItemInfosAdded().
Referenced by setSendCamItemInfoSignals().
|
overrideinherited |
Overridden from QSortFilterProxyModel. Sorts the source model using column
for the given order
.
References Digikam::DCategorizedSortFilterProxyModel::Private::sortColumn, and Digikam::DCategorizedSortFilterProxyModel::Private::sortOrder.
|
inherited |
References Digikam::DCategorizedSortFilterProxyModel::Private::sortCategoriesByNaturalComparison.
Referenced by Digikam::DCategorizedSortFilterProxyModel::setSortCategoriesByNaturalComparison().
|
inherited |
References Digikam::DCategorizedSortFilterProxyModel::Private::sortColumn.
Referenced by Digikam::DCategorizedView::categoryAt(), Digikam::DCategorizedView::categoryRange(), Digikam::DCategorizedView::paintEvent(), and Digikam::DCategorizedView::rowsInsertedArtifficial().
|
inherited |
References Digikam::DCategorizedSortFilterProxyModel::Private::sortOrder.
|
inherited |
References Digikam::ImportSortFilterModel::m_chainedModel.
|
inherited |
References Digikam::ImportSortFilterModel::m_chainedModel, and Digikam::ImportSortFilterModel::sourceImportModel().
Referenced by Digikam::ImportSortFilterModel::camItemId(), Digikam::ImportSortFilterModel::camItemInfo(), Digikam::NoDuplicatesImportFilterModel::filterAcceptsRow(), Digikam::ImportSortFilterModel::indexForCamItemId(), Digikam::ImportSortFilterModel::indexForCamItemInfo(), Digikam::ImportSortFilterModel::indexForPath(), Digikam::ImportSortFilterModel::setSourceFilterModel(), and Digikam::ImportSortFilterModel::sourceImportModel().
|
overrideprotectedvirtual |
This method has a similar purpose as lessThan() has on QSortFilterProxyModel. It is used for sorting items that are in the same category.
left
is less than the item right
when sorting. Reimplemented from Digikam::DCategorizedSortFilterProxyModel.
References Digikam::ImportItemModel::ExtraDataRole, and infosLessThan().
|
protected |
Referenced by ImportFilterModel().
|
protectedinherited |
Referenced by Digikam::ImportSortFilterModel::importFilterModel(), Digikam::ImportSortFilterModel::mapFromDirectSourceToSourceImportModel(), Digikam::ImportSortFilterModel::mapFromSourceImportModel(), Digikam::ImportSortFilterModel::mapToSourceImportModel(), Digikam::ImportSortFilterModel::setSourceFilterModel(), Digikam::ImportSortFilterModel::setSourceImportModel(), Digikam::ImportSortFilterModel::sourceFilterModel(), and Digikam::ImportSortFilterModel::sourceImportModel().