qt - QTableWidget::setCellWidget() disables signals from QTableWidget? -


i have qtablewidget instance cellentered(int,int) signal associated slot x (that higlights row in cell contained). have 1 column containing check boxes.

the problem adding checkboxes cells of table using qtablewidget::setcellwidget() method:

qtablewidgetitem *checkboxitem = new qtablewidgetitem(""); ui->tablewidget->setitem(rowcount, column, checkboxitem); qcheckbox* checkbox = new qcheckbox(); ui->tablewidget->setcellwidget(rowcount, column, checkbox); connect(checkbox, signal(clicked(bool)),     this, slot(checkbox_clicked(bool))); 

makes slot x not called when cursor on cell in column.

the problem not particular check boxes other types of widgets too.

i have read signalmapper class in posts, class seems useful map signal widget slot. instead, problem relative signal table.

any suggestion?

cheers,

pablo

why don't use qtablewidgetitem , set checkable qtablewidgetitem::setcheckstate(qt::checkstate state)?

qtablewidgetitem *check_item = new qtablewidgetitem; check_item->setcheckstate(qt::unchecked); 

you can flags.

check_item->setflags(qt::itemisusercheckable); 

connect qtablewidget::itemchanged(qtablewidgetitem * item) signal slot, , check if item checked there.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -