3、贴该类的代码 .h: #pragma once #include "QVTKWidget.h" class vtkRenderer; class vtkRenderWindowInteractor; class myVTKWidget : public QVTKWidget { Q_OBJECT public: explicit myVTKWidget(QWidget*parent = 0); vtkRenderer *ren1; vtkRenderWindowInteractor *iren; signals: public slots: };