[vtkusers] QApplication::palette() failed

Adam Hooper adamh at densi.com
Tue Aug 2 09:11:01 EDT 2005


On Fri, 2005-07-29 at 14:07 -0400, Adam Hooper wrote:
> 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'm following up on myself with my results from a couple more tests.

I instantiated a QWidget and show()-ed it right before instantiating the
QVTKWidget. The QWidget actually gets drawn, and *then* the program
crashes with the above error message when the QVTKWidget's show() is
called.

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

I've also tried compiling and using the free version of QT 4.0 available
at <http://qtwin.sourceforge.net>. That gets rid of the annoying
evaluation version splash screen, but my problem remains.

Has anybody gotten QVTKWidget working on Windows? If so, how?

-- 
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/20050802/5f305945/attachment.pgp>


More information about the vtkusers mailing list