summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2021-02-03 14:32:43 +0800
committerQt CI Bot <qt_ci_bot@qt-project.org>2021-03-03 11:40:28 +0000
commitb18a845befbd8fb38f78a279de07c4d21ac9460c (patch)
tree5186462dd1b0f8329e072f02e40efa25e0884301 /src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
parent6e0ce4ee8005d36ee5d080212b8d83b42ebcae17 (diff)
parentcc7911beb11d69f556f1b5d31d3c4c56b7503086 (diff)
Merge "fix: Print a warning message if the Xcb EGL initialize failed"
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index be26b2785e..9da290974b 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -225,7 +225,7 @@ void AnchorData::refreshSizeHints(const QLayoutStyleInfo *styleInfo)
if (anchorPrivate->hasSize) {
// Anchor has user-defined size
prefSizeHint = anchorPrivate->preferredSize;
- } else {
+ } else if (styleInfo) {
// Fetch size information from style
const Qt::Orientation orient = QGraphicsAnchorLayoutPrivate::edgeOrientation(from->m_edge);
qreal s = styleInfo->defaultSpacing(orient);
@@ -241,6 +241,8 @@ void AnchorData::refreshSizeHints(const QLayoutStyleInfo *styleInfo)
s = 0;
}
prefSizeHint = s;
+ } else {
+ prefSizeHint = 0;
}
}