Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94901

Quality of SVG icons in Qt Quick controls is dependent on control's dimensions

    XMLWordPrintable

Details

    Description

      See attached screenshot and code. A simple SVG image is set as the icon on many Buttons (all with different dimensions).

      The SVG specifies a circle with diameter 32, and a viewport of 32x32. The icon size is set equal to the optimal viewport size (32 x 32) on all Buttons. Every Button is large enough such that no scaling of the image should occur.

      Actual outcome

      All icons are exactly 32 x 32, as expected.

      However, depending on the the exact dimensions of the parent Button, the icon might be rasterized a bit too big before getting cropped. This seems to occur when the Button dimensions are an odd number.

       

      Expected outcome

      All icons should look exactly the same, regardless of the Button dimensions.

      Attachments

        1. qtbug84901-circle-workaround.svg
          2 kB
          Mitch Curtis
        2. qtbug84901-mitch-ubuntu-DPR-2.png
          102 kB
          Mitch Curtis
        3. qtbug84901-ubuntu-DPR-2-workaround.png
          104 kB
          Mitch Curtis
        4. Screenshot 2021-07-20 at 17.06.40.png
          44 kB
          Volker Hilsheimer
        5. svg-icon-results.png
          25 kB
          Sze Howe Koh
        6. svg-raster-study-1.zip
          2 kB
          Sze Howe Koh
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kagro Kaj Grönholm
            skoh-qt Sze Howe Koh
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes