summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu_p.h
diff options
context:
space:
mode:
authorDongmei Wang <dongmei.wang@qt.io>2017-02-01 20:43:00 -0800
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-04-14 17:06:00 +0000
commiteea585ad0bfb92947ae2d77f3bc6662121cec9a9 (patch)
tree471533f2c5d4ed26a6d450c0904c6d55dda1c85b /src/widgets/widgets/qmenu_p.h
parente1c8451ffeeaa82f29aa2519addfa377f678ed9e (diff)
QMenu: Fix margins related display issues
Currently the contents margins and the menu paddings are not considered for calculating the menu size, the positions and the size of tear-off bar, scrollers and the positions of the menu items when scrolling the menu, which results in the following problems when valid contents margins and/or menu paddings are set: - The tear off area is displayed in a wrong position. The mouse events are not handled correctly in the tear off area. For example, when you click in the tear off area, the menu should be torn off but nothing happens - For a multi-column menu, the menu width is not calculated correctly - For a scrollable menu, - the menu width is not calculated correctly - the menu items are not displayed in correct positions - the scrollers are not displayed in correct positions - menu items are displayed on the area of borders and margins when scrolling the menu - the last menu item is not displayed above the bottom of the content area when scrolling the menu to the end. The changes are to fix the problems above. Change-Id: I7931e1088dff0029f2d4825e2aa34b4e32fdccd9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmenu_p.h')
-rw-r--r--src/widgets/widgets/qmenu_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index 898fa3161b..a160a2c7d4 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -463,6 +463,7 @@ public:
void drawScroller(QPainter *painter, ScrollerTearOffItem::Type type, const QRect &rect);
void drawTearOff(QPainter *painter, const QRect &rect);
+ QRect rect() const;
};
#endif // QT_NO_MENU