Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [solved] MouseArea onReleased signal lost after hiding presented view

    QML and Qt Quick
    1
    2
    1772
    Loading More Posts
    • 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.
    • M
      MichK last edited by

      Hi,

      I would like to present list's item details after double clicking on it and present context menu when item is pressed and held. To do so I define MouseArea in ListView delegate. In MouseArea's onPressAndHold I call method to show context menu and in onDoubleClicked I call method which hides list view and presents item details view.
      This works partially. After double click new view is presented but also context menu appears, so after showing new view onReleased signal is lost. Does anyone know what can be wrong ?
      Here is a code:
      @
      ListView {
      id: listsList
      //...
      delegate: Rectangle {
      //...
      MouseArea {
      anchors.fill: parent
      onPressed: listsList.currentIndex = index
      onPressAndHold: listsListContextMenu.show()
      onDoubleClicked: listsListModel.presentList(listId)
      }
      }
      }

      @

      1 Reply Last reply Reply Quote 0
      • M
        MichK last edited by

        I hid other views setting their visible property to false.
        Now I use opacity property and MouseArea onReleased signal is not lost any more :)
        @
        //Wrong
        //visible: false

        //Right
        opacity: 0
        @

        1 Reply Last reply Reply Quote 0
        • First post
          Last post