0
만 한 행 볼 수있는 TableView :QML : 다음 코드에서 행 및 항목 대표
Rectangle{
width: { parent==null ? 640: parent.width }
height: { parent==null ? 480: parent.height }
Image {
id: mainBackground
anchors.fill: parent
source: "qrc:///wallDiscoveryBackground"
fillMode: Image.PreserveAspectFit
TableView {
id: wallDiscoveryTable
anchors.margins: parent.width * 0.6
width: parent.width
clip: true
model: discoveredWallsTableModel
TableViewColumn { role: "name"; width: 240; title: "Name" }
TableViewColumn { role: "ipAddress"; width: 240; title: "IP Address" }
TableViewColumn { role: "status"; width: 240; title: "Status" }
rowDelegate: wallDiscoveryRowDelegate //comment out
itemDelegate: wallDiscoveryItemDelegate //comment out
}
Component {
id: wallDiscoveryRowDelegate
Rectangle {
width: wallDiscoveryTable.width
height: 640
}
}
Component {
id: wallDiscoveryItemDelegate
Text {
anchors.verticalCenter: parent.verticalCenter
color: styleData.textColor
text: styleData.value
}
}
}
}
나는 행과 항목 대표 (나는 "// 주석"로 표시 한 선을 설정하는 줄을 주석 경우) 그러면 테이블이 올바르게 렌더링되어 지정한 모델이 옳다는 것을 나타냅니다. 그러나 행 및 항목 대리자를 설정할 때 렌더링 된 테이블의 첫 번째 행만 가져옵니다.
다른 사람이 두 번째 경우 (행 및 항목 대리인 포함)에서 잘못된 점을 지적 할 수 있습니까?
네가 맞아! 나는 지금 어리 석다. :피 – balajeerc