forked from qt-creator/qt-creator
Do not use the rootItemRect for zoom all
since this is set to null - indirectly from the showEvent of FormEditorWidget. Use the instanceBoundingRect of the rootNode instead. Fixes: QDS-3316 Change-Id: Ia156e5b675bc1c517c4b3f5c640b22d9c47bc117 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -210,7 +210,9 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
||||
auto frameAll = [this, zoomOut]() {
|
||||
if (m_graphicsView) {
|
||||
QRectF bounds;
|
||||
if (QmlItemNode(m_formEditorView->rootModelNode()).isFlowView()) {
|
||||
|
||||
QmlItemNode qmlItemNode(m_formEditorView->rootModelNode());
|
||||
if (qmlItemNode.isFlowView()) {
|
||||
for (QGraphicsItem *item : m_formEditorView->scene()->items()) {
|
||||
if (auto *fitem = FormEditorItem::fromQGraphicsItem(item)) {
|
||||
if (!fitem->qmlItemNode().modelNode().isRootNode()
|
||||
@@ -219,8 +221,9 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bounds = m_graphicsView->rootItemRect();
|
||||
bounds = qmlItemNode.instanceBoundingRect();
|
||||
}
|
||||
|
||||
m_graphicsView->frame(bounds);
|
||||
zoomOut();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user