Results 1 to 4 of 4

Thread: 4 openGL viewports

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default 4 openGL viewports

    Hello

    i would like to know which is the best approach in creating multiple openGL viewports, (for the same scene), with each viewport being in a separate widget, tha can be resized etc... You know.. sth every 3d modeling program does... like 3ds max for example.

    Thanks in advance

  2. #2
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 4 openGL viewports

    A QGraphicsScene can be viewed by multiple QGraphicsViews. So just create 4 QGraphicsViews, and on each one do:
    Qt Code:
    1. setViewport(new QGLWidget());
    To copy to clipboard, switch view to plain text mode 

    ~codeslicer
    [WIKI]Building Qt on Windows CE[/WIKI]

  3. #3
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 openGL viewports

    Thanks man! Short but very helpful!

  4. #4
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 openGL viewports

    I managed to setup the 4 viewports, after having a look at this... http://qt.gitorious.org/qt-labs/modelviewer

    It uses a graphicsScene, and graphicsViews hust like codeslicer proposed.

    The thing is tha now i'm a bit confused about how to manage the scene, and how to display the scene content depending on which View is currently active. In the modelviewer app, everything is drawn in the function drawBackground() of the class GraphicsScene. But i obviously i need sth more flexible...

    So how can i use , these 3 classes... GraphicsScene, GraphicsView, QGLWiddet....(or derived classes), to achieve what i want?

    thanks in advance

Similar Threads

  1. Replies: 0
    Last Post: 6th December 2009, 00:41
  2. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 10:10
  3. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 09:37
  4. Qt in opengl
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2007, 16:38
  5. openGL
    By dragon in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2006, 16:07

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.