Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. clipping
    Log in to post
    • All categories
    • A

      Unsolved Automatic Clipping in QPaintEvent cuts away parts of the drawing result
      General and Desktop • qpaintevent qpainter qwidget clipping paint event • • Allgaeuer

      1
      1
      Votes
      1
      Posts
      260
      Views

      No one has replied

    • jeanmilost

      Solved QPainter ignore the text when the clipping is applied while printing to a PDF document
      General and Desktop • qpainter text clipping print pdf • • jeanmilost

      3
      0
      Votes
      3
      Posts
      393
      Views

      jeanmilost

      @mrjj Thank you for your answer. So I tested to remove the text rectangle passed to the drawContents() function, and indeed the global clipping was applied instead.

    • W

      Unsolved Clipping QGraphicsItems in a QChart
      General and Desktop • qchart qgraphicsitem clipping • • wombatonfire

      3
      0
      Votes
      3
      Posts
      333
      Views

      W

      For sure it can be measured, and I do agree with the approach "if it works fine, just use it".

      But I am still curious, why clipping is expensive in the first place, so that the warning exists in the docs? Has anyone experienced performance impact while actively using clipping for real-time chart?

    • A

      Unsolved QPainter::setClipping(false) is not working(Qt 4.8)
      General and Desktop • qwidget qpainter clipping paintevent • • arju.ach

      14
      0
      Votes
      14
      Posts
      1673
      Views

      SGaist

      You can make a "container widget" that will handle the showing of the label properly.

    • M

      Solved Rounded button with progress background fill
      QML and Qt Quick • qml button progress mask clipping • • markugra

      3
      0
      Votes
      3
      Posts
      1578
      Views

      M

      Thanks, I tried the OpacityMask again as you suggested and it works now. It took me a bit to get it right, because i) I had a warning about the recursive property in ShaderEffectSource needing to be set to "true" and ii) the mask size needs to be the same as the source size for it to work properly. After a while I noticed that i) originated from some code in the contentItem of the button using the ColorOverlay (in fact it was the same problem there i.e. I tried to apply it to the parent). To fix ii) I used a transparent frame so that the code now looks something like:

      background: Item{ width: control.width height: control.height Rectangle{ id: progressFrame anchors.fill: parent color: "transparent" visible: false Rectangle{ id: progressRect width: 0.7*parent.width height: parent.height anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left color: "green" } } Rectangle { id: backgroundRect anchors.fill: parent radius: height / 2 color: "red" visible: true } OpacityMask{ anchors.fill: progressFrame source: progressFrame maskSource: backgroundRect } }

      Resulting in:
      0_1516730617237_960aab10-96cd-4f9e-b86d-afd96504a439-image.png

      Thanks again!