diff options
authorOlivier Goffart <>2016-03-16 12:18:57 +0100
committerOlivier Goffart (Woboq GmbH) <>2016-04-11 15:23:05 +0000
commit0a568e9420feb75aa006a134ca78ec4238358552 (patch)
parent887f51aaa64df60bda2dab136a72a64532f89e02 (diff)
QUrl documentation: fix clang parsing
QUrl::FormattingOptions need to be declared with Q_DECLARE_FLAGS for documentation purposes. But it's actually a QUrlTwoFlags and need to be so in order to get the default arguments parsed without errors. So hack it by introducing a fake internal QFlags specific to QUrl Change-Id: I851aca2ab3fd4c10d9cb2dc4d6a0f236813d20ad Reviewed-by: Martin Smith <>
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index d9d4fd906a..a6dc66d457 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -164,6 +164,12 @@ public:
Q_DECLARE_FLAGS(ComponentFormattingOptions, ComponentFormattingOption)
#ifdef Q_QDOC
+ // We need to let qdoc think that FormattingOptions is a normal QFlags, but
+ // it needs to be a QUrlTwoFlags for compiling default arguments of somme functions.
+ template<typename T> struct QFlags : QUrlTwoFlags<T, ComponentFormattingOption>
+ { using QUrlTwoFlags<T, ComponentFormattingOption>::QUrlTwoFlags; };
Q_DECLARE_FLAGS(FormattingOptions, UrlFormattingOption)
typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions;
@@ -372,6 +378,7 @@ Q_DECLARE_SHARED(QUrl)
+#ifndef Q_QDOC
Q_DECL_CONSTEXPR inline QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption f1, QUrl::UrlFormattingOption f2)
{ return QUrl::FormattingOptions(f1) | f2; }
Q_DECL_CONSTEXPR inline QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption f1, QUrl::FormattingOptions f2)
@@ -399,6 +406,7 @@ Q_DECL_CONSTEXPR inline QUrl::FormattingOptions operator|(QUrl::ComponentFormatt
//inline QUrl::UrlFormattingOption &operator=(const QUrl::UrlFormattingOption &i, QUrl::ComponentFormattingOptions f)
//{ i = int(f); f; }
+#endif // Q_QDOC
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QUrl &);