Results 1 to 3 of 3

Thread: QDesktopServices::openUrl and HTML fragments

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QDesktopServices::openUrl and HTML fragments

    Hi,

    I've got a problem with QDesktopServices:: openUrl when I want to open an Url containing a fragment like in this link (#openUrl) :
    http://doc.trolltech.com/4.2/qdeskto...s.html#openUrl

    I create my QUrl, I call setFragment("openUrl")
    When I display my QUrl.toString(), I get the correct url;
    but when I call the QDesktopServices:: openUrl,
    the browser receives an Url where the # is encoded to %23... I don't want that ! I expected the fragment not to be encoded...
    How can I do to forbid the # encoding ?
    Thanks

  2. #2
    Join Date
    Jun 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDesktopServices::openUrl and HTML fragments

    Hum in fact this problem is only for local files when we don't give the schema "file://" explicitly.
    In this case, QUrl adds "file://" correctly but transcode # at the same time.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDesktopServices::openUrl and HTML fragments

    You should probably use QUrl::fromLocalFile().

Similar Threads

  1. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 21:51
  2. Replies: 1
    Last Post: 18th July 2006, 12:06
  3. Need Basic html Browser
    By awalesminfo in forum Newbie
    Replies: 6
    Last Post: 21st March 2006, 17:14
  4. Replies: 1
    Last Post: 17th March 2006, 08:01
  5. [Qt 4.1]using html in QTextEdit from designer
    By patcito in forum Qt Programming
    Replies: 5
    Last Post: 16th January 2006, 22:36

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.