Un-deprecate QSignalMapper
From the comments on QTBUG-73407 and the last comments on
29bcbeab90
, 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>
This commit is contained in:
parent
4726f47b41
commit
b6688a4d49
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user