aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: add a Size section to explain StackView's sizing behaviorMitch Curtis2019-04-081-0/+29
| | | | | | Task-number: QTBUG-74902 Change-Id: I3f77459028de48729bb78353d8d95e92c7fc98f6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix crash with StackView::initialItemSimon Hausmann2018-03-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following binding initialView: Qt.createComponent("blah.qml") works with QQC1 but crashes with QQC2 as soon as the garbage collector kicks in. In QQC1 StackView was implemented in a .qml file and the property was declared as property var initialItem For such declared properties the QML engine takes care of ensuring that the reference assigned is a strong reference towards the GC and it also tracks the life-time of the QObject in case it's explicitly deleted by somebody else. In QQC2 the property continues to be documented as "var" property, however it is implemented in C++ as QVariant property. The QVariant is not known to the GC at all and it also doesn't do life-cycle tracking. The C++ equivalent to "var" in QML is QJSValue, which is a strong reference and also ends up using a QPointer internally when holding a QObject. Task-number: QTBUG-67118 Change-Id: I43e473c7bf2c40f9843e9d50fe4fd805b54fd256 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add a "Focus Management in Qt Quick Controls 2" pageMitch Curtis2018-03-061-1/+3
| | | | | | | | This will list each control that is a focus scope, and have some relevant information about focus in Qt Quick Controls 2. Change-Id: I3126452bf73f7d7730d0522d616d61ad0da0dd74 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: add an "Item Ownership" section toStackView's documentationMitch Curtis2018-03-011-1/+57
| | | | | | | | | It's important that users know the circumstances under which the items managed by StackView will be destroyed. Task-number: QTBUG-66658 Change-Id: I26e287b3dfed44e441125080443bdae4ee1814b7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-101-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/CheckBox.qml src/imports/controls/CheckDelegate.qml src/imports/controls/ComboBox.qml src/imports/controls/DelayButton.qml src/imports/controls/Dial.qml src/imports/controls/ItemDelegate.qml src/imports/controls/MenuItem.qml src/imports/controls/RadioButton.qml src/imports/controls/RadioDelegate.qml src/imports/controls/SwipeDelegate.qml src/imports/controls/Switch.qml src/imports/controls/SwitchDelegate.qml src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc src/imports/controls/material/CheckDelegate.qml src/imports/controls/material/ItemDelegate.qml src/imports/controls/material/MenuItem.qml src/imports/controls/material/RadioDelegate.qml src/imports/controls/material/SwipeDelegate.qml src/imports/controls/material/SwitchDelegate.qml src/imports/controls/qquickdefaultbusyindicator.cpp src/imports/controls/qquickdefaultbusyindicator_p.h src/imports/controls/qtquickcontrols2plugin.cpp src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/ItemDelegate.qml src/imports/controls/universal/MenuItem.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/SwipeDelegate.qml src/imports/controls/universal/SwitchDelegate.qml src/quickcontrols2/quickcontrols2.pri src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickpopup_p.h Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
| * StackView: don't block touchJ-P Nurmi2017-12-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-65084 Change-Id: I3d51bdc80981557399f3bdfd181e359679cd1c20 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-0/+1
|\| | | | | | | | | | | | | Conflicts: src/imports/controls/MenuItem.qml Change-Id: Id4cae0e53a58796694ad1fc9f8380b317ee62984
| * Fix resource leakJesus Fernandez2017-10-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The system resource will not be reclaimed and reused, reducing the future availability of the resource. In QQuickStackView::​componentComplete(): Leak of memory or pointers to system resources (CWE-404) Coverity-Id: 178431 Change-Id: Iff8f8e2d228042789faae56512fd3255c3e56498 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Doc: add the Qt version to "\since QtQuick.Controls 2.3"J-P Nurmi2017-05-311-1/+1
| | | | | | | | | | | | | | For the earlier versions, this was already done in the 5.9 branch. Change-Id: I3fd3840aca0f5aadd7aa77eba358ac0f6c94f942 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-6/+6
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-6/+6
| | | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickStackView::clear(): don't emit depthChanged() when already emptyJ-P Nurmi2017-05-221-0/+3
| | | | | | | | | | Change-Id: Ib20995b86e776cb64a3d1fa6dea01dee4a802426 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickStackView: fix emptyChanged()J-P Nurmi2017-05-231-7/+10
| | | | | | | | | | | | | | Don't emit emptyChanged() when popping down to 1 element. Change-Id: Iff1e29567d1d6171cea0f158955325389c03800c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add StackView::empty for convenienceJ-P Nurmi2017-05-231-5/+20
| | | | | | | | | | | | | | "stack.empty" looks cleaner in bindings than "stack.depth === 0" Change-Id: Ia99ea8ff2a8cf76a752917c239874d24d2103312 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | StackView::clear() allow specifying a transitionJ-P Nurmi2017-05-231-3/+21
|/ | | | | | | | | | | This turns out to be a useful feature wanted for the Coffee Machine demo, which is being cleaned up. [ChangeLog][Controls][StackView] Allowed specifying a transition when clearing the stack view. Change-Id: I12ed18ca24c247980bab1fe93e1810c0d25d85e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: provide better warnings and errorsJ-P Nurmi2017-03-241-9/+25
| | | | | | | | | Check for valid URLs and test object types. Throw warnings when appropriate instead of crashing later. Task-number: QTBUG-59634 Change-Id: Ia269dc8afd31b618f1ff7aec94d684029cb78244 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickStackViewPrivate::warn() helperJ-P Nurmi2017-03-241-6/+10
| | | | | | | | | Store the current operation name internally to allow throwing informative warnings when component creation fails. Task-number: QTBUG-59634 Change-Id: I7506c5eb4be35878c8abd73a637357e0d8ae08a2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Port from QT_NO_ACCESSIBILITY to QT_CONFIG(accessibility)J-P Nurmi2017-02-241-1/+1
| | | | | Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickStackView: fix pop/replace exit leakJ-P Nurmi2017-02-241-2/+6
| | | | | | | | | | | | | | QQuickStackView did not keep track of the element that was exiting the view during a pop/replace exit transition, but it was expecting viewItemTransitionFinished() to be called and cleaned up the element there. If a pop/replace exit transition was running at the destruction time, QQuickStackView did not clean up the element at all (because it had been already removed from the internal stack of elements) and thus the transition was left running. Task-number: QTBUG-59034 Change-Id: I3cd7c761fab79574b9a7cc849788f36765def45b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Prevent StackView filtering of UngrabMouse eventMichael Dippold2017-02-231-0/+2
| | | | | | | | | | | Currently the StackView is filtering the UngrabMouse event during transitions. If a MouseArea is still in the pressed state during this time it will forever be in the pressed state as the ungrab event is filtered. Task-number: QTBUG-59098 Change-Id: I7effdad6a36b64336b4770a1dca61ba47998b787 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-4/+4
| | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQuickControls2: Use the newly-introduced qmlWarning instead of qmlInfoRobin Burchell2017-01-131-7/+7
| | | | | | | | qmlInfo will shortly be returning info-level messages (as the name hints), rather than warning level messages. Change-Id: I94123464b12b30a4ba085cfb7b606bc26df9b76e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add attached StackView.visible propertyJ-P Nurmi2017-01-121-4/+53
| | | | | | | | | | [ChangeLog][Controls][StackView] Added attached StackView.visible property that can be used to control whether items below the top- most item are kept visible. Task-number: QTBUG-56801 Change-Id: Ieead0d476f254886cff5f8457bb5c5d23cb7de8a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-12-201-0/+11
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/material/DialogButtonBox.qml src/imports/controls/universal/DialogButtonBox.qml Change-Id: I16cbf9912a3526783c21a6f30996f83fce9e02c3
| * StackView: don’t push duplicate itemsMitch Curtis2016-12-061-0/+11
| | | | | | | | | | | | | | | | It doesn’t make sense to do this. Task-number: QTBUG-57266 Change-Id: I23f740356f2727a59aa0a68cb57d2c44edfb6046 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-11-031-0/+7
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/ProgressBar.qml src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickstackview.cpp Change-Id: I9a1028a991de9fc3e26d3f973106301e9ada631c
| * Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-031-0/+7
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/accessibility/tst_accessibility.cpp Change-Id: I8c3ccb301730ecdc0acdcb75de607cdd4f753e15
| | * StackView: provide accessible roleJ-P Nurmi2016-11-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAccessible::LayeredPane: An object that can contain layered children, e.g. in a stack. The same accessible role is used by QStackedWidget. Change-Id: Ia1f96afd5e084958538356e3d9033a3d88cf03c3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Whitespace cleanupsJ-P Nurmi2016-11-031-1/+1
| | | | | | | | | | | | | | | Change-Id: Ia075694a7dc43d72d07221b569467fcebdb411fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Rename QQuickStackAttached to QQuickStackViewAttachedJ-P Nurmi2016-10-271-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQC1 the attached property was called "Stack", purely because we couldn't have both QML and C++ types with the same name. Now the attached properties are provided by StackView itself, so this is the correct name. Change-Id: I0f98d73735cff14c444a9e843b7cb56dc8a45cd8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Move QQuickStackTransition into its own filesJ-P Nurmi2016-10-271-0/+1
| | | | | | | | | | | | | | | Change-Id: I87fdef1c2cc5bb2b04c38b54cca316ace8814f2c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Move QQuickStackElement into its own filesJ-P Nurmi2016-10-271-0/+1
|/ / | | | | | | | | Change-Id: I4fce147f125d4641e1eb3a6534f57d68000dbfc7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-17/+42
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * Improve StackView's documentationMitch Curtis2016-10-171-17/+42
| | | | | | | | | | | | | | | | Add more GIFs and restructure the text so that it's easier to follow. Change-Id: Ieb3136c306240dae44859a59e4451fce23275d47 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | StackView: add removed() attached signalMitch Curtis2016-09-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | This provides an opportunity for users to destroy items that StackView doesn't, like objects that are pushed as Items. [ChangeLog][Controls][StackView] Added StackView.removed() attached signal to provide a way to delete items that StackView won't. Task-number: QTBUG-55405 Change-Id: I59096efaf1a95d36451fbf1f46b8f68ee96c20de Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | StackView: don't crash if attached to a non-ItemJ-P Nurmi2016-07-181-11/+12
| | | | | | | | | | Change-Id: Ifa7ef9b0960494df917f9f60bf8d94cbee0f4661 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-151-0/+16
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickswipedelegate.cpp tests/auto/controls/data/tst_swipedelegate.qml tests/auto/controls/data/tst_textarea.qml tests/auto/controls/data/tst_textfield.qml Change-Id: I244f4ead4d14238c41db0bd965d7a2938f2ea8fc
| * Doc: special notes for Component and url in StackView::push/replace()J-P Nurmi2016-07-131-0/+16
| | | | | | | | | | | | | | Adapted from Component::createObject() docs. Change-Id: I53e44cfbcb4e4f1cc407e09d4ee90724526c9411 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | StackView: allow choosing which transition to runJ-P Nurmi2016-07-141-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly useful for being able to use either push or pop transition for replace operations, but there doesn't seem to be any reason to limit the others. So, now it's able to run any of the push/pop/replace transitions (or none with "immediate") for any push/pop/replace operation. [ChangeLog][StackView] Made it possible to choose the visual transition type for any operation. This allows using for example push and pop transitions with replace(), which allows implementing an "infinite" back and forward navigation pattern while keeping the amount of instantiated items constant. Change-Id: I93b87cf854c3d6e2f33ef73ef25ffb3456ec27f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Refactor QQuickStackView transition startupJ-P Nurmi2016-07-141-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | Merge the separate but very similar looking popTransition(), pushTransition(), and replaceTransition() methods to a single startTransition() method, and pass the necessary arguments in a QQuickStackTransition structure. This is an enabler step for being able to specify the desired transition type for replace (and push & pop, for that matter) operations. Change-Id: Ia68bb94dc9280aace8718f4df0e798a7f1469e78 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-06-201-3/+5
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickcontainer.cpp Change-Id: I7c41619a81b4fdd0d8ccaa4f0bb489a9b84e3865
| * StackView: Fix warning when popping down to the current itemKonstantin Ritt2016-06-161-3/+5
| | | | | | | | | | | | | | | | | | findElement() is unable to find currentItem cause the most top element has been popped just few lines above, leading to "pop: unknown argument: .." warning where it shouldn't really do. Change-Id: I90d4ea6acaf09b861af281d9c0e23bc42a6eb503 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | StackView: add attached activated() etc. signalsJ-P Nurmi2016-06-061-0/+38
|/ | | | | | | | | | | | For initializing and cleaning up item-specific resources, these are much more convenient than a StackView.onStatusChanged handler. [ChangeLog][StackView] Added attached activated(), deactivated(), activating(), and deactivating() signals that are convenient for initializing and cleaning up item-specific resources. Change-Id: If8df45b31a14cd2491db2c87eeb1c071af4e695f Reviewed-by: Mitch Curtis <mitch.curtis@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>
* QQuickStackView: fix buildLiang Qi2016-05-211-0/+3
| | | | | | | Added some includes because the private header cleanup in qtdeclarative. Change-Id: Ic7580377c7c38966ba51bc08f1f6c37dc8c7616c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | 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-20/+20
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 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>