I am stucked at the combination of QTableWidget + QComboBox.
As showing in the screenshot, what I want is that, whenever I want insert new item inside table after hitting ADD button, new row should be inserted into the table and at the end I want Drop Down box with text of Allow and Block.
webFilterCat = new QTableWidget(0);
webFilterCat -> verticalHeader()->setDefaultSectionSize(15);
webFilterCat -> setMaximumWidth(310);
webFilterCat -> setMinimumWidth(310);
webFilterCat -> setMaximumHeight(170);
webFilterCat -> setMinimumHeight(170);
/* Set Row and Column Count*/
//webFilterCat->setRowCount(10);
webFilterCat->setColumnCount(3);
/* Table Header */
tableHeader<<"Category"<<"Status"<<"Action";
webFilterCat -> setHorizontalHeaderLabels(tableHeader);
webFilterCat -> horizontalHeader()->setDefaultSectionSize(100);
// ------ Insert Data -------
webFilterCat->insertRow ( webFilterCat->rowCount() );
webFilterCat->setItem(( webFilterCat->rowCount() -1 ), 0, new QTableWidgetItem(extName));
webFilterCat -> setItem(( webFilterCat->rowCount() -1 ), 1, new QTableWidgetItem("Block"));
webFilterCat -> setCellWidget ( ( webFilterCat->rowCount() -1 ), 2, new QComboBox( webFilterCat ) );
I am getting QComboBox at every row after adding item into table but I cant set label (i.e. Allow or Block) to QComboBox and How to access that perticular row after value is changed in QComboBox.
I am using qt 4.2 and compiling code using linux terminal.
In short not using qt creator , using command line qt.