I think you'd be better off asking this question on the qt-interest mailing list; your problem doesn't appear to have anything to do with Qt Creator the IDE.
/s/ Adam On Thu, Sep 3, 2009 at 10:34 AM, Jihan Zoghbi<[email protected]> wrote: > Hi everybody, > > I'm a beginner in using VTK with QTcreator. I pick up an example from the > Internet, which is the following. > > The VTK.pro > ================================================================================= > > TARGET = VTK_App > > TEMPLATE = app > > SOURCES += main.cpp\ > > vtk_example.cpp > > HEADERS += vtk_example.h > > FORMS += vtk_example.ui > > LIBS += -L/usr/local/lib/vtk-5.4 -lvtkCommon -lvtksys -lQVTK -lvtkQtChart > -lvtkViews -lvtkWidgets -lvtkInfovis -lvtkRendering -lvtkGraphics > -lvtkImaging -lvtkIO -lvtkFiltering -lvtklibxml2 -lvtkDICOMParser -lvtkpng > -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkalglib -lvtkexpat -lvtkverdict > -lvtkmetaio -lvtkNetCDF -lvtksqlite -lvtkexoIIc -lvtkftgl -lvtkfreetype > -lvtkHybrid > > INCLUDEPATH +=/usr/local/VTK\ > > ========================================================================================= > the main.cpp > > > #include <QtGui/QApplication> > > #include "vtk_example.h" > > int main(int argc, char *argv[]) > > { > > QApplication a(argc, argv); > > VTK_example w; > > w.show(); > > return a.exec(); > > } > > ==================================================================================================== > vtk_example.cpp > > #include <QVTKWidget.h> > > #include <vtkRenderer.h> > > #include <vtkRenderWindow.h> > > #include "ui_vtk_example.h" > > VTK_example::VTK_example(QWidget *parent) > > : QMainWindow(parent), ui(new Ui::VTK_example) > > { > > ui->setupUi(this); > > QVTKWidget* vtkWidget; > > vtkRenderer* ren; > > vtkWidget = new QVTKWidget(this,QFlag(0)); > > ui->verticalLayout->addWidget(vtkWidget); > > ui->verticalLayout->update(); > > ren = vtkRenderer::New(); > > vtkWidget->GetRenderWindow()->AddRenderer(ren); > > ren->SetBackground(1.0,0,0); > > ren->Render(); > > } > > VTK_example::~VTK_example() > > { > > //delete ui; > > } > > =========================================================================================================== > vtk_example.h > > #ifndef VTK_EXAMPLE_H > > #define VTK_EXAMPLE_H > > #include <QtGui/QMainWindow> > > namespace Ui > > { > > class VTK_example; > > } > > class VTK_example : public QMainWindow > > { > > Q_OBJECT > > public: > > VTK_example(QWidget *parent = 0); > > ~VTK_example(); > > private: > > Ui::VTK_example *ui; > > }; > > #endif // VTK_EXAMPLE_H > > ========================================== > The program compile fine, but when I execute it, the following error is > shown: > > ""The program has unexpectedly finished. > > VTK_App exited with code 0"' > > Anybody has any idea about the error? > > Any kind of help is appreciated. > > -- > Jihan Zoghbi > > > _______________________________________________ > Qt-creator mailing list > [email protected] > http://lists.trolltech.com/mailman/listinfo/qt-creator > > _______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
