summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-231-54/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| * QMenu: Refactor insertion of action in QPA menuGabriel de Dietrich2017-11-151-54/+54
| | | | | | | | | | | | | | | | | | First, remove a bit of code duplication around the creation of the platform menu item. Then, we move copyActionToPlatformItem() inside QMenuPrivate to get rid of one parameter. Change-Id: I5a33103566367f2313930479844365e79773d82f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QMenu: Update menu action sizes if popup is (not)caused from menu barBłażej Szczygieł2017-11-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Menu width differs if it contains key shortcuts or not. Amends 6634c424f8ca0e3aed2898507d5f9f4b774c4602 Task-number: QTBUG-49435 Task-number: QTBUG-61181 Task-number: QTBUG-64449 Change-Id: I8c479af550128069ca91dd089dfc7bd8c24c66ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Remove a few more uses of deprecated QDesktopWidget APIsTor Arne Vestbø2017-11-171-2/+1
| | | | | | | | | | | | Change-Id: I3834ba7ce8f9bd7026f3d59f15d268b4c03e364a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-261-21/+40
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-4/+19
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| | * Convert features.menu to QT_[REQUIRE_]CONFIGStephan Binner2017-09-191-4/+0
| | | | | | | | | | | | | | | Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * QMenu: Fix size on high DPI + multi screenThorbjørn Lund Martsum2017-09-131-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating item sizes (used for menu size) the styles consider the widget screen. This widget screen could be a wrong default or an obsolete value. This patch ensures the screen is correct set on popup. [ChangeLog][QtWidgets][QMenu] Fixed menu size issue when using high DPI on multi-screen system. Task-number: QTBUG-59794 Change-Id: I84461441d5d33cb8dc04ab1acb9630fbfc8c5514 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Per Liboriussen <liborius@chelys.dk> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-18/+22
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| | * Convert features.effects to QT_[REQUIRE_]CONFIGStephan Binner2017-09-041-5/+7
| | | | | | | | | | | | | | | Change-Id: I8421b5e81dc21e8f9f6bdd9f714fb3f535618a3c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.menubar to QT_[REQUIRE_]CONFIGStephan Binner2017-09-041-13/+15
| | | | | | | | | | | | | | | Change-Id: Idbd4978852fa280dd18a5684469d499da3892126 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-10/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * QMenu: Prevent torn-off menus from extending behind the taskbarGabriel de Dietrich2017-08-161-10/+12
| | | | | | | | | | | | | | | | | | | | On Windows and macOS, that area of the menu can become inaccessible if the menu is tall enough. Since these are not popups but tool windows, the test for UseFullScreenForPopupMenu should not apply for torn-off menus. Change-Id: Ife7836bef568896a5bb67d42a2af412f06a871d6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Reduce usage of QDesktopWidget to resolve screen properties in QtWidgetsTor Arne Vestbø2017-08-181-7/+8
| | | | | | | | | | | | | | | | | | | | | | Removes the need to initialize QDesktopWidget, just to look up which screen a widget would map to, the geometry of a screen, number of screens, etc. Change-Id: Ieb153b9ff6d3fba645fc528d6e430e8392f990bf Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-2/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
| * Convert features.graphicsview to QT_[REQUIRE_]CONFIGStephan Binner2017-08-151-2/+2
| | | | | | | | | | Change-Id: I1083097802772624e5d414678b4612308683a56f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.toolbutton to QT_[REQUIRE_]CONFIGStephan Binner2017-08-101-0/+2
| | | | | | | | | | Change-Id: I4227e1868da21bded76a8ec55996c436c8a8d763 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Fix typoFrederik Gladhorn2017-08-051-2/+2
| | | | | | | | | | Change-Id: Ie82c0996a7b1112fe6d6d259d765737fc3fb6a22 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | widgets: remove redundant check in QMenu::popupGatis Paeglis2017-07-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if (A) doA() else if (B) doB() if (B) doB() is equal to: if (A) doA() if (B) doB() when doB() is a self-contained basic operation like QRect::setY(int ay) with { y1 = ay; } as body. Change-Id: I3421493fe47459bd9b3d4cb5f4cfdd30ce566003 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-10/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * Convert features.statustip to QT_CONFIGStephan Binner2017-06-291-1/+1
| | | | | | | | | | Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.whatsthis to QT_[REQUIRE_]CONFIGStephan Binner2017-06-291-8/+8
| | | | | | | | | | | | | | Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-281-1/+1
| | | | | | | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Restrict QStyleHints::showShortcutsInContextMenus() to context menusFriedemann Kleint2017-06-261-2/+8
| | | | | | | | | | | | | | | | | | | | Amends c2c3452ba5b4c32d0c2d5df9193bf89986623ab5. Task-number: QTBUG-49435 Task-number: QTBUG-61181 Change-Id: I4de9dcb45a86fc2db07185a4a499a511fb1a1567 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-8/+2
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * Doc: Remove references to screenshots illustrating different stylesLeena Miettinen2017-06-011-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... from widget class descriptions. Use one screenshot from Windows instead. The styles change and the screenshots become outdated very fast, so it is easier to update just one screenshot now and then. The styles can still be seen in the style gallery topics. The image files will be removed in a follow-up commit after all references to them have been removed. Change-Id: Id326c141f4884a2e4f67a4fe8681d8c65f8b24ba Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-071-16/+30
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * QMenu: Ensure popup() gets the right screen geometryGabriel de Dietrich2017-05-041-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many QMenu related functions end up calling sizeHint() which does call updateActionRects(). Since we try not to update the action rects if no action has changed, we must be careful to call it the first time with the right screen geometry. Other- wise, multi-display setups may get the action rects based on the wrong display. In QMenu::popup(), this can be solved by using the position passed as argument. Incidentally, we were already computing the right display geometry in the same function, only a bit later. The updated position around an eventual push button menu should not change the screen onto which the menu popup will be displayed. Tested with the multiscreen-menus manual test. Change-Id: Id7fc24be6908b4a9d24b8b9c8b8006efe45d69be Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QMenu: Refactor column layout logicGabriel de Dietrich2017-05-031-5/+3
| | | | | | | | | | Change-Id: I30f1c87092447abf1c94e69c0124eeeee43666e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix build without features.style-stylesheetTasuku Suzuki2017-04-281-1/+1
| | | | | | | | | | | | Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * QMenu: Display the menu title on the torn-off menu's title barGabriel de Dietrich2017-04-261-1/+15
| | | | | | | | | | | | Change-Id: If16e262a6c8b39dff517cc105cf55686d4c22582 Task-number: QTBUG-11693 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-201-33/+110
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
| * Fix build for -no-feature-cssparserStephan Binner2017-04-191-0/+2
| | | | | | | | | | Change-Id: I78b66e8a98458736c69c4955390a98f8889968ea Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-181-3/+7
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
| | * QtWidgets: Don't open submenus when mouse is moving between actionsBłażej Szczygieł2017-04-121-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't set the current action during closing submenu when mouse moved more than one action in the menu to the top or to the bottom. Task-number: QTBUG-53215 Change-Id: I2383363bc48f644df046198662dfa4d080fe3f1d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | QMenu: Fix torn-off menu display crash issueDongmei Wang2017-04-141-9/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When tearing off either a non-scrollable multi-colume menu or a scrollable menu, displaying the torn-off menu crashes. The root cause is when the torn-off menu is created, the tear-off menu's style, margins and other attributes are not set to it. The patch is to ensure the torn-off menu has the same attributes as the tear-off menu does and set the torn-off menu with a correct menu size. Task-number: QTBUG-24815 Change-Id: Icea45f149ea8792671af4a62e62cad6ee01a1f95 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * | QMenu: Fix margins related display issuesDongmei Wang2017-04-141-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Reset d->mouseDown only if it's the menu being hiddenMarco Martin2017-04-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the mouse cursor is over a menu entry with a submenu, and the submenu is open, quickly moving the mouse to a near menu entry and clicking it sometimes results in the click being eaten: this happens when the mouse is pressed before the submenu disappears and released after it disappeared: the submenu resets d->mouseDown that is a static, causing the mouse release event on the action we want to have no effect. Set d->mouseDown to 0 only when the window is hiding is the actual window that contains the mouseDown, otherwise is still valid. Change-Id: I2c981b9432728e9e7518c30a146c9595199f8afe Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Remove the Windows XP style from public accessibilityJake Petroules2017-04-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Later, the Windows XP style will be removed entirely by means of being merged with the Windows Vista style (which inherits from the XP style). There was actually no reason for these styles being separate classes in the first place, because both result in the same appearance for controls on the running version of Windows. Therefore, the windowsxp style merely appears as a "broken" version of the windowsvista style, with only minor differences based on the additional metrics that the vista style provides. The windowsxp style does NOT, and never did, allow users to get a Windows XP style appearance on Windows 7 and above (which is currently Qt's minimum supported platform). Therefore, now that Qt no longer supports Windows XP, the windowsxp style is unusable. [ChangeLog][QtWidgets] The windowsxp style is no longer available as a separate style, because it did not (and cannot) actually provide an XP-style appearance on currently supported Qt platforms. Change-Id: I513d9bce3f247f97cfb28dfee88fe888469e0a6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-071-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
| * | QMenu: Do not unnecessarily call QPlatformMenu::menuItemForTag()Friedemann Kleint2017-04-031-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | When handling QActionEvent / ActionAdded, QActionEvent::before() is 0 for the common 'append' case. Do not try to find a QPlatformMenuItem for this. Change-Id: I535b675fda6a2812b61eb8d7eec01da378ece413 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-201-31/+29
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
| * QMenu: make wide submenu appear on the same screen with its parent menuOleg Yadrov2017-03-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | On a multi-display system wide submenu might either appear on wrong screen or not appear at all (depending on the specific display configuration). Task-number: QTBUG-56917 Change-Id: I40013b0bee340a01ae1c08a5e074afa63da4dbfd Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
| * Wide QMenu: fix size and positionOleg Yadrov2017-03-041-29/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes 2 issues related to wide menus: 1) Menu took on full screen height when menu width was larger than screen width; 2) On a multi-display system wide menu might appear on wrong monitor (not the one where show event was triggered). The idea is we limit parent menu and all its submenus within the screen where it was opened. Note that this patch fixes only geometry-related issues and there are also some style flaws which need to be addressed (for example, currently the text does not elide if it doesn’t fit to the menu’s width). Task-number: QTBUG-56917 Change-Id: I7e9ff4a48bf03060d76e34d33a13ad6cc890c133 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Add new API to control whether shortcuts are shown in context menusJake Petroules2017-03-141-2/+3
|/ | | | | | | | | | | | | Shortcuts are universally not shown on macOS or mobile platforms, making applications look very obviously out of place. Windows and GNOME desktop environments almost never use them. Only KDE appears to do so commonly; default accordingly. Task-number: QTBUG-49435 Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Replace non-existent signals with the correct onesKavindra Palaraja2017-01-101-1/+1
| | | | | | | | activated() is actually triggered(), highlighted() is actually hovered() Task-number: QTBUG-50315 Change-Id: Ieefdc8376102d80d0885a6c7ca47a9380945afef Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Paint menu scrollers, tear off on top of QWidgetAction itemsDongmei Wang2016-10-271-29/+110
| | | | | | | | | | | | | | The menu scrollers and the tear off items are painted in the layer of QMenu. In a case that QMenu contains QWidgetAction items, the items are painted under QWidgetAction items. They are visually hidden unless QWidgetAction items' background is transparent. The tear off doesn't work since QWidgetAction item on top of it grabs mouse events. To fix the issue, add two child widgets in QMenu, paint the scroll up and the tear off items in one child widget and the scroll down item in the other one. Both child widgets are painted on top of overlapping sibling menu item widgets. Change-Id: I7eaef21b667b388fbb78b60664f4a4bd91215309 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Don't overlap the menu scrollers with QAction itemsDongmei Wang2016-10-271-27/+62
| | | | | | | | | The QAction items overlap with the menu scrollers. The patch is to set correct clip regions for QAction items in order not to overlap with the scroll arrows. Change-Id: Ie724bd2be522daf5935fb489523b5d5f32bb7f71 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>