Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. HI-DPI and SVG icons
Forum Updated to NodeBB v4.3 + New Features

HI-DPI and SVG icons

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 2.4k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Mark A. GreenM Offline
    Mark A. GreenM Offline
    Mark A. Green
    wrote on last edited by
    #1

    I am attempting to use Qt 5.6.0's HI-DPI support. I'm using SVGs on my icons. I was hoping that for HI-DPI, the SVGs would scale cleanly. Unfortunately, it appears that the SVGs are rendered to the pixmap first and then the pixmap is scaled to a size appropriate for the HI-DPI screen. This then produces blurry images. Is there some way to force the SVGs rendering to be applied after the output size is specified. Basically, I'd like the pixmap size to change first then the SVG render to occur so that the SVG can be rendered directly and cleanly to the new size.

    Anyone know how to accomplish this (if it's even possible)?

    1 Reply Last reply
    0
    • Mark A. GreenM Offline
      Mark A. GreenM Offline
      Mark A. Green
      wrote on last edited by
      #4

      Follow up (many years later). The problems I was having with SVG scaling were not a Qt problem but a problem with the dimensions of the SVG. The dimensions need to be a factor of 4 for clean scaling. My SVGs were based on legacy code and had dimensions of 26x29 pixels. Changing to 24x28 fixed everything right up.

      mrjjM 1 Reply Last reply
      4
      • M Offline
        M Offline
        MajidKamali
        wrote on last edited by
        #2

        if using qml, sourceSize (sourceWidth and sourceHeight) will change svg scale first, then draw it on Image pixmap

        1 Reply Last reply
        0
        • Mark A. GreenM Offline
          Mark A. GreenM Offline
          Mark A. Green
          wrote on last edited by
          #3

          Thanks for the reply. Unfortunately I'm using QWidgets and not qml.

          1 Reply Last reply
          0
          • Mark A. GreenM Offline
            Mark A. GreenM Offline
            Mark A. Green
            wrote on last edited by
            #4

            Follow up (many years later). The problems I was having with SVG scaling were not a Qt problem but a problem with the dimensions of the SVG. The dimensions need to be a factor of 4 for clean scaling. My SVGs were based on legacy code and had dimensions of 26x29 pixels. Changing to 24x28 fixed everything right up.

            mrjjM 1 Reply Last reply
            4
            • Mark A. GreenM Mark A. Green

              Follow up (many years later). The problems I was having with SVG scaling were not a Qt problem but a problem with the dimensions of the SVG. The dimensions need to be a factor of 4 for clean scaling. My SVGs were based on legacy code and had dimensions of 26x29 pixels. Changing to 24x28 fixed everything right up.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @Mark-A.-Green
              Congrats. Best come back i have seen so far :)

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #6

                Now here's a rare case where necro-posting is completely appropriate and appreciated :-D

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                2

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved