13QUrl url(
"http://www.example.com/List of holidays.xml");
48QUrl relativeUrl(
"../Product/Library/");
61QUrl url(
"http://qt-project.org/support/file.html");
80 url =
QUrl(
"/home/user/file.txt");
86 QUrl original(
"http://example.com/?q=a%2B%3Db%26c");
90 qDebug() << original.toString();
virtual void connectToHost(const QString &hostName, quint16 port, OpenMode mode=ReadWrite, NetworkLayerProtocol protocol=AnyIPProtocol)
Attempts to make a connection to hostName on the given port.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static bool isAbsolutePath(const QString &path)
Returns true if path is absolute; returns false if it is relative.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QTcpSocket class provides a TCP socket.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
QString host(ComponentFormattingOptions=FullyDecoded) const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
static QByteArray toPercentEncoding(const QString &, const QByteArray &exclude=QByteArray(), const QByteArray &include=QByteArray())
Returns an encoded copy of input.
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
int port(int defaultPort=-1) const
static QUrl fromEncoded(QByteArrayView input, ParsingMode mode=TolerantMode)
Parses input and returns the corresponding QUrl.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
static jboolean copy(JNIEnv *, jobject)
#define qUtf8Printable(string)
QUrl url("example.com")
[constructor-url-reference]
bool checkUrl(const QUrl &url)
[1]
qDebug()<< QUrl("main.qml").isRelative()
[7]