aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/doc/snippets/qml
Commit message (Collapse)AuthorAgeFilesLines
* snippet: correct usage demo for SortFilterProxyModelWang Zichong2025-11-141-2/+2
| | | | | | | | | | The usage is incorrect with invalid QML syntax, this patch fixes the issue. Fixes: QTBUG-141913 Pick-to: 6.10 Change-Id: I39dd9141a7058a8948e40718d8d75821aea8e0f0 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Docs: Fix the broken link and example snippet for SortFilterProxyModelSanthosh Kumar2025-09-051-1/+1
| | | | | | | | | | | | The SFPM documentation specifies about 'ValueSorter', which is not applicable anymore. Thus any information w.r.t it need to be updated. Also, the example snippet need to be corrected referring the valid object name. Fixes: QTBUG-139781 Pick-to: 6.10 Change-Id: I7e88c49bf36a0a0ac11b6f7ee3d4acf862eb90a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove support of manipulation of complex rows in QQmlTableModelMate Barany2025-07-281-87/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TableModel supports complex row structures but only with a limited functionality. Since the model does not know how a complex row is structured, it cannot manipulate it. This also means that the copy of the model data that is stored in rows is not kept in sync with the source data that was set in QML - the user is supposed to handle simple data manipulation. This one functionality was not tested and it seems that the implementation was changed in the background as setRows is now called when rows is modified in QML. A good example is in complex.qml. If we try to extend the corresponding test case with a setData call it is going to call the function assigned to setDisplay which calls setRows - something it was not supposed to do. The checks in setRows do not recognize the complex row structure and as such the call is not successful. The checks could be adjusted to work for this specific case, but the structure could be anything so that solution would not be generic enough. Remove the support of manipulation of complex row structures from QQmlTableModel. [ChangeLog][Qt labs QML Models] Removed the support of manipulation of complex row structures from QQmlTableModel. Task-number: QTBUG-138553 Pick-to: 6.10 Change-Id: I8664ae9ec2e5cd09bc2c88a25f4ac972378e8e94 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Extend documentation of QQmlTreeModelMate Barany2025-07-171-0/+100
| | | | | | | | | | Add the missing description of the class and some more snippets and examples. Task-number: QTBUG-137747 Pick-to: 6.10 Change-Id: Id4d84c22afe4562cbfff097238b9c3b20c184a84 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
* Provide a way to sieve data in QML through the SortFilterProxyModelJan Arve Sæther2025-05-301-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance QSortFilterProxyModel to be available in QML with changes as mentioned below and export the type as SortFilterProxyModel (Note: adopted most of these features from existing project - https://github.com/oKcerG/SortFilterProxyModel) * Inherit QQmlSortFilterProxyModelPrivate from QSortFilterProxyModelHelper and use the mapping logic of source to proxy indexes from it. * Allow the model to be configurable with multiple filters and sorters. The filter and sorter components shall be inherited from QQmlFilterBase and QQmlSorterBase respectively. The components are maintained within the respective compositor classes. The filter and sorting operation from QQmlSortFilterProxyModel will be forwarded to the compositor which then iterate through the configured components to sieve the data. This patch allows the following filters and sorters configurable in SFPM, Filters: ValueFilter - Filters the data that matching with the provided value or role name or combined together if both are specified. FunctionFilter - Filters the data according to the result of the evaluated js method. Sorters: RoleSorter - Sorts the data according to the provided role name. StringSorter - Sorts the data by considering the locale. FunctionSorter - Sorts the data according to the evaluated js method. * Add support for 'enabled', 'column' property for both filters and sorters, and 'priority' property for the sorters. Task-number: QTBUG-71348 Change-Id: I65b84936642e5f0f382d83413648d2c6794c18aa Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* convert threading example to manual testsOliver Eftevaag2023-07-042-0/+56
| | | | | | | | | | | | The threading example used a LauncherList to combine two different but related examples into one. I've now separated both into a shared directory called 'threading' Pick-to: 6.6 Change-Id: Iee8898e61adcf69dc67157a1eff5f6ac019a39ca Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Don't use versioned Qt imports in QML snippetsKai Köhne2023-06-308-14/+14
| | | | | | | | | | | We don't promote versioned imports anymore in Qt 6. Patch done by find . -path "*/snippets/*.qml" -exec perl -pi -e "s/import Qt([\.a-zA-Z]*) \d\.\d+/import Qt\\1/g" {} ; Pick-to: 6.5 6.6 Change-Id: I20a5bf52f7cdd99124626f85ce9794af74382977 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-118-392/+16
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Re-add documentation for Qt Qml ModelsUlf Hermann2019-09-178-0/+846
It got lost when moving the classes. Change-Id: I7b3a9fec8fe9439c548da570e430d3b82613b816 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>