Class for handling URLs from Qt. Handles storage and encoding.
Questions tagged [qurl]
65 questions
23
votes
4 answers
QFile doesn't recognize file:/// url path format
I get the file path from Qml like this:
mainView.projectFilePath = Qt.resolvedUrl(newProjectFileDlg.fileUrl).toString();
The above file path looks like this: file:///C:/uuuu.a3
But when this path is passed to QFile, it complains
The filename,…

Dean Chen
- 3,800
- 8
- 45
- 70
12
votes
1 answer
How do you port QUrl addQueryItem to Qt5's QUrlQuery?
In Qt 4, the following code using QUrl works:
QUrl u;
foreach (const settings::PostItem & pi, settings.post)
u.addQueryItem(pi.name, pi.value);
postData = u.encodedQuery();
NOTES: this code is from wkhtmltopdf and postData is a…

waddlesplash
- 743
- 1
- 6
- 25
9
votes
3 answers
Convert QUrl with percent encoding into string
I use a URL entered by the user as text to initialize a QUrl object. Later I want to convert the QUrl back into a string for displaying it and to check it using regular expression. This works fine as long as the user does not enter any percent…

Silicomancer
- 8,604
- 10
- 63
- 130
8
votes
3 answers
Qt5 posting data to server using QUrl / QNetworkRequest
I have a piece of code that worked in 4.8 but now I need to port it to Qt5 (beta2)
This is what should happen:
I want to post some data to a webserver the url should look like this "http://server/actions.php"
Then my fields (a "Action" -string and a…

Artis De Partis
- 311
- 5
- 13
4
votes
1 answer
Qt how to decode string in Qt 4.7 (old method are gone)
Im using Qt 4.7.1 and im trying to find way to decode url
from :
https://xxx.com&since=2011-01-27T10%3A33%3A50%2B0000
to vaild date , but i can find any way to do it now .. it used to be QUrl::decode.

user63898
- 29,839
- 85
- 272
- 514
3
votes
2 answers
QtRO - class qremoteobjects - how can connect 2 and more remote peers beetwen TCP
I was build example simpleswitch with registry node in Qt5.9. It's work fine, but when i replace QUrl("local.registry") and QUrl("local.replica") in definition QRemoteObjectRegistryHost and QRemoteObjectHost to QUrl("tcp://localhost:9999") or…

An21
- 31
- 3
3
votes
2 answers
How do I use QDesktopServices::openUrl with 'file:' URL containing '#'?
In my application, I generate a HTML file that I want to open by clicking on a button.
So my file is named, for example:
QString file = "F:/the_path/to_the_/generated_html_file.html";
On Windows I change it to:
file =…

SteveTJS
- 635
- 17
- 32
3
votes
2 answers
How to parse network hostname + port in qt?
I am currently writing a network application in Qt and need to seperate network adresses in the form:
example.org:1234
into seperate hostname and port QStrings.
Is there a Qt function to easily parse this and check if the given input is…

LocalToast
- 397
- 1
- 5
- 13
2
votes
0 answers
QNetworkRequest vs S3 with plus '+' sign in path
I'm trying to find a way to use QNetworkRequest/QUrl to upload files to S3 with a plus '+' character in the path.
The AWS S3 service violates the HTTP spec by interpreting '+' characters as a space. For example given a PUT request that starts with…

richb
- 4,716
- 5
- 24
- 22
2
votes
1 answer
PyQt5 QUrl is empty after QUrl.setUrl
I habe a problem with my python script. I want to make an simple app that log in a person on a website automatically. This can be done with a QUrl and a QUrlQuery i think. It´s just that that a form in html does. OK now to my problem: When I try to…

FunProgramer
- 47
- 4
2
votes
1 answer
How to rightly add resources in Qt application
I am trying to deploy windows application in Qt, so I change mode to release, but when I execute it, all it writes is
file::/qml/Main.qml: File is empty
I have already tried multiple times to rework resources.qrc, but with no…

Brykyz
- 587
- 4
- 30
2
votes
1 answer
Read Json from https in qt
I wrote this code on qt, but when i run this project, My output is "Error".
How can solve my problem?
For example in this code I add a address in url, and I want read Json from this url, and show some info.
MainWindow::MainWindow(QWidget *parent) :
…

Masih
- 23
- 1
- 6
2
votes
1 answer
QUrlQuery append?
Is it possible to use QUrlQuery to append data without striping the url?
Using the code bellow will strip everything after the "?" and
the result is:
https://foobar.com/Info.xml.aspx?userdata=1234
I would like to get: …

Jack
- 77
- 2
- 12
2
votes
2 answers
Make the difference between a file path and a url in Qt
If I have a string which could be either a file or a URL, is there any existing clever method I could use to differentiate them?
For instance:
/Users/user/Documents/mydoc.txt -> path
c:\Program Files\myapp\mydoc.doc ->…

Denis Rouzaud
- 2,412
- 2
- 26
- 45
2
votes
1 answer
QT4 > QT5 for uri.queryItems();
I am currently trying to translate this old code meant for QT4 into today's QT5. I need some help with the following:
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
// return if URI is not valid or is no bitcoin URI
…

Jules Moretti
- 127
- 1
- 10