for(int i = 1; i < 53; i++){
TableW->setItem(i-1, 0, t_Items[i-1]);
TableW->setItem(i-1, 1, p_Items[i-1]);
TableW->setItem(i-1, 3, s_Items[i-1]);
TableW->setItem(i-1, 4, i_Items[i-1]);
}
for(int i = 1; i < 53; i++){
t_Items << new QTableWidgetItem(QString("%1").arg(i));
p_Items << new QTableWidgetItem(QString("55 - %1").arg(i));
s_Items << new QTableWidgetItem(QString("milliseconds: %1 ms").arg(i));
i_Items << new QTableWidgetItem(QString("Description %1").arg(i));
TableW->setItem(i-1, 0, t_Items[i-1]);
TableW->setItem(i-1, 1, p_Items[i-1]);
TableW->setItem(i-1, 3, s_Items[i-1]);
TableW->setItem(i-1, 4, i_Items[i-1]);
}
To copy to clipboard, switch view to plain text mode
So I am trying to use a loop, I am adding some information onto the QTableWidget.
There are already 55 rows available, and I'm adding them onto the table, but for some reason, the program usually crashes.
all the t_Items and other Items are QList<QTableWidgetItem *>
Bookmarks