diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-04-09 11:40:10 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-04-24 11:40:06 +0000 |
commit | 2821172d514469f99301c3592eec941db9ebc438 (patch) | |
tree | 4bb0244cb73328325629bcadb6d44f9dc10d7b46 /src/quick/items/qquicktableview.cpp | |
parent | 4d098132421fe75492d61d270569c2d8a7acbdde (diff) |
Doc: improve Example Usage section of TableView
- 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>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index fc7516ec66..5437b54b78 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -76,14 +76,23 @@ \section1 Example Usage + \section2 C++ Models + The following example shows how to create a model from C++ with multiple columns: - \snippet qml/tableview/tablemodel.cpp 0 + \snippet qml/tableview/cpp-tablemodel.cpp 0 And then how to use it from QML: - \snippet qml/tableview/tablemodel.qml 0 + \snippet qml/tableview/cpp-tablemodel.qml 0 + + \section2 QML Models + + For prototyping and displaying very simple data (from a web API, for + example), \l TableModel can be used: + + \snippet qml/tableview/qml-tablemodel.qml 0 \section1 Reusing items |