aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates/qquickstackview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Add alternate text for Qt Quick and Qt Quick Controls imagesJerome Pasion2025-11-261-0/+6
| | | | | | | | | | Alternate text (alt text) improves the documentation experience for screen readers and for other accessibility tools. Pick-to: 6.9 6.10 Task-number: QTBUG-135120 Change-Id: I975c3de11f893882fb9a27218079f244bd38a622 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Fix links to Qt Quick and Qt Quick ControlsDavid Boddie2025-10-271-10/+10
| | | | | | | | Making links explicit prevents QDoc from auto-linking when not desired. Marking QtQuick as code when relevant also prevents auto-linking. Change-Id: Ib187cb94f59a418c77ef2931999f634e557c8200 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: don't load new items if QML engine is nullMitch Curtis2025-10-011-17/+49
| | | | | | | | | | | | | | | | | | | | | | | | In the linked bug report, a Loader is deactivated after an Image within it has started loading. A slot was connected to the statusChanged signal of the Image, which calls replace(). This caused an assertion failure because the StackView's QML engine was null. Note that it's not enough to check if the QML context is non-null, because it still is at that point. There isn't an easy way to check for this in one place in QQuickStackView, let alone in user code, so we need a lot of engine checks. Add a C++ test for StackView, as I wasn't able to get it to crash with a QML-only test. For now we only need to test the Basic style, since most styles don't provide anything too interesting or complex for StackView. Fixes: QTBUG-140018 Pick-to: 6.8 6.10 Change-Id: I53ba016bf44c46b7734b0b2daeeb62177f9067db Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The files (folders) already processed are listed in each issue in epic QTBUG-134547 These files were processed half a year ago. In order to make it clear that all of these files are already processed, mark them with an explicit default security header. For the record, this was generated with this script: find -E . -regex ".*\.(cpp|h|hpp|mm|qml|js)$" | xargs python3 ~/bin/add-cra-header.py in the folders listed in each subtask of QTBUG-134547 (add-cra-header.py only exist at my desktop, but it simply adds the default security header if it doesn't already have any existing security header) QUIP: 23 Fixes: QTBUG-134547 Pick-to: 6.10 6.9 6.8 Change-Id: Ieb8c78ea6561fdbdd27c7b13185ece853eedf80f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: Remove transparent backgrounds from wireframe imagesKai Köhne2025-05-211-1/+1
| | | | | | | | These don't work well in dark mode. Also, convert to webp while at it. Pick-to: 6.9 Change-Id: Ie210c7cc03f742f2cfbd5af3d3b692309ccf6aae Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add missing includesFabian Kosmale2024-10-241-0/+1
| | | | | | | | | | ...in preparation of trimming down includes in QQuickItem. As a drive-by, remove the superfluous qqml.h include from quick/items/qquicktextutil_p.h. Change-Id: I7ee0f459bcbfdfe07314d1f63433aaa8639870ac Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Replace \instantiates with \nativetypePaul Wicking2024-08-201-1/+1
| | | | | | | | | | | Since the implementation of the `\nativetype`-command in QDoc, the `\instantiates`-command is deprecated. Replace the use of the deprecated command in favor of its replacement. Pick-to: 6.8 Task-number: QTBUG-128216 Change-Id: I23d9f66d3f6db2e5f827d7868497a432bb9b0626 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* qmllint/quick: rename attached type warnings to be uniformSami Shalayel2024-08-081-1/+1
| | | | | | | | | | | | Rename runtime warnings and qmllint warnings to be uniform, instead of having many different formulations for the same problem. This makes it easier to document them, at least for the qmllint warning documentation. Pick-to: 6.7 6.8 Task-number: QTBUG-118112 Change-Id: Iabb3a5fb0679523764b9f2fe2d99f4eb93a13c88 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Add a wrapper builtin for QQmlV4Function*Ulf Hermann2024-04-121-3/+3
| | | | | | | | | This way qmltyperegistrar can recognize it and refrain from warning about it. Task-number: QTBUG-101143 Change-Id: I598140e7e90dbd3e27a78c26eff3d46f0fd3e989 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* StackView: Fix and clarify pushItems documentationFabian Kosmale2024-02-271-4/+6
| | | | | | | | | | | | The code snippet needs to use pushItems not push (which was a leftover from before we renamed the function). Moreover, clarify that items itself has to be an array, and mention the possibility of passing arguments a bit earlier. Pick-to: 6.7 Change-Id: I8c7cf3576c692b2b5f543a706ec61406c37906dc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Set default layout size policies for quick itemsSanthosh Kumar2024-02-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The quick items are initiliazed with default layout size policy. This size policy can be either Preferred or Fixed and it can vary depending on controls and its orientation. [ChangeLog][QtQuick][Item Behavior Changes] The QtQuick items now set their default size policy and it would be effective when used within QtQuick Layouts. The following types now behave differently by default when used in layouts: Button, CheckBox, ComboBox, Dial, DialogButtonBox, Frame, Flickable, GridView, GroupBox, HorizontalHeaderView, ListView, Page, Pane, PathView, ProgressBar, RadioButton, RangeSlider, RoundButton, ScrollBar, ScrollIndicator, ScrollView, Slider, SpinBox, SplitView, StackView, SwipeView, Switch, TabBar, TabButton, TableView, TextArea, TextEdit, TextField, TextInput, ToolButton, TreeView, Tumbler, VerticalHeaderView. Task-number: QTBUG-117597 Pick-to: 6.7 Change-Id: I41fe73a2e466e396f26604a14d1f15b8b42df338 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* StackView: guard against destruction of previous item during transitionVolker Hilsheimer2023-11-071-1/+1
| | | | | | | | | | | | | | Since user code might get called during the transition when an item gets popped, the previous item might be destroyed already by the time the transition completes. Guard against that using a QPointer. Add a test case. Fixes: QTBUG-118525 Change-Id: If412f279a395a217a5b45352b11ae850e00ca58b Reviewed-by: Ed Cooke <ed.cooke@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: clarify default push and replace operationMitch Curtis2023-10-031-2/+4
| | | | | | | | | | It needs to mention that Immediate is used for these operations if the stack is empty. Task-number: QTBUG-117700 Pick-to: 6.2 6.5 6.6 Change-Id: I4598e8662e6e9cf5fb62ce623d08075be992ceb3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* StackView: add strongly-typed replace functionsMitch Curtis2023-07-051-40/+170
| | | | | | | | | | [ChangeLog][Controls][StackView] Added strongly-typed replaceCurrentItem functions. These can be compiled to C++ by the QML Compiler. Task-number: QTBUG-112475 Change-Id: I5de7d712cd1839ed3e6f1f7229bd2e5c896fd6bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: add strongly-typed pop functionsMitch Curtis2023-07-051-1/+101
| | | | | | | | | | [ChangeLog][Controls][StackView] Added strongly-typed popToItem popToIndex, and popCurrentItem functions. These can be compiled to C++ by the QML Compiler. Task-number: QTBUG-112475 Change-Id: If7452ec238a2d292a64d266ac27bdb146c713017 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* StackView: add strongly-typed push functionsMitch Curtis2023-07-051-0/+227
| | | | | | | | | | [ChangeLog][Controls][StackView] Added strongly-typed pushItem and pushItems functions. These can be compiled to C++ by the QML Compiler. Task-number: QTBUG-112475 Change-Id: Ib69181701127513ba7a0095370f7a7c8b21d4649 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* StackView: emit depthChanged when clearing with transitionVolker Hilsheimer2023-04-181-1/+2
| | | | | | | | | | | | | | | When a transition is used in the call to clear(), then we pop the top element off the stack and start the transition for it. If we read the old depth after doing that, then it will be off by one and prevent the emission of the changed signal if that was the last element on the stack. So read the old depth already before we pop, and add a test. Fixes: QTBUG-84920 Pick-to: 6.5 6.2 Change-Id: Idae619efa25729fafbf238cb4db62472042b1cb7 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Fix build with -no-feature-quick-viewtransitionsTasuku Suzuki2023-03-071-0/+25
| | | | | | Pick-to: 6.5 Change-Id: I609a843bddbd0776452d289b144dab803503a483 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQuickStackView:: Avoid memory leak in QQuickStackView::pushFabian Kosmale2023-02-221-7/+7
| | | | | | | | | | | | | | | | | | If duplicate elements are pushed, they immediately get removed. However, the list contains heap-allocated QQuickStackElements, so we actually need to free them. Fix that by porting the (accidentally quadratic) loop with a combination of remove_if + delete + erase. A cleaner but more invasive solution would have been to port to a vector of unique_ptrs (which would have enabled usage of erase_if), but that is left for another patch. Pick-to: 6.5 Change-Id: I0545cc4f7ccbf70b58e09cd8f8f06216d984eae3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: remove "2" from Qt Quick Controls filesMitch Curtis2022-12-011-10/+10
| | | | | | | | | | | | | Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. The CMake target (docs_QuickControls2) probably can't be renamed until we rename the library, which won't happen until Qt 7. Task-number: QTBUG-95413 Change-Id: Ied20805a91286436606577c3de39671a447f27dd Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove "2" from Qt Quick Controls directoriesMitch Curtis2022-12-011-0/+1371
Qt Quick Controls 2 was named that way because it was a follow-up to Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer supported, we don't need to have "2" in the name. Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. By doing this renaming a few weeks before feature freeze, it won't affect the release but still results in as little time possible spent manually fixing conflicts in cherry-picks from non-LTS releases as a result of the renaming. This patch does the following: - Renames directories. - Adapts CMakeLists.txt and other files to account for the new paths. A follow-up patch will handle documentation. It does not touch library names or other user-facing stuff, as that will have to be done in Qt 7. Task-number: QTBUG-95413 Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>