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. QTableView click & doubleClick signals don’t work
QtWS25 Last Chance

QTableView click & doubleClick signals don’t work

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 7.8k Views
  • 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
    asdevbeg
    wrote on 21 Mar 2013, 09:44 last edited by
    #1

    I'm trying to make my application to respond to user selecting the QTableView row and perform some furter actions, based on the
    row selected. Everything works fine with the signal activated. It is fired when key ENTER is pressed on the selected row(on Windows). But I'd like
    table to respond also to mouse clicks. For some reason it doesn't work. Please see the connects bellow:

    // table_m is QTableView, it shows data from the model in GUI, works fine

    connect(table_m, SIGNAL ( activated(const QModelIndex&)), this, SLOT ( RowSelected(const QModelIndex&)));
    // this works fine, slot function is called when key ENTER is pressed, I get correct index in the argument passed

    connect(table_m, SIGNAL ( clicked(const QModelIndex&)), this, SLOT ( RowSelected(const QModelIndex&)));
    // this does not work ! Please help.

    connect(table_m, SIGNAL ( doubleClicked(const QModelIndex&)), this, SLOT ( RowSelected(const QModelIndex&)));
    // this does not work either !

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on 27 Mar 2013, 11:14 last edited by
      #2

      The above code works as expected for a test example. Can you share more deails about your implementation.

      1 Reply Last reply
      0

      1/2

      21 Mar 2013, 09:44

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved