[vtkusers] QApplication::palette() failed

Adam Hooper adamh at densi.com
Fri Jul 29 14:07:36 EDT 2005


I've written the following test for QVTKWidget:

-----
#include <QtGui/QApplication>

#include <QVTKWidget.h>

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	QVTKWidget widget;
	widget.show();

	return app.exec();
}
-----

On Linux, this compiles and runs just fine (as one would expect). On
Windows, it fails with the following error:

QApplication::palette() failed: please instantiate the QApplication
object first.

QPaintDevice: Must construct a QApplication before a QPaintDevice

I've tried making a QObject class which instantiates the QVTKWidget, and
called that in an event handler using app.postEvent() (thus
instantiating the QVTKWidget from within app.exec()), but the error
persists. I simply can't find a way to start a program with a QVTKWidget
in it.

Does anybody else experience this problem or know what's wrong? I'm
using Qt 4.0.0 under the Evaluation License.

-- 
Adam Hooper <adamh at densi.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050729/f0d59db5/attachment.pgp>


More information about the vtkusers mailing list