Krita Source Code Documentation
Loading...
Searching...
No Matches
KisTagChooserWidget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2020 Agata Cacko <cacko.azh@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef KISTAGCHOOSERWIDGET_H
9#define KISTAGCHOOSERWIDGET_H
10
11#include <QWidget>
12#include "kritaresourcewidgets_export.h"
13
14#include <KisTag.h>
15#include <KisTagModel.h>
16
26class KRITARESOURCEWIDGETS_EXPORT KisTagChooserWidget : public QWidget
27{
28 Q_OBJECT
29
30public:
31 explicit KisTagChooserWidget(KisTagModel* model, QString resourceType, QWidget* parent);
32 ~KisTagChooserWidget() override;
33
34
38 void setCurrentItem(const QString &tag);
39
42 int currentIndex() const;
43
47 KisTagSP currentlySelectedTag();
48
52
54 void updateIcons();
55
56Q_SIGNALS:
57
60 void sigTagChosen(const KisTagSP tag);
61
62public Q_SLOTS:
63
69 void tagChanged(int index);
70
74 void addTag(const QString &tag);
75 void addTag(const QString &tag, KoResourceSP resource);
76 void addTag(KisTagSP tag, KoResourceSP resource);
77
78private Q_SLOTS:
79
82 void tagToolRenameCurrentTag(const QString& tag);
83
87 void tagToolDeleteCurrentTag();
88
91 void tagToolUndeleteLastTag(KisTagSP tag);
92
97 void tagToolContextMenuAboutToShow();
98
103 void cacheSelectedTag();
104
108 void restoreTagFromCache();
109
110 void slotTagModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> roles);
111
112private:
113
114
117 void setCurrentIndex(int index);
118
124
125 OverwriteDialogOptions overwriteTagDialog(KisTagChooserWidget* parent, bool undelete);
126
127private:
128 class Private;
129 Private* const d;
130
131};
132
133#endif // KISTAGCHOOSERWIDGET_H
The KisTagChooserWidget class is responsible for all the logic that the tags combobox has in various ...
void sigTagChosen(const KisTagSP tag)
sigTagChosen is emitted when the selected tag in the combobox changes due to user interaction or by o...
bool selectedTagIsReadOnly()
selectedTagIsReadOnly checks whether the tag is readonly (generated by Krita)