ServerItem をコンテンツに合わせて成長させる方法は? 現在、ServerItems は互いに重なり合っています。
main.qml
import Qt 4.7
import "Teeworlds" as Teeworlds
Item {
Column {
Teeworlds.ServerItem {
serverName: "InstaGib, lost [xyz]"
}
Teeworlds.ServerItem {
serverName: "Arena.sbor (rus)"
}
}
}
ServerItem.qml
import QtQuick 1.0
BorderImage {
id: serverItem
property string serverName: "unnamed server"
property string gameType: "DM"
property int numPlayers: 0
property int maxPlayers: 8
property int ping: 60
Text {
id: title
text: parent.serverName
}
Grid {
id: grid
anchors.top: title.bottom
columns: 2
rows: 3
Text { text: "Gametype: " } Text { text: gameType }
Text { text: "Players: " } Text { text: numPlayers + "/" + maxPlayers }
Text { text: "Ping: " } Text { text: ping }
}
}