Results 1 to 4 of 4

Thread: Rendering 3D Objects on Ubuntu

  1. #1
    Join Date
    Feb 2008
    Posts
    51
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Rendering 3D Objects on Ubuntu

    Hi,

    I tried to show 3D objects in Graphics View framework.
    I know it is not written to show 3D objects but I have to do it.

    I have inherited my class from QGLWidget and QGraphicsItem and added this item into scene.

    By doing a trick I am able to show object in the scene.
    But getting following warnings on console.

    How can I get override of it?

    QPainter::save: Painter not active
    QPainter::setRenderHint: Painter must be active to set rendering hints
    QPainter::restore: Painter not active
    QPainter::restore: Painter not active
    QPainter::save: Painter not active
    QPainter::restore: Painter not active
    QPainter::end: Painter not active, aborted
    QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent
    QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent
    QPainter::begin: A paint device can only be painted by one painter at a time.
    QPainter::setRenderHint: Painter must be active to set rendering hints
    QPainter::setRenderHint: Painter must be active to set rendering hints
    QPainter::setWorldTransform: Painter not active
    QPainter::save: Painter not active
    QPainter::restore: Unbalanced save/restore
    QPainter::save: Painter not active
    QPainter::setWorldTransform: Painter not active
    QPainter::save: Painter not active
    QPainter::setRenderHint: Painter must be active to set rendering hints
    QPainter::restore: Unbalanced save/restore
    QPainter::restore: Unbalanced save/restore
    QPainter::save: Painter not active
    QPainter::restore: Unbalanced save/restore
    QPainter::end: Painter not active, aborted
    QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent
    QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent

    Please help.

    Thanks in advance.
    Sandip

  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: Rendering 3D Objects on Ubuntu

    Showing us some code could be helpful. In short you are painting in a wrong place.

  3. #3
    Join Date
    Feb 2008
    Posts
    51
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Rendering 3D Objects on Ubuntu

    Hi,
    Please find attached zip file for source code.
    It will be a great help for me if you can figure out why it is showing those warnings.

    Thanks a lot!
    Sandip
    Attached Files Attached Files

  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: Rendering 3D Objects on Ubuntu

    You can't inherit from both QGraphicsItem and a widget, it doesn't make any sense. And you are not using a single feature of QGraphicsView, so why use it at all? Embedding a QGLWidget inside a QGLWidget doesn't make much sense either - have a single QGLWidget and in its paintGL() routine call your items' painting routine. Currently you have two different painting routines in each item - one from Graphics View and one from QGLWidget.

Similar Threads

  1. 3D rendering on Ubuntu using QGLWidget
    By sanjayshelke in forum Qt Programming
    Replies: 2
    Last Post: 14th January 2009, 12:05

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.