Results 1 to 4 of 4

Thread: QGLWidget inside QGraphicsScene/View

  1. #1
    Join Date
    Aug 2008
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QGLWidget inside QGraphicsScene/View

    hi,
    what are the different ways a QGLWidget can be put into QGraphicsScene/View ?

    it would be better if you can provide code snippet.

    thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGLWidget inside QGraphicsScene/View

    Basically you can make it a viewport of graphics view. As far as I remember using QGraphicsProxyWidget with a GL widget doesn't work, so that one is off.

  3. #3
    Join Date
    Aug 2008
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGLWidget inside QGraphicsScene/View

    Hi wysota,

    1) ok, after making viewport, where should i put OpenGL calls, e.g. in drawBackground() method or ther are other posibilities ???

    2) can I connect (draw a line between) a QGLWidget's graphics primitive with QGraphicsItem or widget ? how? Like that is avaliable ni vtk demo.

    Thank you.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGLWidget inside QGraphicsScene/View

    Quote Originally Posted by h123 View Post
    1) ok, after making viewport, where should i put OpenGL calls, e.g. in drawBackground() method or ther are other posibilities ???
    Wherever you want - drawBackgound(), drawForeground() or in the items themselves.

    2) can I connect (draw a line between) a QGLWidget's graphics primitive with QGraphicsItem or widget ? how?
    Yes, I don't see a problem. Make that GL primitive an item as well.

Similar Threads

  1. GL Logic op blending inside QGLWidget
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2006, 19:55

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.