Results 1 to 2 of 2

Thread: QWebView - scaling issues with .svg

  1. #1
    Join Date
    Jun 2007
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QWebView - scaling issues with .svg

    Hello there!

    I've recently ported a help widget that displays a .qch file from QTextBrowser to QWebView (i did this mainly for performance - the asynchronous loading of QWebView was why i was switching).

    To my dismay i had to notice that the help pages look very different now, some of the svg graphics are much smaller now. Upon further inspection i found out that the images that look too small have been saved like this:
    <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="79.375mm" height="88.1944mm" style="..." viewBox="0 0 79.375 88.1944"
    while the svg files that are still shown correctly look like this:
    <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="225px" height="250px" style="..." viewBox="0 0 225 250"

    Instead of changing lots and lots of svg files (which i really don't have much control over anyways) i'm wondering what needs to be tweaked in QWebView to deal with this correctly.
    If i have a look at the assistant.exe (vanilla Qt 5.3.1) which also uses QWebView to show the same files, it looks fine there. i have not found anything in the source code of assistant that would explain why it works there, but not with my own class.

    Another difference that i found was that the svgs that are shown in my app are pixelated, while when i look at them in the assistant, they are always crisp, even when i'm zooming in.

    What am i missing here? Is there some image cache somewhere that i need to configure?

    Thanks for any pointers,
    Zandru

  2. #2
    Join Date
    Jun 2007
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWebView - scaling issues with .svg

    solved this myself, in my HelpNetworkAccessManager that i used to access the help file, i wasn't specifying the correct mime-type in the network replies. Seems without the type, the handling of svg images is very awkward (i'm dumbfounded that it works at all!)

Similar Threads

  1. Replies: 1
    Last Post: 10th May 2012, 19:47
  2. QWebView and image scaling
    By naresh in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2010, 03:38
  3. Replies: 0
    Last Post: 1st April 2010, 07:47
  4. Adding JavaScript Obj to QWebView issues
    By bpetty in forum Newbie
    Replies: 2
    Last Post: 13th May 2008, 20:44
  5. Scaling Painter without scaling the coordinate sytem
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2008, 21:30

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.