[vtkusers] Close QVTKWidget crash

Xavius xavierelf at gmail.com
Wed Nov 30 02:18:06 EST 2011


Hi, guys!

I have a problem with QVTKWidget. My app has 4 QVTKWidget. When I double
click one of them, it should stretch on the whole window, while others
should be deleted (to release resources). But when I try to delete widgets -
they crash somewhere in Remainder Loop of vtkObject::InvokeEvent(...)
because of null pointer.
The code I used id:
in MyQVTKWidget:
onLeftButtonPressed(...) {
  QTime t = QTime::currentTime();
  if (mTime.msecTo(t) < 200)
    emit leftBnDblClicked();
  mTime = t;
}

in widget manager:
onLeftBnDblClicked() {
  if (!mWidgets.isEmpty()) {
    qDeleteAll(mWidgets);
    mWidgets.clear();
  }

  MyQVTKWidget *widget = new MyQVTKWidget;
  mWidgets.append(widget);
  mLayout->addWidget(widget, 0, 0);
  ...
}

Please point me, what I'm doing wrong?

--
View this message in context: http://vtk.1045678.n5.nabble.com/Close-QVTKWidget-crash-tp5034772p5034772.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list