Good Morning, I have to open a window by cliking in the menu how I do?
catturaMenu.jpg

this is My QML:

Qt Code:
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.5
  3. import QtQuick.Layouts 1.12
  4.  
  5. ApplicationWindow {
  6. id: window
  7. width: 500
  8. height: 500
  9.  
  10.  
  11.  
  12. visible:true
  13.  
  14. Rectangle {
  15. id: rectangle
  16. color: "#212126"
  17. anchors.fill: parent
  18. }
  19.  
  20.  
  21. header: ToolBar {
  22.  
  23. background:Rectangle
  24. {
  25. implicitHeight: 40
  26. color: "beige"
  27. }
  28.  
  29.  
  30.  
  31. RowLayout {
  32. anchors.fill: parent
  33. ToolButton {
  34. text: qsTr("‹")
  35. onClicked: stackView.pop()
  36. }
  37. Label {
  38. text: "App Paolo"
  39. elide: Label.ElideRight
  40. horizontalAlignment: Qt.AlignHCenter
  41. verticalAlignment: Qt.AlignVCenter
  42. Layout.fillWidth: true
  43. }
  44. ToolButton {
  45. text: qsTr("?")
  46. onClicked: {
  47. menu.x = (window.width - menu.width) / 1
  48. menu.y = 10
  49. menu.open()}
  50. }
  51. }
  52. }
  53.  
  54. ListModel {
  55. id: pageModel
  56. ListElement {
  57. title: "Riparazioni"
  58. page: "Riparazioni.qml"
  59. }
  60. ListElement {
  61. title: "Magazzino"
  62. page: "Magazzino.qml"
  63. }
  64. }
  65. StackView {
  66. id: stackView
  67. anchors.fill: parent
  68. // Implements back key navigation
  69. focus: true
  70. // //Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) {
  71. // stackView.pop();
  72. // event.accepted = true;
  73. // }
  74.  
  75. initialItem: Item {
  76. width: parent.width
  77. height: parent.height
  78. ListView {
  79. model: pageModel
  80. anchors.fill: parent
  81. delegate: AndroidDelegate {
  82. text: title
  83. onClicked: stackView.push(Qt.resolvedUrl(page))
  84. }
  85. }
  86. }
  87. }
  88. StackView {
  89. id: stack
  90. anchors.fill: parent
  91. }
  92.  
  93. Menu {
  94. id: menu
  95.  
  96. MenuItem{
  97. text: "Settings"
  98. onClicked: { //Open View help me tank
  99.  
  100.  
  101. }
  102.  
  103.  
  104. }
  105. }
  106.  
  107.  
  108.  
  109.  
  110.  
  111. }
To copy to clipboard, switch view to plain text mode