Unsolved How to get the source QString instance from a QUrl instance which is invalid?
-
I have constructed a QUrl instance like below.
Here is a output from PyQt4, actually i use Qt5, but it isn't installed on this machine, so it's just a sample code to demonstrate my problem.
In Qt5, i want to get the source string "test.pro://account=" from the QUrl instance, how can i achieve it?
What i have done?
The QUrl class have a private class which is named QUrlPrivate which contains a struct named Error. The Error structure contains QString source which is actually what i want. But i don't know how to access it usinig public API from QUrl.
Thanks for helping.
-
Hi,
do you have the same problem with a more regular and existing Url like e.g. "http://forum.qt.io"?
-Michael.
-
No.
-
-
@m-sue You are right. QUrl parser considers it as an error. But what i want to do is to get the source string when it goes wrong.
-
Hi,
Since you have your variable named
source
, why not re-use it if something fails ?