PDA

View Full Version : QStandardItemModel limits



baray98
6th April 2008, 17:13
folks,

I used a QStandardItemModel to display a bunch of numbers.. and found that my apps crush if the number of items (row) is really big like 25000.

so i was wondering if QStandardItemModel has limitation in rows or its the QTableView has limitation by the way i used QTableView as my viewer.....

baray98

wysota
6th April 2008, 19:42
Can you provide a minimal compilable example reproducing the problem?

baray98
7th April 2008, 08:27
#include <QtGui>

#include <QPushButton>


int main (int argc,char *argv[])
{
QApplication app(argc,argv);

QStandardItemModel model;
QTableView view;
view.setModel(&model);
for (int row = 0 ; row <20000 ; row++)
{
QStandardItem* item = new QStandardItem(row+1);
model.setItem(row, 0, item);
}
view.show();

return app.exec();
}

baray98
7th April 2008, 09:51
I got my error ... its passing an integer when i created QStandardItem