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: SO is Windows 7 64 bits # MingW compiler # Qt 4.8 # OSG 3.0.1
PS2: Attached to this post are the files I used in this project, including the
pro file from qmake.
------------------
Post generated by Mail2Forum
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53050#53050
Attachments:
http://forum.openscenegraph.org//files/prueba_osg_983.pro
http://forum.openscenegraph.org//files/wrapper_994.cpp
http://forum.openscenegraph.org//files/prueba_qt_139.cpp
http://forum.openscenegraph.org//files/wrapper_153.h
http://forum.openscenegraph.org//files/viewer_100.h
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org