One cell in each row of a QTableWidget contains a combobox
for (each row in table ... ) {
QComboBox* combo = new QComboBox();
table->setCellWidget
Just got same problem and this is how I solved. I use QPoint that is a cleaner way to save a x-y value than a QString. Hope this helps.
classConstructor() {
//some cool stuffs here
tableVariationItemsSignalMapper = new QSignalMapper(this);
}
void ToolboxFrameClient::myRowAdder(QString price) {
QLineEdit *lePrice;
int index;
//
index = ui->table->rowCount();
ui->table->insertRow(index);
//
lePrice = new QLineEdit(price);
connect(lePrice, SIGNAL(editingFinished()), tableVariationItemsSignalMapper, SLOT(map()));
tableVariationItemsSignalMapper->setMapping(lePrice, (QObject*)(new QPoint(0, index)));
// final connector to various functions able to catch map
connect(tableVariationItemsSignalMapper, SIGNAL(mapped(QObject*)),
this, SLOT(on_tableVariationCellChanged(QObject*)));
}
void ToolboxFrameClient::on_tableVariationCellChanged(QObject* coords) {
QPoint *cellPosition;
//
cellPosition = (QPoint*)coords;
}