Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get the mouse event on tablewidget(row /column) selection area?
Forum Updated to NodeBB v4.3 + New Features

How to get the mouse event on tablewidget(row /column) selection area?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 288 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    Hi, I need to capture the event of selecting the rows/columns from QTableWidget. I am able to get the selected rows/ columns through the function
    QModelIndexList rowList = ui->m_TableWidget->selectionModel()->selectedRows();
    QModelIndexList colList = ui->m_TableWidget->selectionModel()->selectedColumns(); but i need a mouse point when this event is occured.
    Any help is much appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which mouse point are you after ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Which mouse point are you after ?

        P Offline
        P Offline
        Pkhm325
        wrote on last edited by Pkhm325
        #3

        @SGaist mouse button clicked/pressed event. I am able to get mouse clicked event inside QTableWdget but outside the cells. I need a point on vertical/horizontal header. Installed event filter on QTableWidget
        ui->m_TableWidget->viewport()->installEventFilter( this ); and capturing the events by overriding the eventfilter function

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then also install the event filter on the headers.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          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