digiKam
showfotocoordinatesoverlay.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 : 2014-05-28
7  * Description : overlay for GPS location indicator
8  *
9  * Copyright (C) 2014-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
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 SHOW_FOTO_COORDINATES_OVERLAY_H
25 #define SHOW_FOTO_COORDINATES_OVERLAY_H
26 
27 // Qt includes
28 
29 #include <QAbstractButton>
30 #include <QAbstractItemView>
31 
32 // Local includes
33 
34 #include "itemviewhoverbutton.h"
35 #include "itemdelegateoverlay.h"
37 
38 using namespace Digikam;
39 
40 namespace ShowFoto
41 {
42 
43 class ShowfotoCoordinatesOverlayWidget : public QAbstractButton
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit ShowfotoCoordinatesOverlayWidget(QWidget* const parent = nullptr);
50 
51 protected:
52 
53  void paintEvent(QPaintEvent*) override;
54 };
55 
56 // ----------------------------------------------------------------------
57 
59 {
60  Q_OBJECT
62 
63 public:
64 
65  explicit ShowfotoCoordinatesOverlay(QObject* const parent);
66  ShowfotoCoordinatesOverlayWidget* buttonWidget() const;
67 
68 protected:
69 
70  void updatePosition();
71 
72  QWidget* createWidget() override;
73  void setActive(bool active) override;
74  void visualChange() override;
75  bool checkIndex(const QModelIndex& index) const override;
76  void slotEntered(const QModelIndex& index) override;
77 
78 protected:
79 
80  QPersistentModelIndex m_index;
81 };
82 
83 } // namespace ShowFoto
84 
85 #endif // SHOW_FOTO_COORDINATES_OVERLAY_H
Definition: itemdelegateoverlay.h:125
Definition: showfotocoordinatesoverlay.h:44
Definition: showfotocoordinatesoverlay.h:59
QPersistentModelIndex m_index
Definition: showfotocoordinatesoverlay.h:80
Definition: showfotoitemviewdelegate.h:44
#define REQUIRE_DELEGATE(Delegate)
Definition: itemdelegateoverlay.h:112
Definition: datefolderview.cpp:43
Definition: showfotofolderviewbar.cpp:52