Hi everyone, I'm trying to modify the osgViewerQt example by adding a new class of my own that will contain the viewer. The design is:
wrapper.h: Defines class Wrapper. It inherits from QMainWindow and has a QDockWidget where the ViewerWidget will be attached. viewer.h: Defines ViewerWidget class. It's the class from the example, with a few mods by me. prueba_osg.cpp: Main function and where a QApplication is created. A Wrapper object is created here. The project compiles, but when I execute it, I get an error: > QWidget: Must construct a QApplication before a QPaintDevice If I remove the Q_OBJECT line, the signal and the slot from wrapper.h and compile the files from the terminal using > > g++ -IE:/osg-3.0.1/install/include -LE:/osg-3.0.1/install/bin > -IC:/Qt64/4.8/include -LC:/Qt64/4.8/bin -losgViewer -lOpenThreads -losgDB > -losg -losgGA -losgQt -lQtCore4 -lQtGui4 prueba_qt.cpp > I can execute the app. Can you please tell me what can I do to make this work? I've struggling all morning but couldn't find the solution. Thanks for your time! ... PS: Attached to this post are the files I used in this project, including the pro file (which I had to rename to txt in order to upload it) from qmake. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53049#53049 Attachments: http://forum.openscenegraph.org//files/prueba_osgpro_345.txt http://forum.openscenegraph.org//files/viewer_160.h http://forum.openscenegraph.org//files/prueba_qt_104.cpp http://forum.openscenegraph.org//files/wrapper_119.cpp http://forum.openscenegraph.org//files/wrapper_386.h _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

