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. QGLWidget update(rect) always returns entire rect in paintEvent
Qt 6.11 is out! See what's new in the release blog

QGLWidget update(rect) always returns entire rect in paintEvent

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 646 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.
  • J Offline
    J Offline
    jjxtra
    wrote on last edited by
    #1

    I have a simple painting app using a QGLWidget that I am calling update(rect) on, passing in a rect that is much smaller than the rect of the QGLWidget. I use a QImage to draw into, and then in the paintEvent, I draw a portion of that to the QGLWidget. When I put a break point on the paintEvent method, and call event->rect() or event->region().rects(), it returns the entire rect of the QGLWidget. I would have expected it to return only the rect that was passed to the update method.

    As a consequence, drawing on my iPhone is horribly laggy.

    Here is my code: http://pastebin.com/beyyHCPw

    If you scroll to the bottom of the pastebin, you will see my logging code where I am logging which rect I draw (draw rect) to and then later which rect comes back in the paint event (update rect).

    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