Little fix and code cleanup

This commit is contained in:
Filippo Cucchetto 2016-04-05 23:28:19 +02:00
parent c889678be7
commit af0842b8ce
3 changed files with 7 additions and 5 deletions

View File

@ -7,13 +7,14 @@ ApplicationWindow {
width: 400
height: 300
title: "AbstractItemModel"
Component.onCompleted: visible = true
Component {
id: myListModelDelegate
Label { text: "Name:" + name }
}
ListView {
anchors.fill: parent
model: myListModel

View File

@ -1,5 +1,5 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
@ -53,11 +53,11 @@ ApplicationWindow {
id: tableItemDelegateInstance
sourceComponent: {
if (styleData.column === 0 || styleData.column === 1)
return tableTextDelegate
return tableTextDelegate
else if (styleData.column === 2)
return tableButtonDelegate
return tableButtonDelegate
else
return tableTextDelegate
return tableTextDelegate
}
Binding {
target: tableItemDelegateInstance.item

View File

@ -7,6 +7,7 @@ ApplicationWindow {
width: 400
height: 300
title: "SimpleData"
Component.onCompleted: visible = true
ColumnLayout {