<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height: 1.7;"><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;">Hello everyone!</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;">My project is to show a picture on the qvtkwidget.</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;">When I run the project, there is no picture show on the qvtkwidget.And when I click the qvtkwidget, there is a new error:</span><span style="white-space: pre-wrap; font-family: arial;"> </span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;">0x00007FFC09F86810 (vtkCommonExecutionModel-8.0.dll)</span></font><font face="arial"><span style="white-space: pre-wrap;">There are untreated exceptions in </span></font><span style="font-family: arial; white-space: pre-wrap;">QtGuiApplication2.exe</span><span style="white-space: pre-wrap; font-family: arial;">: 0xC0000005:</span></div><div style="line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;">An access conflict occurs when the location 0x0000000000000060 is read.</span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;">My code:</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;">QtGuiApplication2.h:-----------------------------------------------------------------------------------</span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;">#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;
};</span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;"><br></span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><span style="font-family: arial; white-space: pre-wrap;">QtGuiApplication2.cpp:</span><span style="font-family: arial; white-space: pre-wrap;">-----------------------------------------------------------------------------------</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;">#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();
}</span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><font face="arial"><span style="white-space: pre-wrap;"><br></span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><span style="font-family: arial; white-space: pre-wrap;">main.cpp:---------------------------------------------------------------------------------------------------------</span><span style="font-family: arial; white-space: pre-wrap;">-</span><br><div style="line-height: 1.7;">#include "QtGuiApplication2.h"</div><div style="line-height: 1.7;">#include <QtWidgets/QApplication></div><div style="line-height: 1.7;"><br></div><div style="line-height: 1.7;">int main(int argc, char *argv[])</div><div style="line-height: 1.7;">{</div><div style="line-height: 1.7;"><span style="white-space:pre"> </span>QApplication a(argc, argv);</div><div style="line-height: 1.7;"><span style="white-space:pre"> </span>QtGuiApplication2 w;</div><div style="line-height: 1.7;"><span style="white-space:pre"> </span>w.show();</div><div style="line-height: 1.7;"><span style="white-space:pre"> </span>return a.exec();</div><div style="line-height: 1.7;">}</div><div style="line-height: 1.7;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; position: relative; zoom: 1;"></div><div id="divNeteaseMailCard" style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"></div>Thanks a lot for your help!</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;">Best,</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; line-height: 1.7;">Sheryl.</div></div><span title="neteasefooter"><p><br> </p></span></div><br><br><span title="neteasefooter"><p><br/> </p></span>