Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    MouseArea does not accpect Qt.LeftButton in TableView's header delegate.

    QML and Qt Quick
    qml
    2
    2
    857
    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.
    • T
      th.thielemann last edited by p3c0

      Within my TableView I use the following headerDelegate:

          Component
          {
              id: headersDel
              Text
              {
                  id: headerItem
                  text: styleData.value
      
                  MouseArea
                  {
                      id: actionArea
                      anchors.fill:parent
                      acceptedButtons: Qt.LeftButton | Qt.RightButton
                      onClicked:
                      {
                          console.log("headerItem.onClicked")
                      }
                  }
              }
      

      But clicks with left mouse button do not create a event. How to achieve this?

      p3c0 1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators @th.thielemann last edited by

        @th.thielemann TableView already has a clicked signal. You can use that.

        157

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