QUrl
class can be used to open both local or online file. I used QLineEdit
to take URL as QString
and give it to QUrl
. The program can access both local and online file. My point question is: is there any official way to automatically detect if the given url is local or online and add http://
automatically if the url is online?
For example, if user type www.google.com
, it should be online and should be added http://
before it being processed. If user type /home/username/somepath
it should be offline.
Of course a little if
and else
thing with string pattern check can be used for this purpose. My question is, if there's officially supported way to do something like this from Qt5.