diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2016-03-16 12:18:57 +0100 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2016-04-11 15:23:05 +0000 |
commit | 0a568e9420feb75aa006a134ca78ec4238358552 (patch) | |
tree | 3875211c7ae1e603d1aadfd3ba14a6244968580a /src/corelib/io | |
parent | 887f51aaa64df60bda2dab136a72a64532f89e02 (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 <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurl.h | 8 |
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 +private: + // 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; }; +public: Q_DECLARE_FLAGS(FormattingOptions, UrlFormattingOption) #else typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions; @@ -372,6 +378,7 @@ Q_DECLARE_SHARED(QUrl) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::ComponentFormattingOptions) //Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) +#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 #ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QUrl &); |