summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2015-06-10 14:28:57 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2015-06-12 11:36:32 +0000
commit7f85fb4654f0d6f9058336af53148d81fc700497 (patch)
treeb2dfbcd56367c5a0397d1285ac3c996795d7e057 /src
parent55df2e54a5a770fe96cfaebf59081843edaca768 (diff)
Allow types with a comma in Q_PROPERTY
This allows for example properties with QMap<Foo, Bar> [ChangeLog][QtCore] Types in the Q_PROPERTY macro can now contain commas (for example, QMap<Foo, Bar>) Change-Id: Ibf5c8c9cf20a7c8b3dfec9e891fb8a9ca1bdba7c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc9
-rw-r--r--src/corelib/kernel/qobjectdefs.h4
2 files changed, 6 insertions, 7 deletions
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index abb0720fe9..55622dd56b 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -160,13 +160,8 @@
Because QDate is user-defined, you must include the \c{<QDate>}
header file with the property declaration.
- For QMap, QList, and QValueList properties, the property value is
- a QVariant whose value is the entire list or map. Note that the
- Q_PROPERTY string cannot contain commas, because commas separate
- macro arguments. Therefore, you must use \c QMap as the property
- type instead of \c QMap<QString,QVariant>. For consistency, also
- use \c QList and \c QValueList instead of \c QList<QVariant> and
- \c QValueList<QVariant>.
+ For historical reasons, \a QMap and \a QList as property types
+ are synonym of \a QVariantMap and \a QVariantList.
\section1 Reading and Writing Properties with the Meta-Object System
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 4d01264906..a64f2fd2b1 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -78,7 +78,11 @@ class QString;
#define Q_CLASSINFO(name, value)
#define Q_PLUGIN_METADATA(x)
#define Q_INTERFACES(x)
+#ifdef Q_COMPILER_VARIADIC_MACROS
+#define Q_PROPERTY(...)
+#else
#define Q_PROPERTY(text)
+#endif
#define Q_PRIVATE_PROPERTY(d, text)
#define Q_REVISION(v)
#define Q_OVERRIDE(text)