Qt6 topics merged with General

How to cancel the QML menu once it is clicked ?

  • I have tried many QT5.5 QML examples which have menu, they
    all have the same problem: can not cancel the menu once
    it was clicked, unless you click a menuitem.

    One of the examples is listed as

    Moreover, once you clicked the menu, and you move the main
    application window, the pending menu will stay wherever it
    was anchored on the screen(not moved with the main window).

    I have also tried using MouseArea under menu, but did not

    Menu {
    id: id_FileMenu
    title: qsTr("File")
    MouseArea {
    anchors.fill: parent
    hoverEnabled: true
    onExited: {
    console.log("Exited Menu.");

Log in to reply