summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-03 23:40:00 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-05-04 16:43:30 +0000
commita4e3e34b83640b4f245d83e4034179e5efe9c517 (patch)
tree100fc3a20d53691e1df8a49495a027bff05fea00 /src/corelib/global
parent3489ab60a992f060c3e737838cc78ac79f79cc31 (diff)
Let Q_DECLARE_METATYPE and Q_DECLARE_FLAGS be undefined under Q_MOC_RUN
That's required so that they remain in the output from the preprocessor Change-Id: Id69569111e7d4e619e22ffff144b4a1ee90865f0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qflags.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index f3082a1e39..a6bd37c33f 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -163,8 +163,10 @@ private:
Int i;
};
+#ifndef Q_MOC_RUN
#define Q_DECLARE_FLAGS(Flags, Enum)\
typedef QFlags<Enum> Flags;
+#endif
#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW \
@@ -179,8 +181,11 @@ Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1,
#else /* Q_NO_TYPESAFE_FLAGS */
+#ifndef Q_MOC_RUN
#define Q_DECLARE_FLAGS(Flags, Enum)\
typedef uint Flags;
+#endif
+
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
#endif /* Q_NO_TYPESAFE_FLAGS */