1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| for(QVector<QString>::iterator itr = sqlResult.begin(); itr != sqlResult.end(); ++itr)
{
QStringList list = (*itr).split("# ");
QTableWidgetItem *id = new QTableWidgetItem();
QTableWidgetItem *titre = new QTableWidgetItem();
QTableWidgetItem *auteur = new QTableWidgetItem();
QTableWidgetItem *contenu = new QTableWidgetItem();
id->setText(list.at(1).toUtf8());
auteur->setText(list.at(2));
titre->setText(list.at(3));
contenu->setText(list.at(4));
extended.tableWidget->insertRow(extended.tableWidget->rowCount());
extended.tableWidget->setItem(extended.tableWidget->rowCount()-1, 0, id);
extended.tableWidget->setItem(extended.tableWidget->rowCount()-1, 1, titre);
extended.tableWidget->setItem(extended.tableWidget->rowCount()-1, 2, auteur);
extended.tableWidget->setItem(extended.tableWidget->rowCount()-1, 3, contenu);
} |
Partager