Skip to content
Snippets Groups Projects
Commit d411db8e authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[j.mask132b] minor cleanup, projections are segfaulting anyway ()

Merging branch 'j.mask132b'  into 'main'.

See merge request !2273
parents 9175feb9 3b0e17b6
No related branches found
No related tags found
1 merge request!2273minor cleanup, projections are segfaulting anyway
Pipeline #125460 passed
...@@ -53,7 +53,6 @@ template <class T> bool areaContains(QList<QGraphicsItem*> items) ...@@ -53,7 +53,6 @@ template <class T> bool areaContains(QList<QGraphicsItem*> items)
return false; return false;
} }
} // namespace } // namespace
...@@ -62,7 +61,6 @@ MaskGraphicsScene::MaskGraphicsScene() ...@@ -62,7 +61,6 @@ MaskGraphicsScene::MaskGraphicsScene()
, m_drawing_in_progress(false) , m_drawing_in_progress(false)
, m_mask_value(MaskFlags::MASK_ON) , m_mask_value(MaskFlags::MASK_ON)
{ {
setSceneRect(0, 0, 800, 600);
connect(this, &QGraphicsScene::selectionChanged, [this] { onSceneSelectionChanged(); }); connect(this, &QGraphicsScene::selectionChanged, [this] { onSceneSelectionChanged(); });
} }
...@@ -116,12 +114,10 @@ void MaskGraphicsScene::dissociateItems() ...@@ -116,12 +114,10 @@ void MaskGraphicsScene::dissociateItems()
void MaskGraphicsScene::updateSize(const QSize& newSize) void MaskGraphicsScene::updateSize(const QSize& newSize)
{ {
for (QGraphicsItem* graphicsItem : items()) { if (m_proxy) {
if (auto* proxy = dynamic_cast<MaskGraphicsProxy*>(graphicsItem)) { m_proxy->resize(newSize);
proxy->resize(newSize); setSceneRect(0, 0, newSize.width(), newSize.height());
setSceneRect(0, 0, newSize.width(), newSize.height()); m_proxy->setPos(0, 0);
proxy->setPos(0, 0);
}
} }
} }
...@@ -387,12 +383,14 @@ void MaskGraphicsScene::updateProxyWidget() ...@@ -387,12 +383,14 @@ void MaskGraphicsScene::updateProxyWidget()
if (m_proxy) if (m_proxy)
return; return;
m_proxy = new MaskGraphicsProxy; // TODO: check if m_proxy is released at the end
m_proxy->setParent(this);
m_plot = new ColorMap; // TODO: potential memory leak m_plot = new ColorMap; // TODO: potential memory leak
m_plot->itemToMap(m_data_item); m_plot->itemToMap(m_data_item);
m_proxy = new MaskGraphicsProxy; // TODO: check if m_proxy is released at the end
m_proxy->setParent(this);
if (m_proxy->widget() != m_plot) if (m_proxy->widget() != m_plot)
m_proxy->setWidget(m_plot); m_proxy->setWidget(m_plot);
addItem(m_proxy); addItem(m_proxy);
} }
......
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