QUrl schema
The following code;
- cout << "url2.isValid: " << (url2.isValid() ? "true" : "false") <<endl;
- cout << "url2.schema: " << url2.scheme().toStdString() << endl;
produces this output;
- url2.isValid: true
- url2.schema: c
Why is the schema equal to “c”? Is this correct behaviour ?
By changing the QUrl constructor parameter to “file://c:/Temp/file.txt” then schema is “file” which is as expected.
Using Qt 4.7.1
2 replies
The constructor you’re using for QUrl is broken. My docnote at the bottom of the documentation page (referenced by the link) explains this.
You must log in to post a reply. Not a member yet? Register here!


