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. QPainter Transformation & Non-Solid Brushes
Forum Updated to NodeBB v4.3 + New Features

QPainter Transformation & Non-Solid Brushes

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 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.
  • A Offline
    A Offline
    andi83
    wrote on last edited by
    #1

    Hi!

    I am using a transformed QPainter to draw some filled polygons with a non-solid brush style (e.g. Qt::Dense1Pattern). The painter gets transformed according to the zoom factor, the translation and the rotation chosen by the user. The scene is drawn in the paint method of a QQuickPaintedItem derived class using 'Image' as render target. Unfortunately, aliasing artifacts appear within the filled polygons, when the user zooms in and out.

    Zoom level without artifacts:

    !http://s11.postimg.org/dlrpz6xc3/artifacts1.png(no artifacts)!

    Zoom level with artifacts:

    !http://s22.postimg.org/y9mox4ckd/artifacts.png(artifacts)!

    It seems, that the artifacts are caused by the transformation of the brush .

    The first workaround, that came into my mind, was to set the inverse transformation of the painter on the brush. Doing it this way, the orientation of the fill pattern stays the same when the view gets rotated but this is neglectable at the moment.

    Is there a better solution for this problem than setting the inverse transformation on the brush?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      This question might be revealing a bug, I think you should bring it to the interest mailing list (you'll find there Qt's developers/maintainers, this forum is more user oriented).

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andi83
        wrote on last edited by
        #3

        Thank you for the tip, I'll give that a try.

        Cheers!

        1 Reply Last reply
        0

        • Login

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