Results 1 to 12 of 12

Thread: Using QGLWidget paint engine to draw regular widgtes?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Using QGLWidget paint engine to draw regular widgtes?

    Reading one of the other threads in this forum I came up with an idea - maybe redirecting QPainter (QPainter::setRedirected) could help? You could redirect painting child widgets to the parent (GL based) widget's painter. It is probable that you should do some transforming/clipping of the GL painter to make it work (or maybe using the "offset" param will be enough).

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Using QGLWidget paint engine to draw regular widgtes?

    That looks interesting!
    I'll have a look at it - thanks.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Using QGLWidget paint engine to draw regular widgtes?

    Hi again,

    I just wanted to add that I tried QPainter::setRedirected, and it works in the sence that you can use it to draw the controls in a GL context.
    I do it by first redirecting the draw event of the widget I want on to a QPixmap, and then I use a GL initiated QPainter to draw this pixmap in GL context.
    The problem is, that this only DRAWS the controls in GL, so these are not real object anymore under GL...
    It looks like having 'responding objects' under GL will force me to do sume subclassing after all...

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
  •  
Qt is a trademark of The Qt Company.