Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsignalmapper.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSIGNALMAPPER_H
6#define QSIGNALMAPPER_H
7
8#include <QtCore/qobject.h>
9
10QT_BEGIN_NAMESPACE
11
12class QSignalMapperPrivate;
13
14class Q_CORE_EXPORT QSignalMapper : public QObject
15{
16 Q_OBJECT
17 Q_DECLARE_PRIVATE(QSignalMapper)
18public:
19 explicit QSignalMapper(QObject *parent = nullptr);
20 ~QSignalMapper();
21
22 void setMapping(QObject *sender, int id);
23 void setMapping(QObject *sender, const QString &text);
24 void setMapping(QObject *sender, QObject *object);
25 void removeMappings(QObject *sender);
26
27 QObject *mapping(int id) const;
28 QObject *mapping(const QString &text) const;
29 QObject *mapping(QObject *object) const;
30
31Q_SIGNALS:
32 void mappedInt(int);
33 void mappedString(const QString &);
34 void mappedObject(QObject *);
35
36public Q_SLOTS:
37 void map();
38 void map(QObject *sender);
39
40private:
41 Q_DISABLE_COPY(QSignalMapper)
42};
43
44QT_END_NAMESPACE
45
46#endif // QSIGNALMAPPER_H
QHash< QObject *, QObject * > objectHash
QHash< QObject *, QString > stringHash
\inmodule QtCore
Combined button and popup list for selecting options.