diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-07-26 17:08:01 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-08-01 17:00:35 +0200 |
commit | b6688a4d4939b15713ffd8702253433032879fcb (patch) | |
tree | 13a0ccfdeab7e0c239b862325aa7a41a05a7d619 /src | |
parent | 4726f47b41e507a967c8995609e11947dde4c250 (diff) |
Un-deprecate QSignalMapper
From the comments on QTBUG-73407 and the last comments on
29bcbeab90210da80234529905d17280374f9684, it seems like there are still
use-cases when QSignalMapper is useful.
Change-Id: I8402286cb8a395a4601cda8a4cdda51f19aef073
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qsignalmapper.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qsignalmapper.h | 6 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp index 34fea861cd..24b174972f 100644 --- a/src/corelib/kernel/qsignalmapper.cpp +++ b/src/corelib/kernel/qsignalmapper.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qglobal.h" -#if QT_DEPRECATED_SINCE(5, 10) #include "qsignalmapper.h" #include "qhash.h" @@ -64,7 +63,6 @@ public: /*! \class QSignalMapper \inmodule QtCore - \obsolete The recommended solution is connecting the signal to a lambda. \brief The QSignalMapper class bundles signals from identifiable senders. \ingroup objectmodel @@ -72,7 +70,9 @@ public: This class collects a set of parameterless signals, and re-emits them with integer, string or widget parameters corresponding to - the object that sent the signal. + the object that sent the signal. Note that in most cases you can + use lambdas for passing custom parameters to slots. This is less + costly and will simplify the code. The class supports the mapping of particular strings or integers with particular objects using setMapping(). The objects' signals @@ -314,5 +314,3 @@ void QSignalMapper::map(QObject *sender) QT_END_NAMESPACE #include "moc_qsignalmapper.cpp" - -#endif diff --git a/src/corelib/kernel/qsignalmapper.h b/src/corelib/kernel/qsignalmapper.h index 6c4cfa9627..0da1e8f87d 100644 --- a/src/corelib/kernel/qsignalmapper.h +++ b/src/corelib/kernel/qsignalmapper.h @@ -42,8 +42,6 @@ #include <QtCore/qobject.h> -#if QT_DEPRECATED_SINCE(5, 10) - QT_BEGIN_NAMESPACE class QSignalMapperPrivate; @@ -53,7 +51,7 @@ class Q_CORE_EXPORT QSignalMapper : public QObject Q_OBJECT Q_DECLARE_PRIVATE(QSignalMapper) public: - QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr); + explicit QSignalMapper(QObject *parent = nullptr); ~QSignalMapper(); void setMapping(QObject *sender, int id); @@ -84,6 +82,4 @@ private: QT_END_NAMESPACE -#endif - #endif // QSIGNALMAPPER_H |