forked from qt-creator/qt-creator
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:
@@ -548,6 +548,9 @@ void FormEditorWidget::exportAsImage(const QRectF &boundingRect)
|
|||||||
|
|
||||||
QImage FormEditorWidget::takeFormEditorScreenshot()
|
QImage FormEditorWidget::takeFormEditorScreenshot()
|
||||||
{
|
{
|
||||||
|
if (!m_formEditorView->scene()->rootFormEditorItem())
|
||||||
|
return {};
|
||||||
|
|
||||||
const QRectF boundingRect = m_formEditorView->scene()->rootFormEditorItem()->boundingRect();
|
const QRectF boundingRect = m_formEditorView->scene()->rootFormEditorItem()->boundingRect();
|
||||||
|
|
||||||
m_formEditorView->scene()->manipulatorLayerItem()->setVisible(false);
|
m_formEditorView->scene()->manipulatorLayerItem()->setVisible(false);
|
||||||
|
Reference in New Issue
Block a user