QmlDesigner: Fix crash when taking 2D view screenshot

If 2D view was hidden, taking screenshot crashed.

Fixes: QDS-10657
Change-Id: I96fe7a37793a902d517ad891fd7fe1914e681c30
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Miikka Heikkinen
2023-09-12 16:00:07 +03:00
parent f979ca36dd
commit 336912cf2f

View File

@@ -548,6 +548,9 @@ void FormEditorWidget::exportAsImage(const QRectF &boundingRect)
QImage FormEditorWidget::takeFormEditorScreenshot()
{
if (!m_formEditorView->scene()->rootFormEditorItem())
return {};
const QRectF boundingRect = m_formEditorView->scene()->rootFormEditorItem()->boundingRect();
m_formEditorView->scene()->manipulatorLayerItem()->setVisible(false);