diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-11-19 16:23:51 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-04 06:33:03 +0100 |
commit | 8e9d78e43ef6dd7a6fc3be8874fc518db8537c91 (patch) | |
tree | 27a6173f225cf9049340e8ea6580918506191d09 /src/widgets/widgets/qmenubar.cpp | |
parent | 9fb4c2c412621b63c06dbbd899f44041b2e126c2 (diff) |
QMenuBar: fix extra indent on the right with a TopLeftCorner widget.
When setting a left corner widget on a QMenuBar, the first
action rectangle is offset by its width and thus the width
should not be added to the size hint. Use QSize::expandedTo()
instead.
Task-number: QTBUG-36010
Change-Id: I660e3facbd0aeb5fb84fac8923db3e0c7998309d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qmenubar.cpp')
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 871af35159..619cb64636 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -1631,9 +1631,8 @@ QSize QMenuBar::sizeHint() const int margin = 2*vmargin + 2*fw + spaceBelowMenuBar; if(d->leftWidget) { QSize sz = d->leftWidget->sizeHint(); - ret.setWidth(ret.width() + sz.width()); - if(sz.height() + margin > ret.height()) - ret.setHeight(sz.height() + margin); + sz.rheight() += margin; + ret.expandedTo(sz); } if(d->rightWidget) { QSize sz = d->rightWidget->sizeHint(); |