import QtQuick
import QtQuick.Controls
ApplicationWindow {
visible: true
width: 400
height: 200
title: "Ejemplo de Menú y MenuItem"
Menu {
id: menu
MenuItem {
text: "Abrir"
onTriggered: {
console.log("Abrir clicado")
}
}
MenuItem {
text: "Guardar"
onTriggered: {
console.log("Guardar clicado")
}
}
MenuItem {
text: "Salir"
onTriggered: {
Qt.quit();
}
}
}
Rectangle {
width: 100
height: 50
color: "lightblue"
anchors.centerIn: parent
MouseArea {
anchors.fill: parent
onClicked: menu.popup()
}
}
}
En este ejemplo, hemos creado un Menu con tres elementos de menú (MenuItem). Cada MenuItem tiene un atributo text que define el texto que se mostrará en el elemento del menú. El evento onTriggered se utiliza para manejar cuando se hace clic en un elemento de menú.
Además, hemos agregado un Rectangle que actúa como un botón para mostrar el menú cuando se hace clic. El menú se muestra utilizando el método popup() en el evento onClicked del MouseArea.

I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Revolutionize your weighing needs with BWER, Iraq’s top provider of weighbridge systems, featuring unparalleled accuracy, durability, and expert installation services.