diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-10-15 18:14:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-15 19:56:04 +0200 |
commit | 2202beed7146e089dbae1cffa81016fe47d9518b (patch) | |
tree | 323c733566f2741509ce53a3222b448081ccc00c | |
parent | d9af37c1456e3678094b18715b1dae382aa78ee0 (diff) | |
download | qtquickcontrols-2202beed7146e089dbae1cffa81016fe47d9518b.tar.gz |
Some TableView optimization for v4
Ironically we had previous optimizations to force v4 bindings,
which now causes a number of exceptions in the engine.
Some of the bindings have also been simplified.
Change-Id: Iaed0c9dbb2d01aeaed25f2ada571dd8177a5b7c2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r-- | src/controls/TableView.qml | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index 827b1749..39c954bf 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -802,31 +802,29 @@ ScrollView { Loader { id: itemDelegateLoader - width: __column.width + width: columnItem.width height: parent ? parent.height : 0 - visible: __column.visible - sourceComponent: __column.delegate ? __column.delegate : itemDelegate + visible: columnItem.visible + sourceComponent: columnItem.delegate ? columnItem.delegate : itemDelegate // these properties are exposed to the item delegate readonly property var model: listView.model readonly property var modelData: itemModelData property QtObject styleData: QtObject { - readonly property var value: __hasModelRole ? itemModel[role] // Qml ListModel and QAbstractItemModel - : __hasModelDataRole ? modelData[role] // QObjectList / QObject - : modelData != undefined ? modelData : "" // Models without role readonly property int row: rowitem.rowIndex readonly property int column: index - readonly property int elideMode: __column.elideMode - readonly property int textAlignment: __column.horizontalAlignment + readonly property int elideMode: columnItem.elideMode + readonly property int textAlignment: columnItem.horizontalAlignment readonly property bool selected: rowitem.itemSelected readonly property color textColor: rowitem.itemTextColor - readonly property string role: __column.role + readonly property string role: columnItem.role + readonly property var value: itemModel.hasOwnProperty(role) + ? itemModel[role] // Qml ListModel and QAbstractItemModel + : modelData && modelData.hasOwnProperty(role) + ? modelData[role] // QObjectList / QObject + : modelData != undefined ? modelData : "" // Models without role } - - readonly property TableViewColumn __column: columnItem - readonly property bool __hasModelRole: styleData.role && itemModel.hasOwnProperty(styleData.role) - readonly property bool __hasModelDataRole: styleData.role && modelData && modelData.hasOwnProperty(styleData.role) } } onWidthChanged: listView.contentWidth = width |