[vtkusers] Problem with 0x00007FFC09F86810 (vtkCommonExecutionModel-8.0.dll) untreated exceptions
张
18434364531 at 163.com
Sun Mar 11 23:10:13 EDT 2018
Hello everyone!
My project is to show a picture on the qvtkwidget.
When I run the project, there is no picture show on the qvtkwidget.And when I click the qvtkwidget, there is a new error:
0x00007FFC09F86810 (vtkCommonExecutionModel-8.0.dll)There are untreated exceptions in QtGuiApplication2.exe: 0xC0000005:
An access conflict occurs when the location 0x0000000000000060 is read.
My code:
QtGuiApplication2.h:-----------------------------------------------------------------------------------
#pragma once #include <QtWidgets/QMainWindow> #include "ui_QtGuiApplication2.h" #include <vtkAutoInit.h> VTK_MODULE_INIT(vtkRenderingOpenGL2); VTK_MODULE_INIT(vtkInteractionStyle); class vtkRenderer; class QtGuiApplication2 : public QMainWindow { Q_OBJECT public: QtGuiApplication2(QWidget *parent = Q_NULLPTR); private: Ui::QtGuiApplication2Class ui; protected: vtkRenderer *ren1; };
QtGuiApplication2.cpp:-----------------------------------------------------------------------------------
#include "QtGuiApplication2.h" #include "vtkRenderWindow.h" #include "vtkRenderer.h" #include "vtkPNGReader.h" #include "vtkImageViewer.h" QtGuiApplication2::QtGuiApplication2(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); vtkPNGReader *reader = vtkPNGReader::New(); reader->SetFileName("1.png"); reader->Update(); vtkImageViewer *image_view = vtkImageViewer::New(); image_view->SetInputConnection(reader->GetOutputPort()); ui.qvtk1->SetRenderWindow(image_view->GetRenderWindow()); image_view->SetupInteractor(ui.qvtk1->GetRenderWindow()->GetInteractor()); ren1 = vtkRenderer::New(); ui.qvtk1->GetRenderWindow()->AddRenderer(ren1); ui.qvtk1->GetRenderWindow()->Render(); image_view->Delete(); reader->Delete(); }
main.cpp:----------------------------------------------------------------------------------------------------------
#include "QtGuiApplication2.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QtGuiApplication2 w;
w.show();
return a.exec();
}
Thanks a lot for your help!
Best,
Sheryl.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180312/1a356a7a/attachment.html>
More information about the vtkusers
mailing list