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. QPaintEvent ignore automatic clipping
QtWS25 Last Chance

QPaintEvent ignore automatic clipping

Scheduled Pinned Locked Moved Unsolved General and Desktop
qpaintevent
3 Posts 3 Posters 273 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 7 May 2023, 10:12 last edited by
    #1

    Hey

    I'm drawing an element which is animated. During the animation at some point the element may "leave" the bouding rect of widget geometry. How can I disable clipping in paintEvent so that it would draw outside the widget geo ?

    Regards
    Dariusz

    J 1 Reply Last reply 7 May 2023, 10:50
    0
    • D Dariusz
      7 May 2023, 10:12

      Hey

      I'm drawing an element which is animated. During the animation at some point the element may "leave" the bouding rect of widget geometry. How can I disable clipping in paintEvent so that it would draw outside the widget geo ?

      Regards
      Dariusz

      J Offline
      J Offline
      JonB
      wrote on 7 May 2023, 10:50 last edited by
      #2

      @Dariusz
      My guess:

      • If you construct your own QPainter call the necessary (larger) setClipRect() and/or setCipRegion().

      • If you override QWidget::paintEvent(QPaintEvent *event) substitute your own QPaintEvent with (larger) QRect/QRegion before passing on.

      Not sure whether you will have other problems (such as "artefacts" being shown) if you make a widget paint outside its boundingRect().

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 7 May 2023, 18:43 last edited by
        #3

        Hi,

        Do you mean draw on a different widget ? If so, you can't. What you can do is use a larger widget so you have a larger surface to use.

        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

        1/3

        7 May 2023, 10:12

        • Login

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