summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-05-14 07:32:03 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-05-15 10:00:19 +0000
commitc7d4858c921c7602dc90d56cdd903cd2cb1111c6 (patch)
treebded1070ae6ea559e086c76a3ef9ce1cb22683bf /src/dbus
parent432d3b696296db9131bfa3daa67285f0eaedec41 (diff)
QDBusArgument: deprecate relying on a streamable Base to stream a Derived
This was seen in the wild for QList, but, as described in the documentation note, it's a common problem. [ChangeLog][QtDBus][QDBusArgument] Deprecated relying on a streamable Base to stream a Derived without providing operator<</>>() for Derived. No diagnostic provided. Task-number: QTBUG-53376 Change-Id: If845574f731b537c20641dc7c49fa4369e85db5a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusmetatype.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 5696290ed3..59a71ade3e 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -177,7 +177,7 @@ Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
\snippet code/src_qdbus_qdbusmetatype.cpp 0
- If \c{T} isn't a type derived from one of
+ If \c{T} isn't one of
Qt's \l{container classes}, the \c{operator<<} and
\c{operator>>} streaming operators between \c{T} and QDBusArgument
must be already declared. See the \l {qdbustypesystem.html}{Qt D-Bus
@@ -187,6 +187,14 @@ Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
This function returns the Qt meta type id for the type (the same
value that is returned from qRegisterMetaType()).
+ \note The feature that a \c{T} inheriting a streamable type (including
+ the containers QList, QHash or QMap) can be streamed without providing
+ custom \c{operator<<} and \c{operator>>} is deprecated as of Qt 5.7,
+ because it ignores everything in \c{T} except the base class. There is
+ no diagnostic. You should always provide these operators for all types
+ you wish to stream and not rely on Qt-provided stream operators for
+ base classes.
+
\sa {qdbustypesystem.html}{Qt D-Bus Type System}, qRegisterMetaType(), QMetaType
*/