Ashot Ashot -4 years ago 212
C++ Question

QTableWidget change selection mode

When clicking on

QTableWidget
cell, it selects only the cell. How to configure tablewidget, so that when click on a cell , the whole row will be selected which contains the cell?

It can be done using signal,slots. I'm curious is there standard way doing it?

Answer Source

Simply use setSelectionBehaviour

QTableView * tmp = new QTableView();
tmp->setSelectionBehavior(QAbstractItemView::SelectRows);

http://doc.qt.io/qt-5/qabstractitemview.html#SelectionBehavior-enum

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download