Does this work on your system?
#include <QApplication>
#include <QTableWidget>
const int nRows = 10;
const int nCols = 10;
int main( int argc, char **argv )
{
tw.setColumnCount( nCols );
for( int i = 0; i < nRows; ++i ) {
tw.insertRow( i );
for( int j = 0; j < nCols; ++j ) {
tw.setItem( i, j, item );
}
}
tw.show();
return app.exec();
}
#include <QApplication>
#include <QTableWidget>
const int nRows = 10;
const int nCols = 10;
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QTableWidget tw;
tw.setColumnCount( nCols );
for( int i = 0; i < nRows; ++i ) {
tw.insertRow( i );
for( int j = 0; j < nCols; ++j ) {
QTableWidgetItem *item = new QTableWidgetItem( QString("(%1,%2)").arg(i).arg(j));
tw.setItem( i, j, item );
}
}
tw.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks