O
O
Oleg Seledets2018-06-30 22:45:42
Qt
Oleg Seledets, 2018-06-30 22:45:42

How to check row selection on QTableView?

How can I check if a row is selected in a tableview?
tried like this:

if(ui->tableView->selectionModel()->selectedRows(0).isEmpty())

hung it all on the
on_tableView_clicked event handler

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Seledets, 2018-07-02
@oleja1ee7

QItemSelectionModel *selectModel = ui->tableView->selectionModel();
selectModel->selectedRows().isEmpty()

checking if a string is empty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question