Gui: fix property editor crash on recompute
The actual cause of crash in previous commit 80f70ff6 is Document::recompute() allows aborting using Base::Sequence, which uses QApplication::processEvent() to catch 'ESC' key press. This local event loop causes premature deletion of the editor widget. This patch moves handling of closeEditor before calling recompute().
This commit is contained in:
@@ -233,6 +233,8 @@ void PropertyEditor::onItemActivated ( const QModelIndex & index )
|
||||
|
||||
void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEditHint hint)
|
||||
{
|
||||
QTreeView::closeEditor(editor, hint);
|
||||
|
||||
if (autoupdate) {
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (doc) {
|
||||
@@ -249,8 +251,6 @@ void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEd
|
||||
QModelIndex indexSaved = currentIndex();
|
||||
FC_LOG("index saved " << indexSaved.row() << ", " << indexSaved.column());
|
||||
|
||||
QTreeView::closeEditor(editor, hint);
|
||||
|
||||
QModelIndex lastIndex;
|
||||
while(this->state()!=EditingState) {
|
||||
QModelIndex index;
|
||||
|
||||
Reference in New Issue
Block a user