main.qml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Controls
  4. import QtQuick.Controls.Material
  5. ApplicationWindow {
  6. id: mainWindow
  7. width: 800
  8. height: 600
  9. visible: true
  10. GridLayout {
  11. columns: 2
  12. anchors.fill: parent
  13. Column{
  14. anchors.top: parent.top
  15. spacing: 20
  16. Layout.column:0
  17. Layout.row: 0
  18. Rectangle{
  19. Button {
  20. background: null
  21. icon.source: './images/user.png';
  22. onClicked: mainStack.push(Qt.resolvedUrl('UserPage.qml'))
  23. }
  24. }
  25. Button {
  26. icon.source: './images/list.png'; onClicked: mainStack.push(Qt.resolvedUrl('TunnelPage.qml'))
  27. }
  28. Button {
  29. icon.source: './images/appstoreadd.png';
  30. onClicked: mainStack.push(Qt.resolvedUrl('ApplicationPage.qml'))
  31. }
  32. Button {
  33. icon.source: './images/setting.svg'; onClicked: mainStack.push(Qt.resolvedUrl('SettingsPage.qml'))
  34. }
  35. Button {
  36. icon.source: './images/about.png'; onClicked: mainStack.push(Qt.resolvedUrl('AboutPage.qml'))
  37. }
  38. }
  39. // Button {
  40. // Layout.column:0
  41. // Layout.row: 0
  42. // icon.source: './images/user.png';
  43. // onClicked: mainStack.push(Qt.resolvedUrl('UserPage.qml'))
  44. // }
  45. // Button {
  46. // Layout.column:0
  47. // Layout.row:1
  48. // icon.source: './images/list.png'; onClicked: mainStack.push(Qt.resolvedUrl('TunnelPage.qml'))
  49. // }
  50. // Button {
  51. // Layout.column:0
  52. // Layout.row:2
  53. // icon.source: './images/appstoreadd.png';
  54. // onClicked: mainStack.push(Qt.resolvedUrl('ApplicationPage.qml'))
  55. // }
  56. // Button {
  57. // Layout.column:0
  58. // Layout.row:3
  59. // icon.source: './images/setting.svg'; onClicked: mainStack.push(Qt.resolvedUrl('SettingsPage.qml'))
  60. // }
  61. // Button {
  62. // Layout.column:0
  63. // Layout.row:4
  64. // icon.source: './images/about.png'; onClicked: mainStack.push(Qt.resolvedUrl('AboutPage.qml'))
  65. // }
  66. //etc
  67. }
  68. // Drawer {
  69. // id: drawer
  70. // width: mainWindow.width * 0.5
  71. // height: mainWindow.height
  72. // }
  73. StackView {
  74. id: mainStack
  75. anchors.fill: parent
  76. initialItem: Qt.resolvedUrl('UserPage.qml')
  77. }
  78. // Optimize performance and user experience
  79. }