digiKam
tableview_treeview_delegate.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 : 2013-03-02
7  * Description : Table view: Tree view subelement
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_TABLE_VIEW_TREEVIEW_DELEGATE_H
25 #define DIGIKAM_TABLE_VIEW_TREEVIEW_DELEGATE_H
26 
27 // Qt includes
28 
29 #include <QItemDelegate>
30 #include <QTreeView>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 #include "itemalbummodel.h"
36 #include "itemfiltermodel.h"
37 #include "statesavingobject.h"
39 #include "tableview_shared.h"
40 #include "thumbnailloadthread.h"
41 
42 class QMenu;
43 class QContextMenuEvent;
44 
45 namespace Digikam
46 {
47 
48 class TableViewItemDelegate : public QItemDelegate
49 {
50  Q_OBJECT
51 
52 public:
53 
54  explicit TableViewItemDelegate(TableViewShared* const tableViewShared, QObject* const parent = nullptr);
55  ~TableViewItemDelegate() override;
56 
57  void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& tableViewModelIndex) const override;
58  QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& tableViewModelIndex) const override;
59 
60 private:
61 
62  TableViewShared* const s;
63 };
64 
65 } // namespace Digikam
66 
67 #endif // DIGIKAM_TABLE_VIEW_TREEVIEW_DELEGATE_H
Definition: tableview_treeview_delegate.h:49
~TableViewItemDelegate() override
Definition: tableview_treeview_delegate.cpp:58
TableViewItemDelegate(TableViewShared *const tableViewShared, QObject *const parent=nullptr)
Definition: tableview_treeview_delegate.cpp:52
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &tableViewModelIndex) const override
Definition: tableview_treeview_delegate.cpp:88
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &tableViewModelIndex) const override
Definition: tableview_treeview_delegate.cpp:62
Definition: tableview_shared.h:44
Definition: datefolderview.cpp:43