QGLWidget in a plugin
My application uses plugins which have forms for options, etc. When I use simple forms with simple widgets like push buttons and labels everything works ok, form appears in main application but when I use QGLWidget I receive the following message: "QApplication must be created before QPainterDevice", then main application crashes. How to embed QGLWidget in a plugin in a proper way?
May be silly to ask, but are you creating a QGLWidget before your QApplication (that is, are you instantiating the QApplication first-hand before you load plugins, etc.?
I load plugin by clicking the button in the main window thus QApplication was already created by this moment. Just tell me if you have successfull practice in using QGLWidget in a plugin. I don't know if it is bug in my application or QGLWidget cannot really be used in a plugin.
EDIT: Really, I use the class that has QGLWidget as a subclass. Tried to use QGLWidget instead. Everything ok. So the problem is in plugin.