C++ (Qt)QTableWidgetItem * QTableWidget::item ( int row, int column ) consttableWidget->item(0,2)->text()
C++ (Qt)void usbController::s_buttonUpdate(){ //qDebug() << tableWidget->selectedItems(); QTableWidgetItem *item = new QTableWidgetItem(); int i= tableWidget->selectionModel()->selectedRows().count(); //строка qDebug() << i; int j=0; //столбец QString text; while (j<6) { text=tableWidget->item(i,j)->text(); j++; qDebug() << QString("Items in list: ") << text; } }
C++ (Qt)int i= tableWidget->selectionModel()->selectedRows().count();
C++ (Qt)int usbController::s_buttonUpdate(){ int i= tableWidget->currentRow(); //строка if (tableWidget->selectedItems().isEmpty ()) { return true; } qDebug() << i; //QTableWidget int j=0; //столбец QString tx; while (j<6) { tx=tableWidget->item(i,j)->text(); if (j==0) lineEdit_5->setText(tx); if (j==1) lineEdit_3->setText(tx); if (j==3) lineEdit_1->setText(tx); if (j==4) lineEdit_4->setText(tx); if (j==5) lineEdit_3->setText(tx); if (j==6) lineEdit_2->setText(tx); j++; qDebug() << QString("Items in list: ") << tx; } return true;}
C++ (Qt)if (j==6) lineEdit_2->setText(tx);
C++ (Qt) tableWidget->horizontalHeader()->moveSection(int ,int)