summaryrefslogtreecommitdiff
path: root/src/quick/doc/snippets/qml/tableview
Commit message (Collapse)AuthorAgeFilesLines
* QQuickTableView: fix minor documentation issuesRichard Moe Gustavsen2023-03-221-2/+2
| | | | | | | | | Several documentation errors have sneaked in here and there. This patch will fix those issues. Pick-to: 6.5 Change-Id: I57beb9a39a06a8302e1e83f91078a8f3c1c50670 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add snippet to demonstrate keyboard navigationAndreas Eliasson2023-01-301-0/+71
| | | | | | | | | | | Add example to showcase keybord navigation for the TableView QML type together with 'current' and 'selected' properties. Fixes: QTBUG-107889 Pick-to: 6.5 6.4 Change-Id: Ie95d85aa09e574bee16c23a2dff27056bc0bcd05 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickTableView: let the edit delegate be a child of the cell delegateRichard Moe Gustavsen2022-12-071-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first version parented the edit delegate to the content item of QQuickTableView. This approach, however, turned out make it really difficult to implement an edit delegate that relied on the geometry of items inside the tableview delegate. E.g for a TreeViewDelegate, we would like to show an editable TextField on top of the label while editing. But only on top of the label, not the whole delegate (including e.g the expanded/collapsed indicator). Moreover, we don't want to hide the whole delegate while editing, only the label that is underneatch (a possible semi-transparent) edit delegate. For this to be possible, we therefore need to parent the edit delegate to the TableView delegate instead, so that the edit delegate can e.g more easily query the geometry of the items inside the delegate (like the label) to position its own items (like a TextField). Since we also want the developer to then have more control over which items get hidden, we offer a property: "required property bool editing" to the tableview delegate. This can be used to e.g hide items inside the delegate while its being edited (or to implement other kinds of transitions). This new solution should also be easier to work with, and understand, for application developers, since the parent-child structure now mirrors the location where the edit delegate is written in QML. Change-Id: Ieeae28c8297f8bb1fb2d90d152fd575b4f41f36f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickTableView: add layoutChanged() signalRichard Moe Gustavsen2022-12-051-0/+46
| | | | | | | | | | | | Add a new signal to TableView that tells when the layout has changed. This signal can be used to reposition any overlay on the content item, including e.g SelectionHandles. [ChangeLog][Quick][TableView] Added new signal 'layoutChanged()' Change-Id: I5b89a064521c2831279accbc889deb768d9b1a1b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: implement TableView.editDelegateRichard Moe Gustavsen2022-12-011-0/+52
| | | | | | | | | | | | | | | | | | | This patch will implement support for editing cells in TableView. It enables you to attach an edit delegate to the tableview delegate, using the attached property TableView.editDelegate. The application can initiate editing by calling TableView.edit() (and TableView.closeEditor()) explicitly, or implicitly by using edit triggers. The EditTriggers enum in TableView mirrors the EditTriggers in QTableView (Widgets). [ChangeLog][Quick][TableView] Added support for editing cells Fixes: QTBUG-108838 Change-Id: I25df93a7eeabf9d8a4c4c6248e020d8eba6d5bd7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@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>
* QQuickTableView: keep selection model and tableview model in syncRichard Moe Gustavsen2022-04-111-3/+1
| | | | | | | | | | | | | | | The source model in the selection model will always need to be the same as the source model in TableView. So TableView might as well forward its own model to the selection model, so that the user don't need to worry about setting the model explicitly. The same is also done in QTableView. Still, it's always possible to force (perhaps by accident?) the two models to be different. To avoid confusion, we choose to print a warning if that happens. Change-Id: I9fec1d3de4cfe83cf28950ebdedd38a010df16a3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* doc: update the selection model snippetRichard Moe Gustavsen2021-06-101-8/+3
| | | | | | | | | Fix up some minor issues in the documentation of selection support in TableView. Pick-to: 6.2 Change-Id: Ica2c0014f4e7f960332c283c1ff83a6b0bdd7df2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Selection support: support setting a QItemSelectionModel on TableViewRichard Moe Gustavsen2021-06-021-0/+96
| | | | | | | | | | | | | | | | | | | | Add support for assigning a QItemSelectionModel to TableView. By doing so, delegate items that has a "required property selected" defined will get this updated according to the state of the selection model. It's essential that the property is defined as "required". If not, the property will simply be ignored by TableView. This is done to ensure that existing applications that already has a "selected" property defined, will continue to work as before, unaffected by the new selection API. [ChangeLog][QtQuick] TableView now supports selections by using an ItemSelectionModel. Task-number: QTBUG-74750 Change-Id: I4f4d75e9e65563b9aab0c54f3aa4aad2f6883952 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-20/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Fix QQuickTableView snippetUlf Hermann2020-02-243-42/+119
| | | | | | | | Use static registration, provide a .pro file, and make it load and show the right file. Change-Id: I949831a399ce00cd8b3d012d8bd4e95a1efcdeb5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: improve Example Usage section of TableViewMitch Curtis2019-04-243-0/+92
| | | | | | | | | - Make two sub-sections: C++ and QML - Add a TableModel example to the QML section Change-Id: Ib391b4c0a78e11f5130944b6ac99e20a5982a453 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Document TableView qml typeRichard Moe Gustavsen2018-09-045-0/+389
Change-Id: Ic6722a3cae6b3b6a3933206f14e0b6f6613609d8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>