PDA

View Full Version : QTableView cell deactivation



qutron
6th September 2011, 10:03
Is there any way to be notified about cell deactivation in QTableView?

I'm trying to enable and disable some buttons according to cell current state(activated or deactivated). I'm catching cell activation with clicked(QModelIndex) signal, but I'm wondering if there's similar technique to catch deactivated state.

almboa
6th September 2011, 14:38
QAbstractItemView::selectionModel ()
has the signal
void selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected )

ChrisW67
9th September 2011, 07:27
QItemSelectionModel::currentChanged() might be a better choice. This is the currently active cell rather than the selected cell(s).

klenze
24th November 2011, 14:13
Hi,

I´ve a similar problem. Is there a signal which is emitted, if all cells are deactivated? I want to disable a pushbutton if no cell is activated.

Thanks
Micha

ChrisW67
25th November 2011, 03:10
If by 'deactivated' you mean 'not selected' then the selectionChanged() signal tells you... selected will be empty.

klenze
25th November 2011, 12:50
Yes I mean not selected. I´ll test it.

klenze
28th November 2011, 08:51
Hi,

it works perfect.

Thanks for helping!