diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-12-05 09:33:50 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-23 16:46:51 +0100 |
commit | a78d66743171557d79b16c08be775e3ac15bb4ef (patch) | |
tree | 5dfb8ef0668847dfe90f396ee2c0dda1e227ca56 /src/gui/painting/qpagelayout.cpp | |
parent | ef14e775de9932fecea5443b976b950c311ba938 (diff) |
Fix positioning of dynamically populated QToolButton::MenuButtonPopup's in screen corners
The existing code positioning the menu in
QToolButtonPrivate::popupTimerDone() had a clause checking
whether any receivers were connnected to QMenu::aboutToShow()
causing the sizeHint to be -1,-1 in that case (apparently
trying to accommodate menus populated in slots). In that
case, the checking for screen borders would not work, causing
the similar checks in QMenu::popup() to trigger, potentially
positioning the menu over the mouse.
To solve this dilemma, add a parameter taking a std::function
calulating the position of the menu from the sizeHint to
QMenuPrivate::exec()/popup() and invoke that in QMenuPrivate::popup()
after emitting QMenu::aboutToShow() when the sizeHint is known.
Fixes: QTBUG-78966
Change-Id: I180bd2dc7eadcaca6cadca13745ed4a2dd89e412
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/painting/qpagelayout.cpp')
0 files changed, 0 insertions, 0 deletions