Fix a crash.
If call a visualization and then close the window Valentina will crash. --HG-- branch : release
This commit is contained in:
parent
b63922fa9e
commit
fdd3e9a70c
|
@ -1913,6 +1913,7 @@ void MainWindow::CancelTool()
|
||||||
|
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
|
ui->view->itemClicked(nullptr); // Hide visualization to avoid a crash
|
||||||
|
|
||||||
switch ( currentTool )
|
switch ( currentTool )
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,7 +187,7 @@ inline void VAbstractTool::AddVisualization()
|
||||||
connect(scene, &VMainGraphicsScene::NewFactor, visual, &Visualization::SetFactor);
|
connect(scene, &VMainGraphicsScene::NewFactor, visual, &Visualization::SetFactor);
|
||||||
scene->addItem(visual);
|
scene->addItem(visual);
|
||||||
|
|
||||||
connect(visual, &Visualization::ToolTip, RECEIVER(this)[this] (const QString &toolTip) {emit ToolTip(toolTip);});
|
connect(visual, &Visualization::ToolTip, this, &VAbstractTool::ToolTip);
|
||||||
vis = visual;
|
vis = visual;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user