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
Forum Updated to NodeBB v4.3 + New Features

QPaintEvent ignore automatic clipping

Scheduled Pinned Locked Moved Unsolved General and Desktop
qpaintevent
3 Posts 3 Posters 302 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 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

    JonBJ 1 Reply Last reply
    0
    • D Dariusz

      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

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on 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

        • Login

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