You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Wednesday, June 15th 2011, 1:49pm

QVTKWidget issues

Hi everyone,
I'm new to VTK and Qt. I can compile and run Qt and VTK applications but I need to integrate VTK into my Qt GUI. I tried to create an application using QVTKWidget but it crashes on
QVTKWidget *myWidget = new QVTKWidget;
with following message
The program '[6048] xxxxx.exe: Native' has exited with code 1 (0x1).

If I comment this line everything works fine.

#include <QMainWindow>
#include <QWidget>

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

QMainWindow mainWindow;
mainWindow.setWindowTitle("My Widget");
mainWindow.setGeometry(100, 100, 500, 355);

QVTKWidget *myWidget = new QVTKWidget;;

return app.exec();

Any ideas?

Regards, Alex


Tuesday, February 7th 2012, 4:24pm

Change that line with:

QVTKWidget widget;

Hope it helps.


Tuesday, February 7th 2012, 6:08pm

What version of qt is qvtkwidget built with? have you debugged into the qvtkwidget constructor? what version is your Qt library?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.