diff options
Diffstat (limited to 'src/corelib/io/qurl.h')
-rw-r--r-- | src/corelib/io/qurl.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 947b3bbb55..bce271fcb1 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -48,11 +48,9 @@ #include <QtCore/qpair.h> #include <QtCore/qglobal.h> -#ifdef Q_OS_MAC +#if defined(Q_OS_DARWIN) || defined(Q_QDOC) Q_FORWARD_DECLARE_CF_TYPE(CFURL); -# ifdef __OBJC__ Q_FORWARD_DECLARE_OBJC_CLASS(NSURL); -# endif #endif QT_BEGIN_NAMESPACE @@ -164,6 +162,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; @@ -271,13 +275,11 @@ public: static QByteArray toPercentEncoding(const QString &, const QByteArray &exclude = QByteArray(), const QByteArray &include = QByteArray()); -#if defined(Q_OS_MAC) || defined(Q_QDOC) +#if defined(Q_OS_DARWIN) || defined(Q_QDOC) static QUrl fromCFURL(CFURLRef url); CFURLRef toCFURL() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QUrl fromNSURL(const NSURL *url); NSURL *toNSURL() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif #if QT_DEPRECATED_SINCE(5,0) @@ -372,6 +374,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 +402,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 &); |