Krita Source Code Documentation
Loading...
Searching...
No Matches
wdgtagselection.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 Agata Cacko cacko.azh@gmail.com
3
* SPDX-FileCopyrightText: 2023 Srirupa Datta <srirupa.sps@gmail.com>
4
*
5
* SPDX-License-Identifier: LGPL-2.0-or-later
6
*/
7
#ifndef WDG_TAG_SELECTION_H
8
#define WDG_TAG_SELECTION_H
9
10
#include <QString>
11
#include <QHBoxLayout>
12
13
#include <
KisTag.h
>
14
#include <
KoResource.h
>
15
#include <
KisResourceModelProvider.h
>
16
#include <
KisTagModelProvider.h
>
17
18
#include <
KisTagSelectionWidget.h
>
19
20
class
KisWdgTagSelectionControllerOneResource
:
public
QObject
21
{
22
Q_OBJECT
23
24
public
:
25
KisWdgTagSelectionControllerOneResource
(
KisTagSelectionWidget
* widget,
bool
editable);
26
~KisWdgTagSelectionControllerOneResource
()
override
;
27
28
void
setResourceIds
(QString resourceType,
QList<int>
resourceIds);
29
30
private
Q_SLOTS:
31
void
slotRemoveTag
(
KoID
tag);
32
void
slotAddTag
(
KoID
tag);
33
void
slotCreateNewTag
(QString tag);
34
35
private
:
36
void
updateView
();
37
38
private
:
39
KisTagSelectionWidget
*
m_tagSelectionWidget
{0};
40
bool
m_editable
{
true
};
41
QList<int>
m_resourceIds
;
42
QString
m_resourceType
{
""
};
43
44
QSharedPointer<KisTagModel>
m_tagModel
;
45
QSharedPointer<KisTagResourceModel>
m_tagResourceModel
;
46
};
47
48
49
class
KisWdgTagSelectionControllerBundleTags
:
public
QObject
50
{
51
Q_OBJECT
52
53
public
:
54
KisWdgTagSelectionControllerBundleTags
(
KisTagSelectionWidget
* widget,
bool
editable);
55
~KisWdgTagSelectionControllerBundleTags
()
override
;
56
57
QList<int>
getSelectedTagIds
()
const
;
58
59
void
updateView
();
60
void
setResourceType
(
const
QString& resourceType);
61
void
addTag
(
KoID
tag);
62
63
Q_SIGNALS:
64
void
tagAdded
(
KoID
tag);
65
void
tagRemoved
(
KoID
tag);
66
67
public
Q_SLOTS:
68
void
slotRemoveTag
(
KoID
tag);
69
void
slotAddTag
(
KoID
tag);
70
71
private
:
72
73
struct
TagResourceType
74
{
75
KisTagSP
tag
;
76
};
77
78
private
:
79
KisTagSelectionWidget
*
m_tagSelectionWidget
{0};
80
bool
m_editable
{
true
};
81
QString
m_resourceType
{
""
};
82
83
QList<KoID>
m_selectedTags
;
84
85
QMap<QString, QList<KoID>>
m_selectedTagsByResourceType
;
86
87
QSharedPointer<KisTagModel>
m_tagModel
;
88
QSharedPointer<KisTagResourceModel>
m_tagResourceModel
;
89
};
90
91
92
#endif
// WDG_TAG_SELECTION_H
KisResourceModelProvider.h
KisTagModelProvider.h
KisTagSelectionWidget.h
KisTag.h
KoResource.h
KisTagSelectionWidget
Definition
KisTagSelectionWidget.h:101
KisWdgTagSelectionControllerBundleTags
Definition
wdgtagselection.h:50
KisWdgTagSelectionControllerBundleTags::m_selectedTagsByResourceType
QMap< QString, QList< KoID > > m_selectedTagsByResourceType
Definition
wdgtagselection.h:85
KisWdgTagSelectionControllerBundleTags::slotRemoveTag
void slotRemoveTag(KoID tag)
Definition
wdgtagselection.cpp:212
KisWdgTagSelectionControllerBundleTags::getSelectedTagIds
QList< int > getSelectedTagIds() const
Definition
wdgtagselection.cpp:198
KisWdgTagSelectionControllerBundleTags::updateView
void updateView()
Definition
wdgtagselection.cpp:250
KisWdgTagSelectionControllerBundleTags::KisWdgTagSelectionControllerBundleTags
KisWdgTagSelectionControllerBundleTags(KisTagSelectionWidget *widget, bool editable)
Definition
wdgtagselection.cpp:183
KisWdgTagSelectionControllerBundleTags::m_tagSelectionWidget
KisTagSelectionWidget * m_tagSelectionWidget
Definition
wdgtagselection.h:79
KisWdgTagSelectionControllerBundleTags::m_resourceType
QString m_resourceType
Definition
wdgtagselection.h:81
KisWdgTagSelectionControllerBundleTags::m_tagResourceModel
QSharedPointer< KisTagResourceModel > m_tagResourceModel
Definition
wdgtagselection.h:88
KisWdgTagSelectionControllerBundleTags::tagAdded
void tagAdded(KoID tag)
KisWdgTagSelectionControllerBundleTags::addTag
void addTag(KoID tag)
Definition
wdgtagselection.cpp:237
KisWdgTagSelectionControllerBundleTags::m_editable
bool m_editable
Definition
wdgtagselection.h:80
KisWdgTagSelectionControllerBundleTags::m_tagModel
QSharedPointer< KisTagModel > m_tagModel
Definition
wdgtagselection.h:87
KisWdgTagSelectionControllerBundleTags::~KisWdgTagSelectionControllerBundleTags
~KisWdgTagSelectionControllerBundleTags() override
Definition
wdgtagselection.cpp:193
KisWdgTagSelectionControllerBundleTags::slotAddTag
void slotAddTag(KoID tag)
Definition
wdgtagselection.cpp:224
KisWdgTagSelectionControllerBundleTags::setResourceType
void setResourceType(const QString &resourceType)
Definition
wdgtagselection.cpp:296
KisWdgTagSelectionControllerBundleTags::m_selectedTags
QList< KoID > m_selectedTags
Definition
wdgtagselection.h:83
KisWdgTagSelectionControllerBundleTags::tagRemoved
void tagRemoved(KoID tag)
KisWdgTagSelectionControllerOneResource
Definition
wdgtagselection.h:21
KisWdgTagSelectionControllerOneResource::KisWdgTagSelectionControllerOneResource
KisWdgTagSelectionControllerOneResource(KisTagSelectionWidget *widget, bool editable)
Definition
wdgtagselection.cpp:35
KisWdgTagSelectionControllerOneResource::setResourceIds
void setResourceIds(QString resourceType, QList< int > resourceIds)
Definition
wdgtagselection.cpp:52
KisWdgTagSelectionControllerOneResource::m_tagSelectionWidget
KisTagSelectionWidget * m_tagSelectionWidget
Definition
wdgtagselection.h:39
KisWdgTagSelectionControllerOneResource::updateView
void updateView()
Definition
wdgtagselection.cpp:127
KisWdgTagSelectionControllerOneResource::m_tagResourceModel
QSharedPointer< KisTagResourceModel > m_tagResourceModel
Definition
wdgtagselection.h:45
KisWdgTagSelectionControllerOneResource::slotRemoveTag
void slotRemoveTag(KoID tag)
Definition
wdgtagselection.cpp:76
KisWdgTagSelectionControllerOneResource::slotCreateNewTag
void slotCreateNewTag(QString tag)
Definition
wdgtagselection.cpp:96
KisWdgTagSelectionControllerOneResource::m_editable
bool m_editable
Definition
wdgtagselection.h:40
KisWdgTagSelectionControllerOneResource::m_resourceType
QString m_resourceType
Definition
wdgtagselection.h:42
KisWdgTagSelectionControllerOneResource::m_resourceIds
QList< int > m_resourceIds
Definition
wdgtagselection.h:41
KisWdgTagSelectionControllerOneResource::slotAddTag
void slotAddTag(KoID tag)
Definition
wdgtagselection.cpp:86
KisWdgTagSelectionControllerOneResource::~KisWdgTagSelectionControllerOneResource
~KisWdgTagSelectionControllerOneResource() override
Definition
wdgtagselection.cpp:47
KisWdgTagSelectionControllerOneResource::m_tagModel
QSharedPointer< KisTagModel > m_tagModel
Definition
wdgtagselection.h:44
KoID
Definition
KoID.h:30
QList
Definition
KisQStringListFwd.h:16
QSharedPointer
Definition
KoCanvasResourceProvider.h:20
KisWdgTagSelectionControllerBundleTags::TagResourceType
Definition
wdgtagselection.h:74
KisWdgTagSelectionControllerBundleTags::TagResourceType::tag
KisTagSP tag
Definition
wdgtagselection.h:75
plugins
extensions
resourcemanager
wdgtagselection.h
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52