QApplication error in exec()
Hi all,
I have a weird problem when my applicarion tries to execute
- app.exec() //QApplication object in main.cpp
I’m trying to integrate an Ogre widget and a VTK widget on my application. All goes good if I use only one of them, but I get that error:
- Unhandled exception at 0x00a1fd88 in QtApp.exe: 0xC0000005: Access violation reading location 0x0672faf0
I followed the error and it seems to crash on the Qt Core, when processing events in file “qapplicarion_win.cpp”
- {
- if (!QEventDispatcherWin32::processEvents(flags)) //HERE CRASHES!!!!
- return false;
- if (configRequests) // any pending configs?
- qWinProcessConfigRequests();
- return true;
- }
I’m using Qt 4.7 under Windows 7.
Have somebody any clue?
Thanks a lot!
6 replies
Here it goes.
The ‘main.cpp’:
- //Main
- int main(int argc, char *argv[])
- {
- MainWindow *mainWin = new MainWindow();
- mainWin->show();
- return app.exec();
- //while (true){}
- }
‘MainWindow.h’:
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- //Qt
- #include <QMainWindow>
- #include "VTKWidget.h"
- #include "OgreWidget.h"
- namespace Ui {
- class MainWindow;
- }
- {
- Q_OBJECT
- public:
- ~MainWindow();
- private:
- //Class Members
- Ui::MainWindow *ui;
- //Widgets
- VTKWidget *mVTKWidget;
- OgreWidget *mOgreWidget;
- };
- #endif // MAINWINDOW_H
And the constructor of ‘MainWindow’ in ‘MainWindow.cpp’:
- ui(new Ui::MainWindow)
- {
- ui->setupUi(this);
- //Create Ogre Widget
- mOgreWidget = new OgreWidget( ui->widgetVis );
- mOgreWidget->resize(800, 600);
- ui->verticalLayoutWidgetVis->addWidget(mOgreWidget);
- ui->verticalLayoutWidgetVis->update();
- mOgreWidget->show();
- //Create VTK Widget
- //vtkRenderWindow* renWin = vtkRenderWindow::New();
- mVTKWidget = new VTKWidget(this);
- //mVTKWidget->SetRenderWindow(renWin);
- //mVTKWidget->createScene();
- //mVTKWidget->show();
- ui->verticalLayoutWidgetSmallVis->addWidget(mVTKWidget);
- ui->verticalLayoutWidgetSmallVis->update();
- }
I’m using the QVTKWidget from VTK source, and the Ogre widget like the defined here [ogre3d.org]
Thanks
You must log in to post a reply. Not a member yet? Register here!


