aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-01-13 16:25:13 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2021-01-14 09:35:43 +0100
commit653d5a4745ad2f20ae924527b7b31580eedc651b (patch)
tree73ab878956133c2881a04a608358842dc8a852e0 /src
parent029fc1e326b8b0115a8b95337b0bfc533150c305 (diff)
exposecppattributes.qdoc: Warn about aliases
Using aliases in conjunction with Q_PROPERTY might cause some issues, so we should warn about it. Task-number: QTBUG-83950 Change-Id: I53db6848e3a7659e8b7ad93de70088cab6e53184 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/src/cppintegration/exposecppattributes.qdoc23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
index 52534b4a62..5c53989cbb 100644
--- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
+++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
@@ -91,6 +91,29 @@ For example, below is a \c Message class with an \c author property. As
specified by the Q_PROPERTY macro call, this property is readable through
the \c author() method, and writable through the \c setAuthor() method:
+\note Do not use \e typedef or \e using for Q_PROPERTY types as these
+will confuse moc. This may make certain type comparisons fail.
+
+Instead of:
+
+\badcode
+using FooEnum = Foo::Enum;
+
+class Bar : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(FooEnum enum READ enum WRITE setEnum NOTIFY enumChanged)
+};
+\endcode
+
+Refer to the type directly:
+
+\code
+class Bar : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(Foo::Enum enum READ enum WRITE setEnum NOTIFY enumChanged)
+};
+\endcode
+
\code
class Message : public QObject
{