digiKam
itemselectionoverlay.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 : 2009-04-30
7  * Description : selection icon view item at mouse hover
8  *
9  * Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * 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_ITEM_SELECTION_OVERLAY_H
25 #define DIGIKAM_ITEM_SELECTION_OVERLAY_H
26 
27 // Qt includes
28 
29 #include <QAbstractItemView>
30 
31 // Local includes
32 
33 #include "itemviewhoverbutton.h"
34 #include "itemdelegateoverlay.h"
35 
36 namespace Digikam
37 {
38 
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit ItemSelectionOverlayButton(QAbstractItemView* const parentView);
46  QSize sizeHint() const override;
47 
48 protected:
49 
50  QIcon icon() override;
51  void updateToolTip() override;
52 };
53 
54 // --------------------------------------------------------------------
55 
57 {
58  Q_OBJECT
59 
60 public:
61 
62  explicit ItemSelectionOverlay(QObject* const parent);
63  void setActive(bool active) override;
64 
65 protected:
66 
68  void updateButton(const QModelIndex& index) override;
69 
70 protected Q_SLOTS:
71 
72  void slotClicked(bool checked);
73  void slotSelectionChanged(const QItemSelection&, const QItemSelection&);
74 };
75 
76 } // namespace Digikam
77 
78 #endif // DIGIKAM_ITEM_SELECTION_OVERLAY_H
Definition: itemdelegateoverlay.h:225
Definition: itemselectionoverlay.h:40
QIcon icon() override
Definition: itemselectionoverlay.cpp:50
QSize sizeHint() const override
Definition: itemselectionoverlay.cpp:45
ItemSelectionOverlayButton(QAbstractItemView *const parentView)
Definition: itemselectionoverlay.cpp:39
void updateToolTip() override
Definition: itemselectionoverlay.cpp:56
Definition: itemselectionoverlay.h:57
void setActive(bool active) override
Definition: itemselectionoverlay.cpp:69
ItemViewHoverButton * createButton() override
Definition: itemselectionoverlay.cpp:93
ItemSelectionOverlay(QObject *const parent)
Definition: itemselectionoverlay.cpp:64
void slotClicked(bool checked)
Definition: itemselectionoverlay.cpp:112
void updateButton(const QModelIndex &index) override
Definition: itemselectionoverlay.cpp:98
void slotSelectionChanged(const QItemSelection &, const QItemSelection &)
Definition: itemselectionoverlay.cpp:133
Definition: itemviewhoverbutton.h:42
Definition: datefolderview.cpp:43