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 <QMessageBox>
13#include "kritaresourcewidgets_export.h"
14
15#include <KisTag.h>
16#include <KisTagModel.h>
17
27class KRITARESOURCEWIDGETS_EXPORT KisTagChooserWidget : public QWidget
28{
29 Q_OBJECT
30
31public:
32 explicit KisTagChooserWidget(KisTagModel* model, QString resourceType, QWidget* parent);
33 ~KisTagChooserWidget() override;
34
35
39 void setCurrentItem(const QString &tag);
40
43 int currentIndex() const;
44
48 KisTagSP currentlySelectedTag();
49
53
55 void updateIcons();
56
57Q_SIGNALS:
58
61 void sigTagChosen(const KisTagSP tag);
62
63public Q_SLOTS:
64
70 void tagChanged(int index);
71
75 void addTag(const QString &tag);
76 void addTag(const QString &tag, KoResourceSP resource);
77 void addTag(KisTagSP tag, KoResourceSP resource);
78
79private Q_SLOTS:
80
83 void tagToolRenameCurrentTag(const QString& tag);
84
88 void tagToolDeleteCurrentTag();
89
92 void tagToolUndeleteLastTag(KisTagSP tag);
93
98 void tagToolContextMenuAboutToShow();
99
104 void cacheSelectedTag();
105
109 void restoreTagFromCache();
110
111 void slotTagModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> roles);
112
113private:
114
115
118 void setCurrentIndex(int index);
119
120 QMessageBox::ButtonRole overwriteTagDialog(KisTagChooserWidget* parent, bool undelete);
121
122private:
123 class Private;
124 Private* const d;
125
126};
127
128#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)