diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-29 13:15:26 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-29 13:38:44 (GMT) |
commit | a9c225e6b464337d253e6b9aa5eaac82d01b3301 (patch) | |
tree | f93a6c05df4eeae6a078ad06a7c6527a2a545c6a /src | |
parent | 5f027e8e5e430abf54eea4a020ead8ed95e3a211 (diff) | |
download | Qt-a9c225e6b464337d253e6b9aa5eaac82d01b3301.zip Qt-a9c225e6b464337d253e6b9aa5eaac82d01b3301.tar.gz Qt-a9c225e6b464337d253e6b9aa5eaac82d01b3301.tar.bz2 |
QMenu: adding autotest for the geometry calculations
I also fixed an off-by-1 pixel bug
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 1fd6816..0aa584f 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1704,10 +1704,10 @@ QSize QMenu::sizeHint() const const QRect &rect = d->actionRects.at(i); if (rect.isNull()) continue; - if (rect.bottom() > s.height()) - s.setHeight(rect.y()+rect.height()); - if (rect.right() > s.width()) - s.setWidth(rect.right()); + if (rect.bottom() >= s.height()) + s.setHeight(rect.y() + rect.height()); + if (rect.right() >= s.width()) + s.setWidth(rect.x() + rect.width()); } if (d->tearoff) s.rheight() += style()->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, this); |