QTableWidget 的每一行中的一个单元格包含一个组合框
for (each row in table ... ) {
QComboBox* combo = new QComboBox();
table->setCellWidget(row,col,combo);
combo->setCurrentIndex(node.type());
connect(combo, SIGNAL(currentIndexChanged(int)),this, SLOT(changed(int)));
....
}
在处理函数 ::changed(int index) 我有
QComboBox* combo=(QComboBox*)table->cellWidget(_row,_col);
combo->currentIndex()
取回组合框的副本并获取新的选择。
但我无法获得行/列。
None of the table cellXXXX signals is emitted when an embedded item is selected or changed and currentRow()/currentColumn() aren't set.