Split setting implicit size into setting width and height separately, so
that we if we use width() it will use the implicit width if no width was
set yet. This avoids us hiding all actions because width is 0, only to
then show them again because implicit width (and thus width) is now a
valid value.
Gbp-Pq: Name upstream_81352c22_layout-Set-implicit-width-of-ToolBarLayout-before-using-its-width.patch
visibleActionsWidth = 0.0;
+ q->setImplicitWidth(maxWidth);
+
if (maxWidth > q->width() - (hiddenActions.isEmpty() ? 0.0 : moreButtonInstance->width() + spacing)) {
// We have more items than fit into the view, so start hiding some.
maxHeight = std::max(maxHeight, moreButtonInstance->implicitHeight());
};
- q->setImplicitSize(maxWidth, maxHeight);
+ q->setImplicitHeight(maxHeight);
+
Q_EMIT q->hiddenActionsChanged();
implicitSizeValid = true;