Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    SOLVED: Pattern BrushStyle drawn "spotty" or incomplete

    General and Desktop
    1
    2
    1656
    Loading More Posts
    • 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
      Asperamanca last edited by

      I am using the Qt::VerPattern when painting rectangles. Sometimes, they look fine, but often, they are spotty, incomplete or altogether missing.

      !http://members.aon.at/legends/temp/tcl_spottypatterns_part.png("Spotty" brush patterns)!

      The area encircled in red contains 11 rectangles, some drawn with a solid pattern, some with a VerPattern.

      This is not an issue of the rectangles being too small for the pattern to paint properly - I've been through this before, and knew I had to look for it.
      Also, rectangles painted with the solid pattern are always correct. Therefore, the issue lies with the pattern, not the rectangle coordinates.

      When you consider the rectangle right below the text "09:50:10", it's a single rectangle, but as you see, there are vertical lines missing.

      The brush I use is
      @QBrush(QColor(ARGB 1, 0.788235, 0.788235, 0.788235) , VerPattern )@
      The rectangle I paint is
      @QRectF(31672,3 4312x14)@
      (Note: I am using a transformation on the x-axis. The x-coordinates are given in milliseconds from the left edge of the display. You can check the width of the rectangle of 4312 ms against the scale displayed above, and the width matches).

      Any ideas what's wrong here?

      1 Reply Last reply Reply Quote 0
      • A
        Asperamanca last edited by

        Seems that brush patterns don't work very well with transformations...or the docs simply don't mention how transformations affect brush patterns.

        Leaving the painter in its original transform, and mapping the rectangles myself does the trick.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post