Results 1 to 6 of 6

Thread: Problems running GraphicsView sample for QtQuarterly Issue 26

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Problems running GraphicsView sample for QtQuarterly Issue 26

    Qt Quarterly issue 26 had an article called "Accelerate your Widgets with OpenGL" which I downloaded and compiled the sample code using Qt 4.5.2 and VS 2008. I am running Vista Ultimate x64.

    The article in question is located here: http://qt.nokia.com/doc/qq/qq26-openglcanvas.html

    When I compile and run the app from within VS 2008 IDE everything works just fine. However if I run the very same openglscene.exe by double-clicking on the exe, the window does not display the OpenGl objects that are loaded.

    I also have Qt 4.6.2, and have also compiled the same code with VS 2008 and Qt 4.6.2 and when I try to run the openglscene.exe either inside VS 2008 or by double-cleicking on the exe, I do not see the OpenGl objects.

    Please see the attached jpgs for what I am experiencing.

    Please note, the example code has not been modified in any way.

    What am I missing when I try to run the openglscene.exe when not in VS 2008?

    Thanks in advance for any help.

    Gil
    Attached Images Attached Images

  2. #2
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems running GraphicsView sample for QtQuarterly Issue 26

    At a guess I would say that when the programme is compiled and run from within VS2008, the IDE is supplying the OpenGL objects to be displayed.

    The standalone version needs to be know where to find these at run time, either by being supplied with the path to them or by having them compiled in.

    I am not familiar with VS2008 but I expect that there is an option or switch to have these statically linked when compiling.

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Problems running GraphicsView sample for QtQuarterly Issue 26

    The actual files displayed in the OpenGl window are located in a folder separate from the application. You can browse to open whichever .obj file you want to display.

    If you look at the window that is not showing the opengl objects, you can see that the "model" dialog shows that the object has been loaded but it is not being displayed.

    Also note that the order of the dialogs in the window is reversed compared to the window that is working.

    Gil

  4. #4
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problems running GraphicsView sample for QtQuarterly Issue 26

    I have the same problem.

    The OpenGL part of my application is based on the GraphicsView sample of QtQuarterly Issue 26. I'm now trying to switch from Qt 4.5.2 to Qt 4.6.3 but when compiling in Qt 4.6.3 the openGL objects are no longer visible.

    Does anybody has an idea on how to make objects visible again?

    Thanks

  5. #5
    Join Date
    Jan 2010
    Posts
    7
    Thanked 1 Time in 1 Post

    Default Re: Problems running GraphicsView sample for QtQuarterly Issue 26

    Partial solution
    With Qt4.7 the default painter type for OpenGL is OpenGL2 (at least on my machine)

    So line 138 in OpenGLScene.cpp needs to be
    Qt Code:
    1. if (painter->paintEngine()->type() != QPaintEngine::OpenGL2) {
    To copy to clipboard, switch view to plain text mode 

    Or probably better to check against OpenGL and OpenGL2
    This will draw the model, still having some issues with the dialog decoration
    Last edited by mgb; 3rd August 2010 at 18:46.

  6. #6
    Join Date
    Jul 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems running GraphicsView sample for QtQuarterly Issue 26

    Same problem here. The above gets me "something" in the viewport when I load a model (and gets rid of the openGL context not present error), but it is distorted and flashing.
    Also on qt 4.6.3

Similar Threads

  1. Replies: 1
    Last Post: 3rd November 2009, 12:25
  2. Brush problems in GraphicsView
    By maverick_pol in forum Qt Programming
    Replies: 8
    Last Post: 12th August 2008, 19:25
  3. GraphicsView performance problems
    By Gopala Krishna in forum Qt Programming
    Replies: 79
    Last Post: 8th August 2007, 17:32
  4. problems running: uic.exe, moc.exe etc.[fixed]
    By fres in forum Installation and Deployment
    Replies: 2
    Last Post: 16th June 2007, 00:17
  5. Problems running on a Mac
    By spud in forum Qt Programming
    Replies: 2
    Last Post: 20th May 2007, 16:33

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.