Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to cancel the QML menu once it is clicked ?
Qt 6.11 is out! See what's new in the release blog

How to cancel the QML menu once it is clicked ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 334 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pt75234
    wrote on last edited by
    #1

    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
    http://doc.qt.io/qt-5/qtquickcontrols-texteditor-example.html

    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
    work:

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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved