PDA

View Full Version : QDesktopServices::openUrl - Problem



rmagro
24th March 2009, 16:48
Hi guys,

I can't get the service "QDesktopServices::openUrl" always work (in every Pcs..)

I basically use the following code:


QString mY_url = QString("https://.....");

QUrl urlEncoded = QUrl::fromEncoded(mY_url.toAscii());
QUrl url(urlEncoded.toString());

bool isURLopened = QDesktopServices::openUrl ( url );


Sometimes "isURLopened" is 0 and the page is not open..

I would like to ask you if there is something wrong with the code above..
and what I can try to solve the problem.

many Thanks

Roby

PS:
to be precise mY_url is:

https://sis-bankpass.ssb.it/bankpass/master/main?PAGE=MASTER&NUMORD=99-0000100073&IDNEGOZIO=010250629350001&IMPORTO=1900&VALUTA=978&TCONTAB=I&TAUTOR=I&OPTIONS=A&URLBACK=https%3A%2F%2Fwww.firma.infocert.it%2Futen ti%2FPagamentoKO.htm&URLDONE=https%3A%2F%2Fwww.firma.infocert.it%2Futen ti%2FPagamentoOK.htm%3Femail%3Dsegreteria%40pc-servizi.com&URLMS=http%3A%2F%2Febusiness.infocert.it%2Fnemo%2F sale%2FregistraBPW.do&MAC=b85ee08c22771fad3fd54cbb654d17e7c1b18fe2&EMAILESERC=shopsanpaolo%40infocert.it&EMAIL=segreteria%40pc-servizi.com

rishiraj
25th March 2009, 06:50
There's a pretty big chance of me being wrong :o but could it be because of https...if you try open google,it opens as http://www.google.com but if you try some secure network site it opens as https://......so,maybe that's creating the problem.Also is the 'toascii' and 'fromencoded' needed for 'https'?I tried opening 'orkut' using QDesktopService a few months back.It was a one line code.I didn't use 'fromencoded' and 'toascii'....ofcourse they might be used for secure networks.

rmagro
25th March 2009, 10:06
Thanks for your reply..

So you mean I should directly try something like:


QString mY_url = QString("https://....."); //URL in Encoded form
QUrl url(mY_url);
bool isURLopened = QDesktopServices::openUrl ( url );


even if "mY_url" is in an encoded form ??

rmagro
31st March 2009, 17:49
Is QDesktopServices::openUr the right way to open https URL ??
does another better way to do the work exist?

Thx,

robby

talk2amulya
31st March 2009, 18:10
Thanks for your reply..

So you mean I should directly try something like:


QString mY_url = QString("https://....."); //URL in Encoded form
QUrl url(mY_url);
bool isURLopened = QDesktopServices::openUrl ( url );


even if "mY_url" is in an encoded form ??

yes, u dont need to change anything, this will work..Also, what are you trying to do with this url..does ur application require to JUST open this url in a browser or does your application wants to do smth with this url?

rmagro
2nd April 2009, 13:18
Yes, I'm only trying to open this url in a browser...
I don't understand why in some computers it returns "0", not opening the web page..

Thx
Roby..

talk2amulya
2nd April 2009, 13:25
what computers? :)

rmagro
2nd April 2009, 13:52
computers with windows xp on board, but maybe where the a firewall block 443 https port..

(??)

talk2amulya
2nd April 2009, 14:21
umm..i dont think it should be the firewall, even if it is, it should at least open the browser? did u try to debug it? is it going till launchWebBrowser()?