Results 1 to 3 of 3

Thread: How to display xml file in qwebview?

  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default How to display xml file in qwebview?

    Hello,

    In may application, I create a QWebView object.

    It can display url, such as www.google.com. However, when I use it to open an xml. Nothing is shown.

    I used the browser in QtDemo to load the xml file. It doesn't show, either.

    Question: can Qt browser display xml file?

    thank you!

  2. #2
    Join Date
    Dec 2008
    Location
    TaganrogNativelandChehov,Russia
    Posts
    64
    Thanks
    1
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to display xml file in qwebview?

    Question: can Qt browser display xml file?
    QtWebKit provides facilities for rendering of HyperText Markup Language (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript.
    i think no.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to display xml file in qwebview?

    Quote Originally Posted by richardander View Post
    It can display url, such as www.google.com. However, when I use it to open an xml. Nothing is shown.

    I used the browser in QtDemo to load the xml file. It doesn't show, either.
    And this is good, because it is handled as xml not as a text file! So <tag value="sdf" /> will show nothing.

    Question: can Qt browser display xml file?
    It displays it. Not the way you want, but...

    Best thing would be you use a QTextEdit with a custom syntax highlighting. If not look through the sources where QWebView/page sets the html to the page, subclass that and if the file is xml replace all "<" and ">" with &lt; and &gt;. Also handle some other xml specific characters.

Similar Threads

  1. Can Qwebview load xml/xsl file?
    By richardander in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2015, 23:36
  2. Display File Properties [Solved]
    By DrDonut in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2009, 13:45
  3. Display a file from Directory tree to show in QTextEdit
    By vvdounai in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2007, 14:43
  4. Can't display .jpg,.jpeg file in my QT app
    By Shalabh in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2007, 15:52
  5. How to display a file in the textBrowser
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 20:47

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.