25#include <QStyledItemDelegate>
36#include <klocalizedstring.h>
37#include <kconfiggroup.h>
58static QList<A*> selectedAlbums(
const QItemSelectionModel*
const selModel,
59 const AlbumFilterModel*
const filterModel)
61 const QList<QModelIndex> indexes = selModel->selectedIndexes();
64 for (
const QModelIndex& index : std::as_const(indexes))
66 albums << static_cast<A*>(filterModel->albumForIndex(index));
92 : QStyledItemDelegate(treeView),
98 QSize
sizeHint(
const QStyleOptionViewItem& option,
99 const QModelIndex& index)
const override
101 QSize size = QStyledItemDelegate::sizeHint(option, index);
102 size.setHeight(qMax(size.height(), m_height));
109 int h = qMax(AlbumThumbnailLoader::instance()->thumbnailSize() + 2,
110 m_treeView->fontMetrics().height());
122 if (m_height == height)
129 Q_EMIT sizeHintChanged(QModelIndex());
148 bool expandOnSingleClick =
false;
149 bool expandNewCurrent =
false;
150 bool selectAlbumOnClick =
false;
151 bool selectOnContextMenu =
true;
152 bool enableContextMenu =
false;
153 bool setInAlbumManager =
false;
158 QTimer* resizeColumnsTimer =
nullptr;
167 const QString configSelectionEntry = QLatin1String(
"Selection");
168 const QString configExpansionEntry = QLatin1String(
"Expansion");
169 const QString configCurrentIndexEntry = QLatin1String(
"CurrentIndex");
170 const QString configSortColumnEntry = QLatin1String(
"SortColumn");
171 const QString configSortOrderEntry = QLatin1String(
"SortOrder");
Definition abstractalbumtreeview_p.h:141
QMap< int, Digikam::State > searchBackup
Definition abstractalbumtreeview_p.h:156
QPixmap contextMenuIcon
Definition abstractalbumtreeview_p.h:164
AlbumPointer< Album > lastSelectedAlbum
Definition abstractalbumtreeview_p.h:160
QString contextMenuTitle
Definition abstractalbumtreeview_p.h:165
QMap< int, Digikam::State > statesByAlbumId
Definition abstractalbumtreeview_p.h:155
QList< ContextMenuElement * > contextMenuElements
Definition abstractalbumtreeview_p.h:162
Definition abstractalbumtreeview.h:53
Definition albumpointer.h:38
Definition abstractalbumtreeview_p.h:86
void updateHeight()
Definition abstractalbumtreeview_p.h:107
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition abstractalbumtreeview_p.h:98
void setHeight(int height)
Definition abstractalbumtreeview_p.h:120
AlbumTreeViewDelegate(AbstractAlbumTreeView *const treeView=nullptr)
Definition abstractalbumtreeview_p.h:91
Definition datefolderview.cpp:34
Definition abstractalbumtreeview_p.h:75
bool expanded
Definition abstractalbumtreeview_p.h:79
bool currentIndex
Definition abstractalbumtreeview_p.h:80
bool selected
Definition abstractalbumtreeview_p.h:78