summaryrefslogtreecommitdiff
path: root/src/controls/qquickmenupopupwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Controls: append "1" to all C++ classesMitch Curtis2016-03-181-16/+16
| | | | | | | | | | This is consistent with the classes that have already had this done. It prevents clashes with Qt Quick Controls 2. These classes are not available to the user, so it doesn't affect compatibility. Change-Id: Iee73ee6bc530182732ae95993e1f4fc3766eb8e0 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-161-0/+7
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/dialogs/qquickabstractfiledialog.cpp src/dialogs/qquickfiledialog.cpp Change-Id: I60aab7c7e819f82f82fc30f473b36a7a57d9a91a
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-251-0/+7
| |\ | | | | | | | | | Change-Id: I434c0d9c03200ff9ad0abc336c87ea52ea5abd67
| | * Fixed keyboard navigation in submenusFilippo Cucchetto2016-01-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug was due to a couple of factors interacting: 1) the QQuickMenu::__popupVisible property is not in sync with the popupWindow::visible property. In fact, the QQuickMenu::__popupVisible becomes true before the PopupWindow::Show() method is called. 2) In the Menu.qml file, the menu content item is created through the user of Loader, whose active property becomes true when the QQuickMenu::__popupVisible property is true. So the result is that the MenuContentItem is created before the QQuickPopupWindow is effectively visible. 3) Given point (2), the MenuContentItem requests focus on creation (since it has focus: true). However, given (1), the QQuickPopupWindow is neither visible nor active. This patch addresses this problem by forcing activeFocus to the menuContentItem only when the popupWindow gets focus. Task-number: QTBUG-41951 Change-Id: I095700726aab4ac45a62cd37b33a069e294df30e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | | Unify license header usageAntti Kokko2016-02-041-12/+15
|/ / | | | | | | | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I3c851bc24da89f6300b94199387d1adf16ca4f48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Suffix QQuickMenu, QQuickMenuBar & QQuickMenuItem with 1J-P Nurmi2015-12-161-3/+3
| | | | | | | | | | | | | | | | This avoids clashes between Qt Quick Controls and Qt Labs Controls. Change-Id: Ia1d367c271a3c80259d4f59be891c211ec061e01 Task-number: QTBUG-49794 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Moved menuBar function from QQuickMenuPopupWindow to QQuickmenuv5.6.0-beta1Filippo Cucchetto2015-12-071-15/+1
| | | | | | | | | | Change-Id: I6628ac2b8b07634afc1062488a12788a4e3f66c0 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Fixed missing close of the ComboBox when clicking on itFilippo Cucchetto2015-12-071-5/+9
|/ | | | | | | | | | The mouse event that dismissed a popup window should not dispatched to the visual item. Otherwise the menu open again. Task-number: QTBUG-44532 Change-Id: Id8aca1634e4f1795e546230953bff49518589714 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Protect the content item with a QPointer since we don't own it.Sergio Martins2015-07-151-2/+6
| | | | | | | Fixes a CI crash reproducible at least on Ubuntu Change-Id: I45a59054c20c3a99da30b79d33e24184bf328db9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Don't let popups cross screen boundaries.Sergio Martins2015-07-101-0/+3
| | | | | | | | | | | | | | | This was working on Qt 5.4.1 but got broken by de9145dcd90. Can't see nothing fundamentally wrong with that commit, problem was that the code to reposition the popup assumed the contentItem's hight or width would change every time and connected to hightChanged/widthChanged to trigger the repositioning. Since de9145dcd90 those signals are only emitted the first time the popup is shown. Call updateSize() explicitly. Task-number: QTBUG-47092 Change-Id: I303bfae80e5cb72e0c24e26365b8d0faa9ddf400 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-3/+12
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickmenupopupwindow_p.h Change-Id: Ic935bb56f5df70645eea30c890759f5980d68fe4
| * Menu: Separate dismiss and destroy actionsGabriel de Dietrich2015-03-271-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids issues when the action is triggered from a Menu and the slot ends up processing pending events, effectively deleting an object while one of its QML signal handlers is being executed. The reason being that we used to call deleteLater() on the menu popup window while still in the mouse event handler. Now, we do the same thing in three separate steps. 1. Close/dismiss the menu popups, 2. trigger the action, and 3. delete the popups. This keeps the menu popups and their contents alive until we return from the action triggered handler. We also need to take care of manually destroying any popup we may create. Finally, the menu content creation in Menu.qml had to be tweaked since we shouldn't rely on the popup visibility anymore. Task-number: QTBUG-45182 Change-Id: I9f1155bbf74dd3353c6c4066a24abf1cd2c3a283 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Don't show popup menu on two screens at the same time.Sergio Martins2015-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When using more than 1 monitor, snap to 1 monitor instead of crossing screen boundaries. That's how native implementations and QtWidgets do it. Task-number: QTBUG-45228 Change-Id: Icbeb9045a04ad4d4f81295603cbf1b81dcc44442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | MenuBar top level menus are not closed on click after being openedFilippo Cucchetto2015-04-141-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix revert partially what was done for resolving QTBUG-40391. Infact the change QTBUG-40391 caused the propagation of the events that caused the dismiss of a popupMenu. This in turn caused this bug where the click that should close menu is forwarded instead of being swallowed. However for supporting the behavior of context menu outside menubar we added some cases where the developer expect to receive the event that dismissed the popup. The use case is to reopen a dismissed popup on right click (see windows right click behavior on right clicks) Task-number: QTBUG-45315 Change-Id: If5a181b65ed9d879521ac20de577510908125169 Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Added QQuickMenu reference in QQuickMenuPopupWindowFilippo Cucchetto2015-04-131-2/+9
| | | | | | | | | | | | | | | | | | | | QQuickMenuPopupWindow has not direct reference to the QQuickMenu that created it. This is useful for navigating back from the popup to the QQuickMenu Change-Id: I6b11641ef90c423df9961277bb3e89573d1ed0e0 Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devJ-P Nurmi2015-02-121-1/+1
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/controls/TableView.qml tests/auto/controls/data/tst_gridlayout.qml Change-Id: I030bc50dc8fcf7b6b00e183dc3a67c3cd012f3fb
| * Use all, not just available geometry in menu popupLaszlo Agocs2015-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A menu popup may be positioned partly or fully outside of the available geometry. For example if a Windows side bar (appbar) is opening such a popup, it will be completely outside of the available geometry (rcWork from MONITORINFOEX) since such sidebars are not part of that. Instead, use the regular, full geometry. Task-number: QTBUG-43693 Change-Id: Ibd22150cb7ec94a46df2facbfc1bf5f20bda51e5 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Controls: update license headersJ-P Nurmi2015-02-111-15/+18
|/ | | | | | | Change-Id: I77e7a218a958d76ac7ef7780f4be52a81f76fa6b Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QQuickRenderControl is now in public headersv5.4.0-beta1Oleg Shparber2014-10-111-1/+1
| | | | | Change-Id: I57d8ecd771eac00cc68de0ec5afa07706fee3671 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4J-P Nurmi2014-09-181-2/+11
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickmenupopupwindow.cpp Change-Id: Ibc10e7da3b3a2983c022b8973cd80cb1a7e110af
| * Fix menu popups positioning with window containersv5.3.25.3.2Laszlo Agocs2014-09-101-2/+9
| | | | | | | | | | | | | | Task-number: QTBUG-40883 Change-Id: I5c46c049b5890259d65f325adb59e15ebf29f84a Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix wrong menu popup window parentingLaszlo Agocs2014-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | When embedded into a widget-based UI in a window container, extra care is needed to find the correct top-level because the QQuickWindow is not it. Task-number: QTBUG-40883 Change-Id: I8d5a91f23c405e14b0994f08aa74581742f6482b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Update license headers and add new license filesAntti Kokko2014-08-251-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I470909ba0980db33ab551790d619c59a35978590 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-3/+2
|\ \ | |/ | | | | Change-Id: I9253c87c3bd54204401070f492c7590166be0fe3
| * QQuickPopupWindow: Use actual item size as content sizeGabriel de Dietrich2014-07-291-3/+2
| | | | | | | | | | | | | | | | | | Using the children rect size was a mistake, particularly when using Instantator in a Menu. Task-number: QTBUG-40221 Change-Id: I6efe9aad617a7b0adbea0bb96bf843c5c1779131 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | OS X: fix positioning of non-native menu popupsJ-P Nurmi2014-07-291-8/+8
|/ | | | | Change-Id: Iafc7f3a1a41093628e3cba8dd2a7781c2b82b021 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Use the correct parent window for menu popupsLaszlo Agocs2014-07-011-7/+8
| | | | | | | | | The previous fix applied only to the non-platform menu case and was broken on OS X at least, when having a combobox in a QQuickWidget. Task-number: QTBUG-39908 Change-Id: I5dde103c2fe33d52a312cc80b36b47b13e72a188 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Correct positioning for popups in QQuickWidgetPaul Olav Tvete2014-04-251-2/+5
| | | | | | | | | | Handle the case where the QQuickWindow is hidden and the content is rendered somewhere else using QQuickRenderControl. Task-number: QTBUG-38116 Change-Id: I51fb9001c307f53bf7d724860b2a66287982724e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Popup Window: Privately expose popup geometryGabriel de Dietrich2014-03-071-0/+1
| | | | | Change-Id: I28a8edd657f02cecbd0c31965bd4085429cf4537 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Menu: Extract QQuickMenuPopupWindow core popup behaviorGabriel de Dietrich2013-10-181-151/+17
| | | | | | | ... and put it in QQuickPopupWindow. Change-Id: I6920f5c13904483310faae990c7199db9f1c4708 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* ComboBox: Make popup scrollableGabriel de Dietrich2013-09-191-3/+7
| | | | | | | | | | | | | | | | We factor out part the menu item container logic from Menu into ColumnMenuContent, which takes care of scrolling and mouse hovering, and selection. This makes possible to extend the menu items layout. The pop-over and pull-down look is specified by the menu style component by overriding the ScrollView style. The popup's maximum height is also specified by the menu style. The gallery example can finally use a font families combo box. Task-number: QTBUG-31568 Change-Id: I34a7278f476471c0eb51ef51dde3dd83e13002fe Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* ComboBox: Fix selected item alignmentGabriel de Dietrich2013-09-191-0/+1
| | | | | | | | We seem to receive a size change later that we used to, and this exposed a bug were the popup would always be aligned on the first item. Change-Id: I7b7b4ca5fcff969c3b492419cab7447170a2c3f5 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Merge branch 'stable' into devGabriel de Dietrich2013-09-181-2/+26
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickaction.cpp Change-Id: I85255ba5c27c0d8ea023d0867e5963d43f8f1ddb
| * Menu: Fix keyboard navigation on WindowsGabriel de Dietrich2013-09-121-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Windows QPA plugin doesn't trigger activated window events for popups, resulting on the popup window not being the application focus window, and therefore, the popup window's content item not getting focus. This results in key pressed events not being sent to the menu item. We workaround this by emitting the window activated event ourselves right after the popup window is exposed. Task-number: QTBUG-33175 Change-Id: I77d1eb33b71af2232a6be6d0f7c6b480bffc10d4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Menus: add RTL supportJ-P Nurmi2013-08-131-1/+7
|/ | | | | | Change-Id: I60f997e545076feb5b72fb9eb4a03b050db5f511 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Menu: Support QQuickWindows embedded in QWidgetsGabriel de Dietrich2013-06-141-2/+10
| | | | | | | | | | | | We translate the menu popup window by its transient parent origin coordinates, but if it's embedded in a QWidget, we would only translate by the transient parent's origin inside that QWidget. So, in this case. we translate by the transient parent's origin in the global coordinate reference system. Task-number: QTBUG-31659 Change-Id: I09aa64f2d61d227d4fcd6d6e22a25453e1f2dc76 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Rename QtMenuXxx to QQuickMenuXxxJ-P Nurmi2013-04-151-0/+230
Change-Id: I89aa205686f0bdf2b267ad17a8ae0470c2f4751f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>