PDA

View Full Version : QTableWidget does not recieve events from cell



yuval-ca
8th April 2008, 11:57
Hi you all,
I'm adding ComboBox widgets and checkbox widgets to QTableWidget using setCellWidget. the problem is that the CellChanged signal is not emited when the user changes the status or the values in the comboboxes. I'm working with QT4.1.4. can anyone enlighten me?
Yuval

jpn
8th April 2008, 17:32
QTableWidget::setCellWidget() is not really meant for that but for a static content. The model-view framework supports checkable items out of the box. For checkable items you use:


item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // make the item checkable
item->setCheckState(Qt::Unchecked); // initialize the checkstate

and to get combo box as editor you reimplement QItemDelegate::createEditor().