digiKam
tagslineeditoverlay.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 : line edit for addition of tags on mouse hover
8  *
9  * Copyright (C) 2010 by Aditya Bhatt <adityabhatt1991 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 DIGIKAM_TAGS_LINE_EDIT_OVERLAY_H
25 #define DIGIKAM_TAGS_LINE_EDIT_OVERLAY_H
26 
27 // Qt includes
28 
29 #include <QAbstractItemView>
30 
31 // Local includes
32 
33 #include "itemdelegateoverlay.h"
34 #include "itemviewdelegate.h"
35 
36 namespace Digikam
37 {
38 
39 class AddTagsLineEdit;
40 
42 {
43  Q_OBJECT
45 
46 public:
47 
48  explicit TagsLineEditOverlay(QObject* const parent);
49 
51 
52 Q_SIGNALS:
53 
54  void tagEdited(const QModelIndex& index, int rating);
55  void tagEdited(const QModelIndex& index, const QString&);
56 
57 protected Q_SLOTS:
58 
59  void slotTagChanged(int);
60  void slotTagChanged(const QString&);
61  void slotDataChanged(const QModelIndex&, const QModelIndex&);
62 
63 protected:
64 
65  QWidget* createWidget() override;
66  void setActive(bool) override;
67  void visualChange() override;
68  void slotEntered(const QModelIndex& index) override;
69  void hide() override;
70 
71  void updatePosition();
72  void updateTag();
73 
74 protected:
75 
76  QPersistentModelIndex m_index;
77 };
78 
79 } // namespace Digikam
80 
81 #endif // DIGIKAM_TAGS_LINE_EDIT_OVERLAY_H
Definition: itemdelegateoverlay.h:125
Definition: addtagslineedit.h:46
Definition: itemviewdelegate.h:42
Definition: tagslineeditoverlay.h:42
void tagEdited(const QModelIndex &index, int rating)
void slotTagChanged(int)
Definition: tagslineeditoverlay.cpp:158
QPersistentModelIndex m_index
Definition: tagslineeditoverlay.h:76
void tagEdited(const QModelIndex &index, const QString &)
void updatePosition()
Definition: tagslineeditoverlay.cpp:117
void updateTag()
Definition: tagslineeditoverlay.cpp:144
AddTagsLineEdit * addTagsLineEdit() const
Definition: tagslineeditoverlay.cpp:47
void slotDataChanged(const QModelIndex &, const QModelIndex &)
Definition: tagslineeditoverlay.cpp:178
QWidget * createWidget() override
Definition: tagslineeditoverlay.cpp:52
void hide() override
Definition: tagslineeditoverlay.cpp:100
TagsLineEditOverlay(QObject *const parent)
Definition: tagslineeditoverlay.cpp:42
void visualChange() override
Definition: tagslineeditoverlay.cpp:92
void setActive(bool) override
Definition: tagslineeditoverlay.cpp:66
void slotEntered(const QModelIndex &index) override
Definition: tagslineeditoverlay.cpp:188
#define REQUIRE_DELEGATE(Delegate)
Definition: itemdelegateoverlay.h:112
Definition: datefolderview.cpp:43