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. MouseArea clicked and pressed does not get emited

MouseArea clicked and pressed does not get emited

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 2.0k 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.
  • A Offline
    A Offline
    AleksandarJovanov
    wrote on last edited by
    #1

    This is my mouse area code :
    @MouseArea {
    id: toolbarMouseArea
    width: toolbar.width; x : 0
    height: toolbar.height; y : 0

        hoverEnabled: true
        onEntered:
        {
            toolbar.state = "visible";
        }
        onExited:
        {
            if(autoHides) toolbar.state = "hidden";
            else toolbar.state = "visible";
        }
        onPressed: console.log("pressed")
        onClicked: console.log("clicked")
    }@
    

    My problem is that clicked and pressed signals do not get emited when I click on the toolbar surface
    This does not work neither with auto hidden toolbar or always visible.
    Please help.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Neutron Stein
      wrote on last edited by
      #2

      use @anchors.fill : parent@

      Never Seen !

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AleksandarJovanov
        wrote on last edited by
        #3

        @Neutron Stein,
        that did not change anything
        Cliks are still not registered.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AleksandarJovanov
          wrote on last edited by
          #4

          There seems to be a problem with some other parts of my code.
          The mouse area works when that gets commented out.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Neutron Stein
            wrote on last edited by
            #5

            The full code please

            Never Seen !

            1 Reply Last reply
            0
            • C Offline
              C Offline
              chriadam
              wrote on last edited by
              #6

              It can be due to focus handling. If something else above the MouseArea accepts certain user-input events, then they will not be delivered to the MouseArea underneath. It can also be due to the "inherited enable" property - if a child of an Item accepts input events, but the parent item has the enabled property set to false, no events will be handled by the parent item or any of its children. I believe.

              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