Skip to content

Commit

Permalink
Postpone relayouting during deserializing
Browse files Browse the repository at this point in the history
During deserializing we're layouting all stuff.
It can happen that a QWidget's min-size changes
for whatever weird reason, and messes up our math.

It's fine that min-size changes, but do it before
layouting.
  • Loading branch information
iamsergio committed Apr 30, 2024
1 parent c25ea6f commit eb4304f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qtwidgets/views/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class VBoxLayout : public QVBoxLayout // clazy:exclude=missing-qobject-macro

if (auto item = m_groupWidget->group()->layoutItem()) {
if (auto root = item->root()) {
if (root->inSetSize()) {
if (root->inSetSize() || root->isDeserializing()) {
// There's at least one item currently in the middle of a resize
// schedule relayout, do not interrupt.
QTimer::singleShot(0, m_groupWidget, [this] {
Expand Down

0 comments on commit eb4304f

Please sign in to comment.