Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSignalMapper.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** SPDX-FileCopyrightText: 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtCore module of the Qt Toolkit.
7**
8** SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KFQF-Accepted-GPL OR LicenseRef-Qt-Commercial
9**
10****************************************************************************/
11
12#ifndef KisSignalMapper_H
13#define KisSignalMapper_H
14
15#include <QtCore/qobject.h>
16#include "kritaglobal_export.h"
17
18#include <QScopedPointer>
19
78class KRITAGLOBAL_EXPORT KisSignalMapper : public QObject
79{
80 Q_OBJECT
81public:
82 explicit KisSignalMapper(QObject *parent = nullptr);
83
88
97 void setMapping(QObject *sender, int id);
98
105 void setMapping(QObject *sender, const QString &text);
106
113 void setMapping(QObject *sender, QWidget *widget);
114
121 void setMapping(QObject *sender, QObject *object);
122
131 void removeMappings(QObject *sender);
132
136 QObject *mapping(int id) const;
137
143 QObject *mapping(const QString &text) const;
144
150 QObject *mapping(QWidget *widget) const;
151
152
158 QObject *mapping(QObject *object) const;
159
160Q_SIGNALS:
170 void mapped(int);
171
172
182 void mapped(const QString &);
183
193 void mapped(QWidget *);
194
204 void mapped(QObject *);
205
206public Q_SLOTS:
210 void map();
211
215 void map(QObject *sender);
216
217private:
218
219 class Private;
220 QScopedPointer<Private> d;
221
222 Q_DISABLE_COPY(KisSignalMapper)
223 Q_PRIVATE_SLOT(d, void _q_senderDestroyed())
224};
225
226
227#endif // KisSignalMapper_H
The KisSignalMapper class bundles signals from identifiable senders.
QScopedPointer< Private > d
void mapped(const QString &)
void mapped(QWidget *)
void mapped(int)
void mapped(QObject *)