Results 1 to 4 of 4

Thread: paintEvent and overlay-graphics

  1. #1
    Join Date
    Sep 2007
    Posts
    29
    Thanks
    8

    Default paintEvent and overlay-graphics

    hi,
    i'm trying to render an immoveable overlay graphics in the paintEvent(...) function of a QScrollArea.
    unfortunately, only the requested region gets actually updated, so my overlay element mostly doest'n get redrawn and is moved with the other graphics.
    is there a way to bypass this? or is it absolutely necessary to put the overlay element in an extra widget?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: paintEvent and overlay-graphics

    void QAbstractScrollArea:aintEvent ( QPaintEvent * event ) [virtual protected]
    This event handler can be reimplemented in a subclass to receive paint events (passed in event), for the viewport() widget.
    Note: If you open a painter, make sure to open it on the viewport().
    Reimplemented from QWidget.
    Did you do it like this?

  3. #3
    Join Date
    Sep 2007
    Posts
    29
    Thanks
    8

    Default Re: paintEvent and overlay-graphics

    yes. as far as i understand, even when i draw outside the requested area, painting is clipped to it.
    so when i scroll by 1 line, only this line will be updated and the rest will simply be scrolled.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: paintEvent and overlay-graphics

    Why dont u try painting in the parent class ??
    The scroll area must have some owner, and painting on that may give effect of overlay...
    hope i am making sense

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.