digiKam
dwitemdelegate_p.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 : 2007-11-15
7  * Description : widget item delegate for setup collection view
8  *
9  * Copyright (C) 2015-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2007-2008 by Rafael Fernández López <ereslibre at kde dot org>
11  * Copyright (C) 2008 by Kevin Ottens <ervin at kde dot org>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H
27 #define DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H
28 
29 #include "dwitemdelegate.h"
30 
31 // Qt includes
32 
33 #include <QObject>
34 #include <QItemSelectionModel>
35 
36 namespace Digikam
37 {
38 
39 class DWItemDelegate;
40 class DWItemDelegatePool;
41 
42 class Q_DECL_HIDDEN DWItemDelegatePrivate : public QObject
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit DWItemDelegatePrivate(DWItemDelegate* const q, QObject* const parent = nullptr);
49  ~DWItemDelegatePrivate() override;
50 
51  void updateRowRange(const QModelIndex& parent, int start, int end, bool isRemoving);
52  QStyleOptionViewItem optionView(const QModelIndex& index);
53 
54 public Q_SLOTS:
55 
56  void initializeModel(const QModelIndex& parent = QModelIndex());
57 
58  void slotDWRowsInserted(const QModelIndex& parent, int start, int end);
59  void slotDWRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
60  void slotDWRowsRemoved(const QModelIndex& parent, int start, int end);
61  void slotDWDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
62  void slotDWLayoutChanged();
63  void slotDWModelReset();
64  void slotDWSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
65 
66 protected:
67 
68  bool eventFilter(QObject* watched, QEvent* event) override;
69 
70 public:
71 
72  QAbstractItemView* itemView;
74  QAbstractItemModel* model;
75  QItemSelectionModel* selectionModel;
78 };
79 
80 } // namespace Digikam
81 
82 #endif // DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H
Definition: dwitemdelegatepool.h:49
Definition: dwitemdelegate_p.h:43
QItemSelectionModel * selectionModel
Definition: dwitemdelegate_p.h:75
QAbstractItemView * itemView
Definition: dwitemdelegate_p.h:72
bool viewDestroyed
Definition: dwitemdelegate_p.h:76
DWItemDelegatePool * widgetPool
Definition: dwitemdelegate_p.h:73
QAbstractItemModel * model
Definition: dwitemdelegate_p.h:74
DWItemDelegate * q
Definition: dwitemdelegate_p.h:77
Definition: dwitemdelegate.h:60
Definition: datefolderview.cpp:43