aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * QQuickOverlay: keep track of all popupsJ-P Nurmi2016-09-051-1/+13
| | | | | | | | | | | | | | | | Required by the subsequent patches. Done separately keep the other patches smaller and easier to review. Change-Id: I60212451cf53443ae7abd58b8eaad94b66984e03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Use QQuickOverlay with plain QQuickWindowJ-P Nurmi2016-09-051-18/+1
| | | | | | | | | | | | | | | | | | | | | | Get rid of the ugly and broken event filter approach that was used with QQuickWindow. Create an instance of QQuickOverlay so that the same overlay code path is used for both QQuickApplicationWindow and plain QQuickWindow. Task-number: QTBUG-55729 Change-Id: I6e26b19cd94a9580418912803f50c30b9dcaeedb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-231-14/+21
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/material/qquickmaterialstyle.cpp src/imports/controls/universal/qquickuniversalstyle.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquicktooltip.cpp tests/auto/auto.pro Change-Id: I88b347dd85278e14f7b2ca468e30648c6432b6f2
| * QQuickPopup: do not attempt to execute transitions without a windowJ-P Nurmi2016-08-191-2/+8
| | | | | | | | | | | | | | | | | | A parentless/windowless popup item is not associated to a QML engine. Accessing transitions calls qmlExecuteDeferred(), which leads to a crash. This can happen in auto tests with the shared tooltip during destruction. Change-Id: I9a258b2df6b87fce7833e358f17b1910934212c2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Close parentless popupsJ-P Nurmi2016-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A parentless popup is not visible anywhere, and is not even associated to a QML engine. Attempting to execute transitions would crash. Make sure to remove any event filters (when using a plain QML Window, like with QML TestCase) when a popup is made parentless. This ensures that if the global shared tooltip was shown on an item that was destroyed, the tooltip won't keep interfering with the window where it was last shown. Change-Id: I87bf9f8dda2fbcc5d1b83d1b83a66a6b9e718eb6 Task-number: QTBUG-55347 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickPopup: don't keep a reference to a destroyed parentJ-P Nurmi2016-08-181-12/+11
| | | | | | | | | | | | | | | | | | | | | | Move the itemDestroyed() listener from QQuickPopupPositioner, which is only active while the popup is visible, to QQuickPopupPrivate instead. This way the popup gets a notification when the parent gets destroyed while the popup is hidden. Task-number: QTBUG-55347 Change-Id: Ic72206cc05996c23062e814799a030c369fc6288 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-171-1/+1
|\| | | | | | | Change-Id: I8172f493c5747db2c9e728b026ff267bff2e3427
| * Fix popups to appear above QtQuick.Dialogs 1.xJ-P Nurmi2016-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a plain QML Window, the Z-value of the popup item must be higher than the Z-value of the DefaultWindowDecoration in QtQuick.Dialogs 1.x. When using an ApplicationWindow, the same applies to the window overlay. NOTE: The correct Z-value of DefaultWindowDecoration is 1000000, not 10000! (qtquickcontrols/src/dialogs/qml/DefaultWindowDecoration.qml) Task-number: QTBUG-55004 Change-Id: Ib5d068ee2c633884f95ba519f77b6ec082220461 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-221-0/+5
|\| | | | | | | Change-Id: I82c2b8d97d639e24147118a2ca6276ae70195b45
| * Don't leak hover events through popupsJ-P Nurmi2016-07-221-0/+5
| | | | | | | | | | | | Task-number: QTBUG-53419 Change-Id: Ia3e23538bfba09454c9b473d8394814890ada150 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix build after QQuickItemChangeListener changesJ-P Nurmi2016-07-131-1/+1
| | | | | | | | | | | | | | | | qtdeclarative commit e2c296c changed the itemGeometryChanged() signature. Change-Id: Ibe163e1d6fe8535a4ec01de047d72a0d4863979d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Popup: expose flip APIJ-P Nurmi2016-07-091-0/+58
| | | | | | | | | | | | | | | | | | [ChangeLog][Popup] Added allowVerticalFlip and allowHorizontalFlip properties to control whether flipping is allowed to fit a popup inside the window. Change-Id: Id14a8846a1e2d07e98207da7c2b2765c202dbaf9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-091-1/+1
|\| | | | | | | Change-Id: Ifff470774347041d1638fb1da277a8cc11a00db6
| * Drawer: reposition when closedJ-P Nurmi2016-07-061-1/+1
| | | | | | | | | | | | | | | | | | A drawer must be repositioned even when closed, or else it will peek out when anchored to the right or bottom edge and the window is resized. Change-Id: Idf86ec1d841cfcc333eb6c69d07b3e4b2b4015da Task-number: QTBUG-54578 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-1/+1
|/ | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: update \sa statements ControlsNico Vertriest2016-06-081-1/+1
| | | | | Change-Id: Ifb2b62302e965a685ee57297aada883c7277610c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Add missing QQuickPopup::forceActiveFocus()J-P Nurmi2016-05-231-0/+16
| | | | | | Change-Id: I06da62fa3804ee9d67bfb3feb8a11faa1fd3850e Task-number: QTBUG-53519 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Make Overlay.modal and modeless ComponentsJ-P Nurmi2016-05-231-0/+1
| | | | | | | | | | | | | | | | This way we can simply instantiate a visual overlay for each modal or dimming popup without having tricky problems with overlay's stacking order. It makes also sense to not instantiate the overlays for hidden popups. Coincidentally, this change also fixes a problem that the overlay turned out to be _always_ visible since a hidden overlay background was always instantiated no matter if there were open popups, or popups at all. Change-Id: Ieb64a72c827d0a005418027428378ebe04f41117 Task-number: QTBUG-53519 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Don't restore focus to contentItem when a focusless popup was closedMitch Curtis2016-05-191-6/+14
| | | | | | | | | For example, a ToolTip shouldn't affect focus when it closes. Task-number: QTBUG-53420 Task-number: QTBUG-53451 Change-Id: Ic945e98a2ffd86e9f9f06724b16e5f240c3f94de Reviewed-by: Liang Qi <liang.qi@qt.io>
* Popup: don't ignore Back keyNikita Krupenko2016-05-181-1/+1
| | | | | | | | | This allows to close popup on mobile device when Back key pressed and CloseOnEscape policy is set. Change-Id: I97e863b462ee50d2d8e79d18cf8097f960f14227 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Popup: restore original size on reposition if appropriateNikita Krupenko2016-05-181-0/+10
| | | | | | | | | | | | | | When popup need to reposition (for example, on screen orientation change), it's resized to fit into window bounds. But if the implicit size of it's content changed to accommodate window geometry, popup wouldn't change it's size back. This commit allow to change popup size when implicit width of the content changed and new size could fit into window bounds. Task-number: QTBUG-52729 Change-Id: I5a265b55e24495be9c1f2050cdcceddcdeb57974 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickPopup: cleanup window usageJ-P Nurmi2016-05-121-13/+7
| | | | | | | | | The window pointer is stored as a member variable in QQuickPopupPrivate since 10d3752. Change-Id: I9f73db5bbcdb0c1fcbae556db57a6a94067ce98a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* QQuickPopup: don't reposition when hiddenJ-P Nurmi2016-05-121-0/+3
| | | | | | | Avoid some unnecessary calculations and coordinate mappings. Change-Id: I98fd79b2a743b055b55086a2bdf1483a4ff19c2a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: restore focus to contentItem of ApplicationWindow when closingMitch Curtis2016-05-111-0/+6
| | | | | | | | | In Controls2, Popup and normal content are in same window, then we should maintain the focus restore work. Task-number: QTBUG-53275 Change-Id: I57f5aaf3febf1b7d2071c1734d8561932f95c699 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickPopup: emit xChanged() and yChanged() when _local_ coords changeJ-P Nurmi2016-05-111-10/+18
| | | | | | | | | | | Emitting xChanged() and yChanged() when the (scene) geometry of the internal popup item changes is not sufficient, because QQuickPopup operates in the parent item's coordinate space. When a popup is pushed inside the window margins, the local coordinates change, but the global coordinates don't. Change-Id: I296f1ecd1d1e882c2ff730a2bf68641bd57cbb4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: align position accessors with x/y accessorsJ-P Nurmi2016-05-111-32/+15
| | | | | Change-Id: Ib3db04d9d1395f33bf9c8d83f69d7f24a3e380b9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: use margins to determine whether to push inside window boundsJ-P Nurmi2016-05-101-61/+70
| | | | | | | | | | | | | | Previously, we were planning to introduce complex policy flags to make it possible to specify whether a Popup is allowed to go outside the screen or not. Using margins for that purpose avoids the need of introducing such dedicated API just for that. From now on, margins are used to determine whether a popup is pushed to fit inside the window bounds (margins removed), and implicit size is used to determined whether a popup is resized to fit inside the window. In other words, a popup with negative margins and no implicit size is allowed to move outside the window bounds. Change-Id: Ife1665755e4dae434751977ae3289eb1aa4f3c6d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: make x() and y() return the effective coordinatesJ-P Nurmi2016-05-091-4/+16
| | | | | | | | | And trigger change signals appropriately. This makes it possible for the iOS style to know where the ComboBox popup is actually positioned so it can visualize the popup curve appropriately. Change-Id: I6cec6cbf220736c658357aee10f6d31e08531ba2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix accessibilityJ-P Nurmi2016-05-031-0/+3
| | | | | | | | | Add missing componentComplete() -> accessibilityActiveChanged(true) calls to QQuickTextField, QQuickTextArea, and QQuickPopup. Task-number: QTBUG-53157 Change-Id: I0e79d7f1412c24f4d129c58ba1e7edf20b8d8ecf Reviewed-by: Liang Qi <liang.qi@qt.io>
* QQuickPopup: listen to parent item's window changesJ-P Nurmi2016-05-031-6/+16
| | | | | | | | | Emitting windowChanged() only in setParentItem() is unreliable, because the item might not yet have a window. Therefore we must listen to the parent item's windowChanged() signal. Change-Id: I237f81e0b06319516428c3c5d42352b228e753f5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: emit opened() when fully openedJ-P Nurmi2016-04-291-1/+2
| | | | | | | | | | | Opening sequence: aboutToShow() -> visibleChanged() -> enter transition -> opened() Closing sequence: aboutToHide() -> exit transition -> visibleChanged() -> closed() Change-Id: If1a97f0d3cbc1dad0e1b1ceade4b807a9bff122e Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Popup: separate modal and modeless background dimmingJ-P Nurmi2016-04-271-0/+45
| | | | | | | | | | iOS generally has white popups on white background, so it must dim the overlay background also for modeless popups to make them stand out. Make it possible to have modal and modeless background dimming separately, because both might be visible at the same time (eg. in Gallery settings). Change-Id: Id990675c8d06ceb8f8a26e6505d4bd020069f297 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Promote QQuickToolTip's repositioning code to QQuickPopupJ-P Nurmi2016-04-251-18/+59
| | | | | | | | | | | | | | QQuickToolTip already had repositioning implemented for both horizontal and vertical directions. Promote that code up to QQuickPopup so that QQuickMenu gets properly repositioned when used as a context menu. As special cases, QQuickComboBox enables vertical flipping for its popup, and QQuickToolTip enables both. In the QQuickPopup base class, both are disabled by default. Task-number: QTBUG-52608 Change-Id: Ia8f835321222d4841a6f79434822b33f057d13fc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: add "Popup Controls" group pageJ-P Nurmi2016-04-251-0/+2
| | | | | Change-Id: I863b49f9dad875922a3a4262881e6cd8a32f4b18 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-4/+2
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-42/+42
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Popup: rename close policy flagsJ-P Nurmi2016-04-201-11/+11
| | | | | | | | | | | Even though it gets a bit long, it's much easier to remember close policy values that start with "Close". Even with auto-completion, one still has to type something for Qt Creator to know what to complete. That's where consistency (closePolicy -> CloseFoo, snapMode -> SnapBar) helps. Change-Id: Idc86322c0d1e367fad87eb1deafbf58ef6ddb04d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Popup: add opened() and closed() signals.Mitch Curtis2016-04-201-0/+18
| | | | | | | The only alternative at the moment is to use onVisibleChanged. Change-Id: Ica56a30cc9895681005be0bad7b19fd205b79232 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: add 2-suffix to the image assets and snippetsJ-P Nurmi2016-04-131-1/+1
| | | | | Change-Id: Ib8050cb3baefe07d28c7e2dcec64af155d2d7c9b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+1851
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>