Commit fbd0f43b authored by finetjul's avatar finetjul
Browse files

BUG: qMRMLNodeComboBox was not selecting the None item when a scene was set

git-svn-id: http://svn.slicer.org/Slicer4/trunk@14692 3bd1e089-480b-0410-8dfb-8563597acbee
parent 8b6cfff8
...@@ -345,13 +345,17 @@ void qMRMLNodeComboBox::setMRMLScene(vtkMRMLScene* scene) ...@@ -345,13 +345,17 @@ void qMRMLNodeComboBox::setMRMLScene(vtkMRMLScene* scene)
// The Add button is valid only if the scene is non-empty // The Add button is valid only if the scene is non-empty
//this->setAddEnabled(scene != 0); //this->setAddEnabled(scene != 0);
QVariant currentNode = d->ComboBox->itemData(d->ComboBox->currentIndex(), qMRML::UIDRole);
// Update factory // Update factory
d->MRMLNodeFactory->setMRMLScene(scene); d->MRMLNodeFactory->setMRMLScene(scene);
d->MRMLSceneModel->setMRMLScene(scene); d->MRMLSceneModel->setMRMLScene(scene);
d->updateNoneItem(); d->updateNoneItem();
d->updateActionItems(); d->updateActionItems();
// setting the rootmodel index looses the current item
d->ComboBox->setRootModelIndex(this->model()->index(0, 0)); d->ComboBox->setRootModelIndex(this->model()->index(0, 0));
// try to set the current item back
this->setCurrentNode(currentNode.toString());
this->setEnabled(scene != 0); this->setEnabled(scene != 0);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment