QTableView click & doubleClick signals don’t work



  • 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 !



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.