gistfile1.txt
Raw
import QtQuick 1.0
import QtQuick.Controls 1.0
import MeeGo 1.0
ApplicationWindow {
id: appWindow
visible: true
width: 400
height: 600
property string instanceUrl: "https://cmx-im.000010086.xyz"
property variant timelineData: [] // 使用 variant 来存储时间线数据
PageStack {
id: pageStack
anchors.fill: parent
Page {
id: previewPage
anchors.fill: parent
color: "lightgray"
Column {
anchors.fill: parent
spacing: 10
Text {
text: "Public Timeline of " + appWindow.instanceUrl
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
}
// 显示时间线内容
ListView {
id: timelineView
anchors.fill: parent
model: appWindow.timelineData
delegate: Item {
width: timelineView.width
height: 50
Text {
text: modelData
anchors.verticalCenter: parent.verticalCenter
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10
Button {
text: "Login"
onClicked: {
// 跳转到登录页面 (未实现)
}
}
Button {
text: "Change Instance"
onClicked: {
// 在这里可以实现切换实例地址的逻辑
}
}
}
}
}
}
}
| 1 | import QtQuick 1.0 |
| 2 | import QtQuick.Controls 1.0 |
| 3 | import MeeGo 1.0 |
| 4 | |
| 5 | ApplicationWindow { |
| 6 | id: appWindow |
| 7 | visible: true |
| 8 | width: 400 |
| 9 | height: 600 |
| 10 | |
| 11 | property string instanceUrl: "https://cmx-im.000010086.xyz" |
| 12 | property variant timelineData: [] // 使用 variant 来存储时间线数据 |
| 13 | |
| 14 | PageStack { |
| 15 | id: pageStack |
| 16 | anchors.fill: parent |
| 17 | |
| 18 | Page { |
| 19 | id: previewPage |
| 20 | anchors.fill: parent |
| 21 | color: "lightgray" |
| 22 | |
| 23 | Column { |
| 24 | anchors.fill: parent |
| 25 | spacing: 10 |
| 26 | |
| 27 | Text { |
| 28 | text: "Public Timeline of " + appWindow.instanceUrl |
| 29 | font.bold: true |
| 30 | anchors.horizontalCenter: parent.horizontalCenter |
| 31 | } |
| 32 | |
| 33 | // 显示时间线内容 |
| 34 | ListView { |
| 35 | id: timelineView |
| 36 | anchors.fill: parent |
| 37 | model: appWindow.timelineData |
| 38 | |
| 39 | delegate: Item { |
| 40 | width: timelineView.width |
| 41 | height: 50 |
| 42 | |
| 43 | Text { |
| 44 | text: modelData |
| 45 | anchors.verticalCenter: parent.verticalCenter |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | Row { |
| 51 | anchors.horizontalCenter: parent.horizontalCenter |
| 52 | spacing: 10 |
| 53 | |
| 54 | Button { |
| 55 | text: "Login" |
| 56 | onClicked: { |
| 57 | // 跳转到登录页面 (未实现) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | Button { |
| 62 | text: "Change Instance" |
| 63 | onClicked: { |
| 64 | // 在这里可以实现切换实例地址的逻辑 |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 |