Files
FancyInput-Qt/src/qml/Main.qml
T
2026-08-19 23:18:08 +08:00

70 lines
1.8 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FancyInput.Controls
// 阶段 0:Hello World 骨架
// 窗口尺寸沿用 WPF 主窗 600x480,主题色 #651F65
ApplicationWindow {
id: root
width: 600
height: 480
visible: true
title: qsTr("FancyInput · Qt 迁移版(阶段 0)")
color: Theme.background
ColumnLayout {
anchors.centerIn: parent
spacing: 16
// Logo 占位:后续替换为 WPF 版图标
Rectangle {
Layout.preferredWidth: 96
Layout.preferredHeight: 96
radius: 16
color: Theme.accent
Layout.alignment: Qt.AlignHCenter
Text {
anchors.centerIn: parent
text: "FI"
font.family: Theme.fontFamily
font.pixelSize: 32
font.bold: true
color: "white"
}
}
Label {
Layout.alignment: Qt.AlignHCenter
text: qsTr("FancyInput · Hello Qt")
font.family: Theme.fontFamily
font.pixelSize: 24
font.bold: true
color: Theme.textPrimary
}
Label {
Layout.alignment: Qt.AlignHCenter
text: qsTr("阶段 0:工程骨架跑通")
font.family: Theme.fontFamily
font.pixelSize: 13
color: Theme.textSecondary
}
// 验证主题单例 + 控件可用
Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("点击次数:%1").arg(root.clickCount)
font.family: Theme.fontFamily
onClicked: {
root.clickCount++
console.log("点击次数:", root.clickCount)
}
}
}
property int clickCount: 0
}