Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qml SVG Image producing aliased result
QtWS25 Last Chance

Qml SVG Image producing aliased result

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 1.0k Views
  • 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.
  • C Offline
    C Offline
    ChiefyChief
    wrote on 24 Jan 2022, 21:52 last edited by
    #1

    Good evening all,

    I'm currently working on a personal project that includes buttons with images inside as shown in the clip out below. However, for some reason after moving to another pc to do work, the images started to have aliasing. The image format used is SVG so not sure why and I struggled to find any information regarding the matter. The application is written in QML.

    First PC: Surface Book 2
    Screen: 3000 x 2000 UI scaling at 200%

    Second PC: Custom Build
    Screen: 3440 x 1440 UI scaling at 100%

    I'm using Qt6.2, does anyone have any ideas?

    21b74bd9-72e4-4b47-afdd-59fa8794bbf6-image.png

    1 Reply Last reply
    1
    • F Offline
      F Offline
      fcarney
      wrote on 24 Jan 2022, 22:39 last edited by
      #2

      In Image set:

      smooth: true
      antialiasing: true
      sourceSize: Qt.size(somex, somey) // set to large enough to get good sampling size, I don't know why this works, but its in my notes
      

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fcarney
        wrote on 24 Jan 2022, 22:41 last edited by
        #3

        @fcarney said in Qml SVG Image producing aliased result:

        set to large enough to get good sampling size

        I "think" this is the size it draws in memory. So the larger the size the more memory it would take. I just set this to the size of my Image.

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChiefyChief
          wrote on 25 Jan 2022, 23:14 last edited by
          #4

          @fcarney I appreciate the response but this didn't work for me. This however, led me to look further into the documentation. I was aware of smooth, anti-aliasing, and sourceSize which I all tried and didn't work.

          Solution

          The solution in the end was mipmap: true on the image, which results back to a smooth image. This is default to false, and I didn't realise that scaling the image down would produce a bad quality image but turns out, yes.

          1 Reply Last reply
          3

          1/4

          24 Jan 2022, 21:52

          • Login

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