summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r--src/corelib/io/qurl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 36411a089e8..62d6092c9d6 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -199,6 +199,7 @@
#include "qdir.h" // for QDir::fromNativeSeparators
#include "qtldurl_p.h"
#include "private/qipaddress_p.h"
+#include "qurlquery.h"
#if defined(Q_OS_WINCE_WM)
#pragma optimize("g", off)
#endif
@@ -1725,6 +1726,18 @@ void QUrl::setQuery(const QString &query)
d->sectionIsPresent &= ~QUrlPrivate::Query;
}
+void QUrl::setQuery(const QUrlQuery &query)
+{
+ detach();
+
+ // we know the data is in the right format
+ d->query = query.toString();
+ if (query.isEmpty())
+ d->sectionIsPresent &= ~QUrlPrivate::Query;
+ else
+ d->sectionIsPresent |= QUrlPrivate::Query;
+}
+
/*!
Returns the query string of the URL in percent encoded form.
*/