j is parameter of for loop. Look my first post on this topic
No, I don't do anything with it. Just use for indexing. Still, have no idea. Very odd...
Does this work on your system?Qt Code:
#include <QApplication> #include <QTableWidget> const int nRows = 10; const int nCols = 10; int main( int argc, char **argv ) { QTableWidget tw; 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(); }To copy to clipboard, switch view to plain text mode
Yes, it runs OK. Funny, though, I've noticed some other things about my code for qtablewidget. For some iterations, qtablewidgets prints ok, and for some input not. I understand that strings are most suspicious, but, i've printed them with cout in console, and they are OK, just as they should be. Plus, if I just replace j with zero, code runs well. If I changed just index of rows, then strings aren't problem. Am I wright?
i've printed tempName.toStdString()
Then try printing tr(tempName.toLatin1()).toStdString(). Maybe it gets translated to an empty string?
Bookmarks