digiKam
itemviewtooltip.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-24
7  * Description : A DItemToolTip prepared for use in QAbstractItemViews
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_VIEW_TOOL_TIP_H
25 #define DIGIKAM_ITEM_VIEW_TOOL_TIP_H
26 
27 // Qt includes
28 
29 #include <QAbstractItemView>
30 
31 // Local includes
32 
33 #include "ditemtooltip.h"
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_EXPORT ItemViewToolTip : public DItemToolTip
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit ItemViewToolTip(QAbstractItemView* const view);
46  ~ItemViewToolTip() override;
47 
48  QAbstractItemView* view() const;
49  QAbstractItemModel* model() const;
50  QModelIndex currentIndex() const;
51 
57  void show(const QStyleOptionViewItem& option, const QModelIndex& index);
58 
59  void setTipContents(const QString& tipContents);
60 
65  QString tipContents() override;
66 
67 protected:
68 
69  QRect repositionRect() override;
70 
71  bool eventFilter(QObject* o, QEvent* e) override;
72  void hideEvent(QHideEvent*) override;
73  void mouseMoveEvent(QMouseEvent* e) override;
74 
75 private:
76 
77  class Private;
78  Private* const d;
79 };
80 
81 } // namespace Digikam
82 
83 #endif // DIGIKAM_ITEM_VIEW_TOOL_TIP_H
Definition: ditemtooltip.h:75
Definition: itemviewtooltip.h:40
Definition: datefolderview.cpp:43