A bit more info: I created a very stripped down test program, removing almost everything except for the line
’ vtk = new MyVTK(mdiArea_VTK, widget_key);’
that creates the QVTKWidget. The form has the QMdiArea (mdiArea_VTK) and the QWidget (widget_key) and virtually nothing else. This program executes correctly.
In my original (faulty) program I moved the line above to the top of mainwindow.cpp:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
vtk = new MyVTK(mdiArea_VTK, widget_key);
MyVTK(QWidget *, QWidget *);
void key_canvas(QWidget *);
and the function MyVTK is:
MyVTK::MyVTK(QWidget *page, QWidget *key_page)
page_VTK = page;
qvtkWidget = new QVTKWidget(page_VTK,QFlag(0));
QVBoxLayout *layout = new QVBoxLayout;
// Associate the layout with page_VTK
// Create a renderer, and add it to qvtkWidget’s render window.
// The renderer renders into the render window.
ren = vtkRenderer::New();
renWin = qvtkWidget->GetRenderWindow();
This still crashes in the call to GetRenderWindow().
The program is rather complex, and the form has many pages, making it difficult to come up with a test program intermediate between the real program and the extremely simplified test program that works.
Since the code performs correcting on Windows, the problem seems to be related to some difference between the Windows and Linux. I’m stumped.