Krita Source Code Documentation
Loading...
Searching...
No Matches
kactioncategory.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2
3 SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KACTIONCATEGORY_H
9#define KACTIONCATEGORY_H
10
11#include <kritawidgetutils_export.h>
12#include "config-xmlgui.h"
13#include <QObject>
14#include <QString>
15#include <QList>
16
17#include <kstandardaction.h>
18#include "kactioncollection.h"
19
21
22class QAction;
23
80class KRITAWIDGETUTILS_EXPORT KisKActionCategory : public QObject
81{
82 Q_OBJECT
83
84 Q_PROPERTY(QString text READ text WRITE setText)
85
86public:
87
91 explicit KisKActionCategory(const QString &text, KisKActionCollection *parent = 0);
92
96 ~KisKActionCategory() override;
97
107 QAction *addAction(const QString &name, QAction *action);
108 QAction *addAction(
110 const QObject *receiver = 0,
111 const char *member = 0);
112
113 QAction *addAction(
115 const QString &name,
116 const QObject *receiver = 0,
117 const char *member = 0);
118
119 QAction *addAction(
120 const QString &name,
121 const QObject *receiver = 0,
122 const char *member = 0);
123
124 template<class ActionType>
125 ActionType *add(
126 const QString &name,
127 const QObject *receiver = 0,
128 const char *member = 0)
129 {
130 ActionType *action = collection()->add<ActionType>(name, receiver, member);
131 addAction(action);
132 return action;
133 }
135
139 const QList<QAction *> actions() const;
140
144 KisKActionCollection *collection() const;
145
149 QString text() const;
150
154 void setText(const QString &text);
155
156private:
157
161 void unlistAction(QAction *action);
162
166 void addAction(QAction *action);
167
170
173};
174
175#endif /* #ifndef KACTIONCATEGORY_H */
ActionType * add(const QString &name, const QObject *receiver=0, const char *member=0)
KisKActionCategoryPrivate *const d
Implementation details.
A container for a set of QAction objects.