需要C++端QAbstractItemModel提供方法嗎?



import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQml.Models 2.13
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.13
import haisong 1.0
Window {
id: mainWindow
visible: true
x: 50; y: 50
minimumWidth: 800
minimumHeight: 600
Rectangle {
id: leftView
anchors.fill: parent
color: "white"
TreeView {
id: treeView
anchors.fill: parent
headerVisible: false
backgroundVisible: false
frameVisible: false
model: myModel
rowDelegate: Rectangle {
height: 30
color: "#303030"
}
itemDelegate: Rectangle {
color: "#454545"
height: 30
Text {
id: contentTex
x: 25
color: "white"
anchors.verticalCenter: parent.verticalCenter
text: styleData.value.type + ": " + styleData.value.size
}
}
TableViewColumn {
role: "type"
title: "Type"
}
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/92065.html
標籤:Qt
上一篇:菜鳥求大佬大腿安卓網格布局
