8#include <QtCore/qbytearray.h>
9#include <QtCore/qobjectdefs.h>
10#include <QtCore/qstring.h>
11#include <QtCore/qlist.h>
12#include <QtCore/qpair.h>
13#include <QtCore/qglobal.h>
15#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
27template <
typename E1,
typename E2>
56 constexpr inline operator int()
const {
return i; }
82 constexpr inline bool testFlag(E1
f)
const {
return (
i &
f) ==
f && (
f != 0 ||
i == int(
f)); }
83 constexpr inline bool testFlag(E2
f)
const {
return (
i &
f) ==
f && (
f != 0 ||
i == int(
f)); }
86template<
typename E1,
typename E2>
148#ifdef QT_NO_URL_CAST_FROM_STRING
155 {
other.d =
nullptr; }
156 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(
QUrl)
162 QString url(FormattingOptions options = FormattingOptions(PrettyDecoded))
const;
163 QString toString(FormattingOptions options = FormattingOptions(PrettyDecoded))
const;
164 QString toDisplayString(FormattingOptions options = FormattingOptions(PrettyDecoded))
const;
165 [[nodiscard]]
QUrl adjusted(FormattingOptions options)
const;
167 QByteArray toEncoded(FormattingOptions options = FullyEncoded)
const;
168#if QT_CORE_REMOVED_SINCE(6, 7)
180 UserInputResolutionOptions options = DefaultResolution);
182 bool isValid()
const;
185 bool isEmpty()
const;
191 void setAuthority(
const QString &authority, ParsingMode
mode = TolerantMode);
192 QString authority(ComponentFormattingOptions options = PrettyDecoded)
const;
194 void setUserInfo(
const QString &userInfo, ParsingMode
mode = TolerantMode);
195 QString userInfo(ComponentFormattingOptions options = PrettyDecoded)
const;
197 void setUserName(
const QString &userName, ParsingMode
mode = DecodedMode);
198 QString userName(ComponentFormattingOptions options = FullyDecoded)
const;
201 QString password(ComponentFormattingOptions = FullyDecoded)
const;
204 QString host(ComponentFormattingOptions = FullyDecoded)
const;
207 int port(
int defaultPort = -1)
const;
210 QString path(ComponentFormattingOptions options = FullyDecoded)
const;
211 QString fileName(ComponentFormattingOptions options = FullyDecoded)
const;
213 bool hasQuery()
const;
216 QString query(ComponentFormattingOptions = PrettyDecoded)
const;
218 bool hasFragment()
const;
219 QString fragment(ComponentFormattingOptions options = PrettyDecoded)
const;
220 void setFragment(
const QString &fragment, ParsingMode
mode = TolerantMode);
222 [[nodiscard]]
QUrl resolved(
const QUrl &relative)
const;
227 bool isLocalFile()
const;
228 static QUrl fromLocalFile(
const QString &localfile);
232 bool isDetached()
const;
244#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
245 static QUrl fromCFURL(CFURLRef
url);
247 static
QUrl fromNSURL(const NSURL *
url);
252 IgnoreIDNWhitelist = 0x1,
253 AceTransitionalProcessing = 0x2,
257#if QT_CORE_REMOVED_SINCE(6, 3)
261 static QString fromAce(
const QByteArray &domain, AceProcessingOptions options = {});
262 static QByteArray toAce(
const QString &domain, AceProcessingOptions options = {});
280Q_DECLARE_SHARED(
QUrl)
315#ifndef QT_NO_DATASTREAM
320#ifndef QT_NO_DEBUG_STREAM
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
constexpr QUrlTwoFlags(E2 f)
constexpr QUrlTwoFlags operator&(uint mask) const
QUrlTwoFlags & operator&=(int mask)
constexpr QUrlTwoFlags operator^(E2 f) const
QUrlTwoFlags & operator|=(QFlags< E1 > mask)
constexpr bool testFlag(E2 f) const
constexpr QUrlTwoFlags operator^(QUrlTwoFlags f) const
QUrlTwoFlags & operator^=(E2 f)
QUrlTwoFlags & operator^=(E1 f)
QUrlTwoFlags & operator&=(QFlags< E2 > mask)
constexpr QUrlTwoFlags(QFlags< E1 > f)
constexpr QUrlTwoFlags operator&(int mask) const
constexpr QUrlTwoFlags operator&(E1 f) const
QUrlTwoFlags & operator^=(QFlags< E2 > mask)
constexpr QUrlTwoFlags operator|(QUrlTwoFlags f) const
QUrlTwoFlags & operator|=(QFlags< E2 > mask)
constexpr QUrlTwoFlags operator&(E2 f) const
constexpr bool operator!() const
QUrlTwoFlags & operator|=(QUrlTwoFlags f)
constexpr QUrlTwoFlags operator|(E2 f) const
QUrlTwoFlags & operator^=(QFlags< E1 > mask)
constexpr bool testFlag(E1 f) const
constexpr QUrlTwoFlags operator|(E1 f) const
constexpr QUrlTwoFlags(E1 f)
QUrlTwoFlags & operator&=(uint mask)
QUrlTwoFlags & operator&=(QFlags< E1 > mask)
QUrlTwoFlags & operator|=(E1 f)
constexpr QUrlTwoFlags operator^(E1 f) const
constexpr QUrlTwoFlags(QFlag f)
QUrlTwoFlags & operator^=(QUrlTwoFlags f)
QUrlTwoFlags & operator|=(E2 f)
constexpr QUrlTwoFlags operator~() const
constexpr QUrlTwoFlags(QFlags< E2 > f)
void swap(QUrl &other) noexcept
friend Q_CORE_EXPORT size_t qHash(const QUrl &url, size_t seed) noexcept
QUrl(QUrl &&other) noexcept
Move-constructs a QUrl instance, making it point at the same object that other was pointing to.
UserInputResolutionOption
ParsingMode
The parsing mode controls the way QUrl parses strings.
QUrlTwoFlags< UrlFormattingOption, ComponentFormattingOption > FormattingOptions
UrlFormattingOption
The formatting options define how the URL is formatted when written out as text.
ComponentFormattingOption
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
#define Q_DECL_NS_RETURNS_AUTORELEASED
#define Q_DECL_CF_RETURNS_RETAINED
constexpr bool operator!=(const timespec &t1, const timespec &t2)
#define Q_FORWARD_DECLARE_CF_TYPE(type)
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei const GLchar *const * path
GLenum GLenum GLenum input
static QString toLocalFile(const QString &url)
static QT_BEGIN_NAMESPACE bool isRelative(const QString &path)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
QT_BEGIN_NAMESPACE static Q_LOGGING_CATEGORY(lcStorageInfo, "qt.core.qstorageinfo", QtWarningMsg) class QStorageInfoPrivate bool isParentOf(const String &parent, const QString &dirName)
constexpr void qt_ptr_swap(T *&lhs, T *&rhs) noexcept
request setUrl(QUrl("http://qt-project.org"))
static QStringList toStringList(const QJsonArray &jsonArray)
constexpr std::underlying_type_t< Enum > qToUnderlying(Enum e) noexcept
Q_CORE_EXPORT size_t qHash(const QUrl &url, size_t seed=0) noexcept
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QUrl &)
constexpr QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption f1, QUrl::UrlFormattingOption f2)
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QUrl &)
QUrl::FormattingOptions & operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOptions f)
QUrl url("example.com")
[constructor-url-reference]
qDebug()<< QUrl("file copy setQuery(copy.query(QUrl::FullyDecoded), QUrl::DecodedMode)
proxy setPassword("password")
char * toString(const MyType &t)
[31]