Skip to content
Snippets Groups Projects
Commit 801fe822 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

ProjectionsEditorCanvas: pick selection model from container

parent 5174055a
No related branches found
No related tags found
1 merge request!1755Fix crashes in IntensityDataProjectionsWidget (#556)
Pipeline #104668 passed
......@@ -63,8 +63,6 @@ void IntensityDataProjectionsWidget::setContext()
{
ASSERT(currentIntensityDataItem());
// m_projectionsCanvas->setSelectionModel(m_selectionModel.get());
// The following line must come before 'm_projectionsCanvas->setContext()'!
// It prevents problem with switching between datasets in projection mode.
m_projectionsWidget->disconnectItem();
......
......@@ -52,17 +52,13 @@ ProjectionsEditorActions::ProjectionsEditorActions(QWidget* parent)
void ProjectionsEditorActions::setContext(IntensityDataItem* intensityItem)
{
ASSERT(intensityItem);
m_intensityDataItem = intensityItem;
ProjectionContainerItem* containerItem = intensityItem->getOrCreateProjectionContainerItem();
ASSERT(containerItem);
m_maskContainerModel = containerItem->model();
ASSERT(m_maskContainerModel);
m_selectionModel = containerItem->selectionModel();
ASSERT(m_selectionModel);
}
QList<QAction*> ProjectionsEditorActions::topToolbarActions()
......
......@@ -58,6 +58,7 @@ void ProjectionsEditorCanvas::setContext(IntensityDataItem* intensityItem)
ASSERT(containerItem);
m_scene->setMaskContext(intensityItem, containerItem);
m_scene->setSelectionModel(containerItem->selectionModel());
// notify ProjectionPlot about the changes
connect(m_scene, &MaskGraphicsScene::lineItemProcessed, intensityItem,
......@@ -85,11 +86,6 @@ void ProjectionsEditorCanvas::resetContext()
m_scene->resetContext();
}
void ProjectionsEditorCanvas::setSelectionModel(QItemSelectionModel* model)
{
m_scene->setSelectionModel(model);
}
void ProjectionsEditorCanvas::onEnteringColorMap()
{
if (m_liveProjection || m_block_update)
......
......@@ -43,8 +43,6 @@ public:
void setContext(IntensityDataItem* intensityItem);
void resetContext();
void setSelectionModel(QItemSelectionModel* model);
signals:
void changeProjectionsTabRequest(MaskEditorFlags::Activity);
void changeActivityRequest(MaskEditorFlags::Activity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment