Results 1 to 9 of 9

Thread: QDesktopServices::openUrl - Problem

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QDesktopServices::openUrl - Problem

    Hi guys,

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

    I basically use the following code:
    Qt Code:
    1. QString mY_url = QString("https://.....");
    2.  
    3. QUrl urlEncoded = QUrl::fromEncoded(mY_url.toAscii());
    4. QUrl url(urlEncoded.toString());
    5.  
    6. bool isURLopened = QDesktopServices::openUrl ( url );
    To copy to clipboard, switch view to plain text mode 

    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...pc-servizi.com
    Last edited by rmagro; 24th March 2009 at 17:01.

  2. #2
    Join Date
    Dec 2008
    Location
    My spaceship needs repairs..so, I am stuck on beautiful earth
    Posts
    98
    Thanks
    25
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QDesktopServices::openUrl - Problem

    There's a pretty big chance of me being wrong 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.
    Last edited by rishiraj; 25th March 2009 at 07:06.
    If everything seems to be going well, you have obviously overlooked something.

  3. #3
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QDesktopServices::openUrl - Problem

    Thanks for your reply..

    So you mean I should directly try something like:
    Qt Code:
    1. QString mY_url = QString("https://....."); //URL in Encoded form
    2. QUrl url(mY_url);
    3. bool isURLopened = QDesktopServices::openUrl ( url );
    To copy to clipboard, switch view to plain text mode 

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

  4. #4
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QDesktopServices::openUrl - Problem

    Is QDesktopServices:penUr the right way to open https URL ??
    does another better way to do the work exist?

    Thx,

    robby

  5. #5
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices::openUrl - Problem

    Quote Originally Posted by rmagro View Post
    Thanks for your reply..

    So you mean I should directly try something like:
    Qt Code:
    1. QString mY_url = QString("https://....."); //URL in Encoded form
    2. QUrl url(mY_url);
    3. bool isURLopened = QDesktopServices::openUrl ( url );
    To copy to clipboard, switch view to plain text mode 

    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?

  6. #6
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices::openUrl - Problem

    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..

  7. #7
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices::openUrl - Problem

    what computers?

  8. #8
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices::openUrl - Problem

    computers with windows xp on board, but maybe where the a firewall block 443 https port..

    (??)

  9. #9
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDesktopServices::openUrl - Problem

    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()?

Similar Threads

  1. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  2. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  3. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  4. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.