aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Document that pop() does nothing if depth is less than or equal to 1Mitch Curtis2020-08-201-0/+3
| | | | | | | | | | This note is already in the detailed description, but users looking at pop() can easily miss that. Pick-to: 5.15 5.12 Task-number: QTBUG-85903 Change-Id: I92c71c8d98b2a83aefbc99229e5b16a6fb33b937 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickStackView: deprecate Transition enum valueMitch Curtis2020-06-081-5/+8
| | | | | | | | | | | | | | | | | | | | bc86a96c56934d98d641844319a905753f56895a added a comment that this was deprecated, but didn't document it as deprecated or have any mention of it being deprecated besides that one comment. As we are dynamically evaluating the JS arguments in C++, we don't need to have a "default" enum value; we can detect omission of the argument and act accordingly. It's now too late to deprecate it for Qt 5, but we can do it for Qt 6. [ChangeLog][Controls][StackView] The StackView.Transition enum value was deprecated. The operation argument can be omitted in order to use the default transition for any given operation. Task-number: QTBUG-84715 Change-Id: I530235beb2ebf56deb6f82ab54e269322e92a0a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* StackView: fix heap-use-after-free when pushing after clearMitch Curtis2020-05-291-13/+24
| | | | | | | | | | | | | This patch extends the work done in aaec25a7 to cover all operations. Note also that b94889f4 does a similar thing to this patch and aaec25a7, in that it explicitly ignores operations that are done during the removal of elements. Fixes: QTBUG-84381 Pick-to: 5.15 Change-Id: Id8bbbded39d8e58bcf0e8eedeb2dde794952333f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Adapt to geometryChanged => geometryChange renamingMitch Curtis2020-04-241-2/+2
| | | | | | Task-number: QTBUG-82994 Change-Id: Iaf530d2a6f4dc92641d0c10e16e7b931f90646ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix build failures as a result of QMetaType changes in qtbaseAlexandru Croitor2020-03-121-0/+2
| | | | | | | | | | | | | | | | | | | moc now stores the QMetaType of properties as a result of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires full type information about the property type inside the moc generated source file. Many of the property types were forward-declared, and this resulted in build errors like "invalid application of 'sizeof' to an incomplete type 'QQuickTransition'" Make sure to explicitly include the moc files inside the counterpart .cpp files, so that full information is available from included headers. Fixes: QTBUG-82774 Change-Id: I5971713864992398daed72ce9f6ab866668cf8e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: fix crash when recursively removing itemsMitch Curtis2019-12-051-0/+20
| | | | | | | | | | | | | | | | | This can happen when e.g. calling clear() in Component.onDestruction in response to a pop() call. The patch fixes the crash by warning and returning early. If users really need to do this, the clear() call can be delayed: Component.onDestruction: { Qt.callLater(function() { stackView.clear(StackView.Immediate) }) } Change-Id: If3cf07495bb34b96089522f44c36976bd6c62492 Fixes: QTBUG-80353 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2019-11-261-5/+7
| | | | | | | | | | | The warnings were about: - Undocumented function parameters - Instances of \instantiates that us an internal class - A few link issues Task-number: QTBUG-79827 Change-Id: I60094279c7da6bc446b5c63b7b4924b71cee4672 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Replace the "Qt Quick Controls 2" instancesVenugopal Shivashankar2019-08-221-1/+1
| | | | | | | | | Now that Controls 1 is deprecated, it's ideal to use "Qt Quick Controls" instead of "Qt Quick Controls 2". Task-number: QTBUG-70333 Change-Id: Ie745db4b61071ddb5e06150d4e739cda74c59f41 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* 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>