diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2014-11-12 16:04:23 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@digia.com> | 2014-11-13 19:13:54 +0100 |
commit | dd862203365b39de6e78cf77e3016043eb091ae4 (patch) | |
tree | 183566b800fefa5b11be234716299b86c88fc26d | |
parent | 8e8b0dbaec1868944e0a699a4474304b0cae65e9 (diff) | |
download | qtquickcontrols-dd862203365b39de6e78cf77e3016043eb091ae4.tar.gz |
Format TableView's detailed description code snippet.
It doesn't look very nice (missing spaces, several statements per
line).
Change-Id: I2d7de5148498a25e4ade0125e66a64a688da688b
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
-rw-r--r-- | src/controls/TableView.qml | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index df4c941f..fb940c44 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -56,25 +56,42 @@ import QtQuick.Window 2.1 A TableView is similar to \l ListView, and adds scroll bars, selection, and resizable header sections. As with \l ListView, data for each row is provided through a \l model: - \code - ListModel { - id: libraryModel - ListElement{ title: "A Masterpiece" ; author: "Gabriel" } - ListElement{ title: "Brilliance" ; author: "Jens" } - ListElement{ title: "Outstanding" ; author: "Frederik" } - } - \endcode + \code + ListModel { + id: libraryModel + ListElement { + title: "A Masterpiece" + author: "Gabriel" + } + ListElement { + title: "Brilliance" + author: "Jens" + } + ListElement { + title: "Outstanding" + author: "Frederik" + } + } + \endcode You provide title and size of a column header by adding a \l TableViewColumn as demonstrated below. - \code - - TableView { - TableViewColumn{ role: "title" ; title: "Title" ; width: 100 } - TableViewColumn{ role: "author" ; title: "Author" ; width: 200 } - model: libraryModel - } - \endcode + + \code + TableView { + TableViewColumn { + role: "title" + title: "Title" + width: 100 + } + TableViewColumn { + role: "author" + title: "Author" + width: 200 + } + model: libraryModel + } + \endcode The header sections are attached to values in the \l model by defining the model role they attach to. Each property in the model will |