Login.ui.qml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import QtQuick
  2. import QtQuick.Controls
  3. /*
  4. 登录界面要做的事情:
  5. 1.加载数据库
  6. 2.监测网络状态
  7. 3.校验登录密码
  8. */
  9. Rectangle {
  10. id: loginPage
  11. width: Qt.platform.os === "android" ? Screen.width : 320
  12. height: Qt.platform.os === "android" ? Screen.height : 480
  13. color: "#051f58"
  14. radius: 8
  15. border.color: "#ffffff"
  16. property alias loginpwdSelectionColor: loginpwd.selectionColor
  17. clip: true
  18. property alias loginbtn: loginbtn
  19. property alias loginpwd: loginpwd
  20. property alias element: element
  21. property alias timer_time: timer_time
  22. //定时器
  23. Timer {
  24. id: timer_time
  25. interval: 10 //间隔(单位毫秒):1000毫秒=1秒
  26. repeat: true //重复
  27. }
  28. Image {
  29. id: loginimage
  30. source: "../../Res/pic/menu.jpg"
  31. visible: true
  32. anchors.fill: parent
  33. fillMode: Image.PreserveAspectFit
  34. }
  35. Button {
  36. id: loginbtn
  37. text: "登录"
  38. flat: false
  39. font.family: "Arial"
  40. anchors.centerIn: parent
  41. }
  42. Text {
  43. id: element
  44. width: 150
  45. height: 50
  46. anchors.top: parent.top
  47. anchors.horizontalCenter: parent.horizontalCenter
  48. color: "#0dd845"
  49. text: "qsTr(currentDateTime())"
  50. font.bold: false
  51. font.capitalization: Font.MixedCase
  52. style: Text.Normal
  53. font.family: "Tahoma"
  54. transformOrigin: Item.Center
  55. font.pixelSize: 30
  56. }
  57. Rectangle {
  58. border.width: 5
  59. border.color: "white"
  60. width: 150
  61. height: 50
  62. anchors.horizontalCenter: loginbtn.horizontalCenter
  63. anchors.bottom: loginbtn.top
  64. anchors.bottomMargin: 2
  65. TextInput {
  66. id: loginpwd
  67. color: "#000000"
  68. text: "******"
  69. anchors.fill: parent
  70. horizontalAlignment: Text.AlignHCenter
  71. verticalAlignment: Text.AlignVCenter
  72. maximumLength: 24
  73. echoMode: TextInput.Password
  74. font.bold: true
  75. font.pointSize: 20
  76. }
  77. }
  78. }