aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickpopup.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-1851/+0
| | | | | Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickPopup: Deduplicate the code a bitKonstantin Ritt2016-04-101-8/+2
| | | | | Change-Id: Ie6fea8d57886ba2c6ed3b3016cd6402f86395f34 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: Rename Qt Labs Controls to Qt Quick Controls 2Nico Vertriest2016-04-071-1/+1
| | | | | | | | Replaced all remaining instances of "Qt Labs Controls" Change-Id: Iab8ca27d98a16a7c99bd364c66efc8b98d93eacc Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* Inherit QQuickDrawer from QQuickPopupJ-P Nurmi2016-03-231-1/+1
| | | | | | Change-Id: Icf71270e63aedd93ba975ab9743de68c3a54e849 Task-number: QTBUG-51007 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-221-4/+16
|\ | | | | | | | | | | | | Conflicts: src/templates/qquickpopup.cpp Change-Id: Idb43ff6aff692d01e9bc03450a474bf18a7e41fa
| * Fix QQuickPopupPositionerJ-P Nurmi2016-03-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | tst_tooltip revealed a bug that QQuickPopupPositioner wasn't cleaning up its ancestor listeners properly. When QQuickPopup was destructed, it left a listener on the window root item. When the root item got later destructed, it tried to call a listener (the popup) that was already deleted. Change-Id: If041458da24be927f0bad19b9549dcabd1931977 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
| * Popup: fix marginsJ-P Nurmi2016-03-211-1/+13
| | | | | | | | | | | | Change-Id: I09f974a00a5a2a8f14645ff5d9bfbd6bad03d324 Task-number: QTBUG-51990 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Fix QQuickPopup::setVisible()J-P Nurmi2016-03-211-4/+11
| | | | | | | | | | | | | | | | | | | | Make sure to store the visibility flag even if the component is not yet completed. This way QQuickPopup::componentComplete() will run the enter transition as it was supposed. Change-Id: I1e4536e2fdb575b80174ae445626af43bdc45ed6 Task-number: QTBUG-51989 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Popup: make ApplicationWindow attached properties availableJ-P Nurmi2016-03-211-0/+6
| | | | | | | | | | | | Change-Id: Idde9fb49c222abc1ceabd15256695fd1961a9f76 Task-number: QTBUG-51991 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Change the default value of QQuickPopup::closePolicyJ-P Nurmi2016-03-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Popup::ClosePolicy was introduced, I thought that it would be better to not set OnPressOutside by default, because not all popups necessarily want to close on press outside. However, I've realized that every time I do Button { onClicked: popup.open() Popup { } } ...there's literally no interactive way to close the popup (popups don't take focus by default, so Esc doesn't work). Provided that a top-level QWidget with the Qt::Popup flag set also closes automatically on press outside, it probably makes more sense for us to follow the same pattern so that poor new users don't have to lookup the docs just to figure out how to make a popup close. :) In this case it's less troublesome to specify a different default value in those special scenarios/subclasses where closing on press outside is not desired (eg. the upcoming Popup-based Drawer). Change-Id: Iaeab4c548d63728df12232d8b65d469f0a2d80f5 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add Popup::localeJ-P Nurmi2016-03-181-2/+45
| | | | | | | | | | | | Change-Id: I1f07318f3e018debd74e41bc0a1443c45def7bf3 Task-number: QTBUG-50984 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add Popup::fontJ-P Nurmi2016-03-181-0/+58
| | | | | | | | | | | | Change-Id: I66feeb597e9f4a6176d6462640b3e26823a3d761 Task-number: QTBUG-50984 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Rename Qt Labs Controls to Qt Quick Controls 2 - doc asset filenamesMitch Curtis2016-03-181-1/+1
| | | | | | | | | | | | | | | | | | This renames all documentation assets (snippets, images), but leaves .qdoc files and the .qdocconf file in an attempt to avoid conflicts with controls 1. Change-Id: I08692233e8d645de8d9746fe74edc14d31bb744e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-181-2/+0
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp src/controls/qquickstyleattached_p.h src/imports/controls/material/qquickmaterialstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickpopup.cpp Change-Id: I17c3c4d1040b89838f0903e0a17069b835895199
| * Change locale inheritance for popupsJ-P Nurmi2016-03-171-2/+0
| | | | | | | | | | | | | | | | | | | | The last one in the series of making Popup inherit its properties from the parent window instead of the parent item. The same change was done for font and style already. Change-Id: I7024cce13f501e92024e9110e87ed33bbae6533d Task-number: QTBUG-50984 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-161-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickcontrol_p.h src/templates/qquickpopup.cpp tests/auto/controls/data/tst_combobox.qml tests/auto/controls/data/tst_control.qml Change-Id: Ib7853d5ee5c4444872cd5c2d789e20d229c955d1
| * Fix popup fontsJ-P Nurmi2016-03-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | This is a partial revert of a405919. This change makes popups inherit the window font instead of the parent item font. Change-Id: Ie360e3831aadbd167859e17d381edf3a28945300 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * QQuickPopup: fix possible referencing of a destroyed parent itemJ-P Nurmi2016-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | The internal popup positioner is already listening for itemDestroyed() of the parent item, so it may as well reset the parent item pointer of the popup to avoid having the popup referencing a destroyed parent in complex tooltip auto test cases coming up in 5.7. Change-Id: I463403e528c33285ea7d51b68d0f5020a239e98e Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
| * Fix QQuickPopupItemPrivate::implicitWidthChanged()J-P Nurmi2016-03-101-1/+1
| | | | | | | | | | Change-Id: Ib822b57da21b338c7b11cae115f1bb6a178d7328 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | QQuickPopup: fix tab navigationJ-P Nurmi2016-03-091-0/+3
| | | | | | | | | | | | | | Required for and tested by the next commit. Change-Id: I1cd4f14e3b891fafa3de7389a570bc6e53560416 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | QQuickPopupPositioner: add missing null checkJ-P Nurmi2016-03-091-1/+1
| | | | | | | | | | | | | | Don't attempt to reposition a parentless popup. Change-Id: I46c6bdcad02af1859050efed66792c98335478bd Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add QQuickPopup::setPosition() - C++ only APIJ-P Nurmi2016-03-091-0/+24
| | | | | | | | | | | | | | This allows QQuickToolTip to initialize the position in one go. Change-Id: I240a104f9a0f71549ab05be5fe097ca59bfed806 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add QQuickPopup::itemChange()J-P Nurmi2016-03-091-10/+17
| | | | | | | | | | | | | | | | | | QQuickToolTip wants to hide itself after a configurable timeout. It can override this method and catch ItemVisibleHasChanged in order to implement the timeout functionality. Change-Id: I0ec1593e8c36bf5635507ab65f338901035d5055 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-041-1/+1
|\| | | | | | | | | | | | | Conflicts: src/templates/qquickpopup.cpp Change-Id: Ic5cdde7a2d9daa0e616de999969a4399db23245b
| * Fix QQuickPopup::setParentItem()J-P Nurmi2016-03-021-1/+1
| | | | | | | | | | | | | | | | Don't call naturalControlFont() or calcLocale() with a null pointer, because it will crash. Change-Id: Ib4b6dba85e6c55832c30b5178b74ebf39429a5f8 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | QQuickPopup: allow subclasses to prepare/finalize transitionsJ-P Nurmi2016-03-021-39/+62
| | | | | | | | | | | | | | | | | | | | This allows QQuickDrawer prepare the transitions so that "position" is is set as the default target property, and finalize the transtitions so that the drawer remains visible on the window edge, and will be able to handle overlay events. Change-Id: I0afedb3d10c37c68a19df926c0224dacf39dd8ce Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add virtual QQuickPopupPrivate::reposition() for QQuickDrawerJ-P Nurmi2016-03-011-53/+36
| | | | | | | | | | | | | | | | | | | | QQuickDrawer implements different kind of positioning than other popups. Unlike other popups, it specificly wants to go outside the window bounds. Change-Id: I33a885066ce750f73479be490274389d09eae442 Task-number: QTBUG-51007 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add QQuickPopup::childMouseEventFilter() for QQuickDrawerJ-P Nurmi2016-03-011-0/+25
| | | | | | | | | | | | | | | | | | | | QQuickDrawer needs to be able to filter child mouse events so that the drawer can be closed by dragging also over the drawer, not just outside. Change-Id: I5b9978ebdf33cd0095d6cf67a0d76eee2edae8b6 Task-number: QTBUG-51007 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add QQuickPopup::window() - C++ only APIJ-P Nurmi2016-02-291-13/+17
| | | | | | | | | | | | | | | | | | Makes the transition for changing QQuickDrawer's base class from QQuickItem to QQuickPopup smoother. Change-Id: Ibedca7190f6bfdee678ec4c07e0db83f2c292b86 Task-number: QTBUG-51007 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Route overlay events to QQuickPopup::overlayEvent()J-P Nurmi2016-02-291-22/+27
| | | | | | | | | | | | | | | | | | | | | | This cleans up QQuickOverlay a bit, and prepares QQuickPopup so that it's possible for QQuickDrawer to override overlayEvent() to handle the necessary events at the window edge, instead of overlaying the whole window with a transparent item. Change-Id: I6b7bf26fd99e81b61adac42ec04eb93423e36677 Task-number: QTBUG-51007 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-02-251-1/+20
|\| | | | | | | | | | | | | Conflicts: src/templates/qquickrangeslider_p.h Change-Id: Ibe8ec18a7e22080f69f316d0394af1d03517ce93
| * QQuickPopup: fix uninitialized variableJ-P Nurmi2016-02-251-0/+1
| | | | | | | | | | Change-Id: I339fdb284d65859b5df3a120fc806beaf950031b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Implement accessibility support for Popup and MenuJ-P Nurmi2016-02-251-0/+15
| | | | | | | | | | | | Change-Id: I55067bb1cb9888be8e0e991fb73c9365d93d04f4 Task-number: QTBUG-51316 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * Fix QQuickPopup to respect explicit sizeJ-P Nurmi2016-02-241-1/+4
| | | | | | | | | | | | | | | | | | Don't resize the popup (clamping to its implicit size) unless the popup really has to be resized in order to fit the screen. Change-Id: I81201b77a1001ac22291ede1fc685f7208ff2916 Task-number: QTBUG-51322 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-02-201-171/+106
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/templates/qquickapplicationwindow.cpp src/templates/qquickcontrol_p.h src/templates/qquickpage.cpp src/templates/qquickpopup.cpp src/templates/qquickpopup_p_p.h Change-Id: I265e0267afb22e3d3f80801191f1a810cd2be312
| * Popup: use available size and paddings from the popup itemJ-P Nurmi2016-02-191-168/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the internal popup item inherits Control, which already provides these features, we may use them directly instead of re-doing them in Popup. NOTE: QQuickMenu code has lots of direct references to the content item, which used to be stored in QQuickPopupPrivate, which is the base class of QQuickMenuPrivate. Now that the content item is stored by QQuickPopupItem instead, the direct references don't work. Thus, as a temporary solution to avoid this patch growing large, we'll store the content item in QQuickMenuPrivate. Change-Id: I80a16d34432131a4326c1b6ae54419470be53f96 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * Recommend the use of ApplicationWindow with popupsMitch Curtis2016-02-191-1/+34
| | | | | | | | | | | | | | | | It's important to mention that ApplicationWindow provides some extra support for popups. Change-Id: Iecea78d9d4446bbc4694fcde0166d1b1c2fb62ee Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
| * Controls: fix locale inheritance for popupsLiang Qi2016-02-191-1/+3
| | | | | | | | | | | | | | | | | | QQuickPopup is a QObject, not a QQuickControl. Then need to make QQuickPopup::popupItem() inherit its locale from QQuickPopup::parentItem(). Task-number: QTBUG-50984 Change-Id: Ie5908f86a154502962d6406dd4067b46cc527de7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Controls: fix font inheritance for popupsLiang Qi2016-02-181-3/+6
| | | | | | | | | | | | | | | | | | QQuickPopup is a QObject, not a QQuickControl. Then need to make QQuickPopup::popupItem() inherit its font from QQuickPopup::parentItem(). Task-number: QTBUG-50984 Change-Id: I7f417474172b533b744eb668a0476cdcbabba868 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Templates: follow the Qt coding styleJ-P Nurmi2016-02-121-45/+52
| | | | | | | | | | | | | | | | | | Return early to keep the indentation low. This style was already used in many areas, so now the same style is consistently used everywhere. Change-Id: Ibc7c05147fdcf226ad1cbdd26cd70e1da89108af Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Doc: Reviewed \brief statements in overview pageNico Vertriest2016-02-121-1/+1
| | | | | | | | | | | | Change-Id: I7b01e3331edd32fb1b129bacb076310a5f3a4680 Task-number: QTBUG-50933 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devJ-P Nurmi2016-02-071-7/+105
|\| | | | | | | | | | | | | Conflicts: src/imports/controls/universal/ToolButton.qml Change-Id: Ib9f1e7d83fb824d9e6a13a2bc429d1a5642fe4f6
| * Docs: fix typos in margins linksJ-P Nurmi2016-02-061-4/+4
| | | | | | | | | | Change-Id: I26b519e03700d163af12ec2d08097b1d51d9e119 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * QQuickPopup: add some missing propertiesJ-P Nurmi2016-02-061-3/+101
| | | | | | | | | | Change-Id: I7df64587bf3ba289ba027f6dbe9872362532ec41 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devJ-P Nurmi2016-01-311-45/+342
|\| | | | | | | | | | | | | | | | | Conflicts: src/templates/qquickpopup.cpp src/templates/qquickpopup_p_p.h src/templates/qquickspinbox_p.h Change-Id: Ief25ad2d27410f62e90879f60499ed87359406c3
| * Make popups work without ApplicationWindow, to some degreev5.6.0-rc1v5.6.0J-P Nurmi2016-01-301-40/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ApplicationWindow is highly recommended. First of all, with a plain Window, QQuickPopup attempts to set a high z-value, but cannot guarantee correct stacking order. Secondly, we cannot provide style- specific background dimming for modal popups, because it is styled as part of ApplicationWindow. Last but not least, QQuickPopup has to install a window-level event filter, which is far less efficient than how event handling done in QQuickOverlay. Change-Id: I08915abce7a1764177b92f7539eef77c054a405a Task-number: QTBUG-49921 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Try harder to keep popups inside the windowJ-P Nurmi2016-01-301-5/+26
| | | | | | | | | | Change-Id: If9010f5694c1012a1eb7fb93dcb8958f0af49e9b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Add Popup::marginsJ-P Nurmi2016-01-301-2/+224
| | | | | | | | | | | | | | | | | | | | | | | | Allow specifying margins around the popup that are taken into account while positioning the popup. For example, the Material style draws a drop shadow that goes outside the popups bounds. This allows it to specify margins so that the drop shadow doesn't get clipped. Other use case is to specify the margins so that the popup doesn't overlap with window header or footer. Change-Id: I018d961259fa8b960d86b77de01413eefb75a59b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Popup: improve positioningJ-P Nurmi2016-01-301-4/+9
| | | | | | | | | | | | | | | | | | | | | | Don't spend time repositioning while hidden, but make sure to reposition when the popup item is resized, or when the popup itself becomes visible. This fixes the issue that a ComboBox popup wasn't positioned inside the window when shown initially, until the ComboBox itself moved. Change-Id: I1456dc647e35b6eb9ec2c60dbe9bc9229f932e24 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devJ-P Nurmi2016-01-281-3/+71
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/material/qtlabsmaterialstyleplugin.cpp src/templates/qquickapplicationwindow_p.h src/templates/qquickcombobox.cpp src/templates/qquickcombobox_p.h src/templates/qquickpopup.cpp Change-Id: Ibd87e907bc8abf1f675147761ea8bb0b40722478