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 does not accpect Qt.LeftButton in TableView's header delegate.
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
qml
2 Posts 2 Posters 989 Views 2 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.
  • T Offline
    T Offline
    th.thielemann
    wrote on last edited by p3c0
    #1

    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?

    p3c0P 1 Reply Last reply
    0
    • T th.thielemann

      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?

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

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

      157

      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