| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- // NumberPad.qml
- import QtQuick
- import QtQuick.Controls
- import QtQuick.Layouts
- import Felgo 4.0
- Item {
- property alias txtPassword: passwd_tf
- property alias mlogin: btn_login
- width: 300
- height: 400
- MouseArea {
- anchors.fill: parent
- onClicked: {
- console.log("AppPage clicked!")
- // 在这里添加处理点击事件的逻辑
- //设置屏幕亮度为?
- serial.setLightness(128)
- loginpage.logintimeout = 0
- }
- }
- ColumnLayout {
- anchors.fill: parent
- AppTextField {
- id: passwd_tf
- background: Rectangle {
- color: "lightgray"
- radius: 5
- }
- Layout.alignment: Qt.AlignCenter
- font.pixelSize: 20
- inputMode: inputModePassword
- //readOnly: false
- horizontalAlignment: Qt.AlignLeft
- placeholderText: "请输入密码"
- cursorDelegate: Rectangle {
- visible: false
- }
- }
- GridLayout {
- id: grid
- columns: 3
- columnSpacing: -5
- rowSpacing: -5
- //spacing: 5
- Repeater {
- model: 10
- AppButton {
- flat: false
- width: 50
- height: 50
- text: (index + 1) % 10
- fontBold: true
- backgroundColor: "white"
- onClicked: {
- console.log("text:",text)
- passwd_tf.text += text
- }
- }
- }
- AppButton {
- width: 50
- height: 50
- text: "清空"
- textColor: "black"
- flat: false
- backgroundColor: "white"
- onClicked: {
- passwd_tf.text = ""
- }
- }
- AppButton {
- id: btn_login
- width: 40
- height: 40
- flat: false
- text: "解锁"
- textColor: "white"
- backgroundColor: "green"
- borderColor: "green"
- onClicked: {
- console.log("解锁")
- }
- }
- }
- }
- }
|