digiKam
Loading...
Searching...
No Matches
showfotostackviewlist.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2021-09-27
7 * Description : List-view for the Showfoto stack view.
8 *
9 * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// QT includes
18
19#include <QList>
20#include <QPixmap>
21#include <QTreeWidget>
22#include <QMouseEvent>
23#include <QContextMenuEvent>
24#include <QModelIndex>
25
26// Local includes
27
29
30namespace ShowFoto
31{
32
33class ShowfotoThumbnailBar;
34
35class ShowfotoStackViewList : public QTreeWidget
36{
37 Q_OBJECT
38
39public:
40
48
50 {
54 SizeHuge = 96
55 };
56
57public:
58
60 ~ShowfotoStackViewList() override;
61
62 void setThumbbar(ShowfotoThumbnailBar* const thumbbar);
63
64 ShowfotoItemInfo infoFromIndex(const QModelIndex& index) const;
65 QList<QUrl> urls();
66 QUrl currentUrl() const;
67
68 int sortOrder() const;
69 int sortRole() const;
70
71public Q_SLOTS:
72
73 void slotIconSizeChanged(int);
74
75Q_SIGNALS:
76
77 void signalItemListChanged(int nbitems);
80 void signalRemoveItemInfos(const QList<ShowfotoItemInfo>& infos);
82
83private:
84
85 void contextMenuEvent(QContextMenuEvent*) override;
86 void mouseMoveEvent(QMouseEvent*) override;
87 void wheelEvent(QWheelEvent*) override;
88 void keyPressEvent(QKeyEvent*) override;
89 void focusOutEvent(QFocusEvent*) override;
90 void leaveEvent(QEvent*) override;
91
92 void hideToolTip();
93 bool acceptToolTip(const QModelIndex& index) const;
94
95 void drawRow(QPainter* p,
96 const QStyleOptionViewItem& opt,
97 const QModelIndex& index) const override;
98
99private Q_SLOTS:
100
101 void slotToolTip();
102 void slotOpenInFileManager();
103 void slotItemsAdded(const QList<ShowfotoItemInfo>& items);
104 void slotItemsRemoved(const QList<ShowfotoItemInfo>& items);
105 void slotItemThumbnail(const ShowfotoItemInfo& info, const QPixmap& pix);
106 void slotItemsSelected(const QList<ShowfotoItemInfo>& items);
107 void slotItemsDeselected(const QList<ShowfotoItemInfo>& items);
108 void slotSelectionChanged(QTreeWidgetItem*);
109 void slotItemDoubleClicked(QTreeWidgetItem*);
110 void slotItemsListChanged();
111 void slotRemoveItems();
112
113private:
114
115 class Private;
116 Private* const d = nullptr;
117};
118
119} // namespace ShowFoto
Definition showfotoiteminfo.h:38
Definition showfotostackviewlist.h:36
ThumbnailSize
Definition showfotostackviewlist.h:50
@ SizeHuge
Definition showfotostackviewlist.h:54
@ SizeLarge
Definition showfotostackviewlist.h:53
@ SizeMedium
Definition showfotostackviewlist.h:52
@ SizeSmall
Definition showfotostackviewlist.h:51
void slotIconSizeChanged(int)
Definition showfotostackviewlist.cpp:330
StackViewRole
Definition showfotostackviewlist.h:42
@ FileName
Definition showfotostackviewlist.h:43
@ FileType
Definition showfotostackviewlist.h:45
@ FileSize
Definition showfotostackviewlist.h:44
@ FileDate
Metadata date if exists, else Modifier date.
Definition showfotostackviewlist.h:46
ShowfotoItemInfo infoFromIndex(const QModelIndex &index) const
Definition showfotostackviewlist.cpp:295
void setThumbbar(ShowfotoThumbnailBar *const thumbbar)
Definition showfotostackviewlist.cpp:120
int sortRole() const
Definition showfotostackviewlist.cpp:115
void signalShowfotoItemInfoActivated(const ShowfotoItemInfo &info)
QList< QUrl > urls()
Definition showfotostackviewlist.cpp:561
int sortOrder() const
Definition showfotostackviewlist.cpp:110
void signalRemoveItemInfos(const QList< ShowfotoItemInfo > &infos)
~ShowfotoStackViewList() override
Definition showfotostackviewlist.cpp:104
QUrl currentUrl() const
Definition showfotostackviewlist.cpp:582
void signalItemListChanged(int nbitems)
Definition showfotostackviewsidebar.h:45
Definition showfotothumbnailbar.h:28
Definition showfotofolderviewbar.cpp:43