Answer the question
In order to leave comments, you need to log in
How to insert values from ButtonWidget into current row of TableWidget?
A ButtonWidget button (with a specific action) was created in one form and placed in a TableWidget of another form, they are connected via a Signal, the question is: how, when this button was pressed, the action of this button was performed exactly in the line where this button was created::
Here is the data are entered only in the row I selected
void MainWindow::slotForm7(QString a)
{
for(int stroka = 0; stroka < ui->tableWidget->rowCount(); stroka++)
for(int stolb = 0; stolb < ui->tableWidget ->columnCount(); stolb++)
{
QTableWidgetItem *item7 = new QTableWidgetItem(); // allocate memory for the cell
item7->setText(QString(a).arg(stroka).arg(stolb)); // insert text
ui->tableWidget->setItem(ui->tableWidget-> currentRow() , 6, item7); // insert cell
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question