PDA

View Full Version : Set model into treeview



YuriyRusinov
24th December 2012, 10:04
Hello, colleagues !

I make MDi application, and test setting model into treeview such as


QTreeView * tv = new QTreeView;
QAbstractItemModel * radModel = new QStandardItemModel (2*11776, 100000, 0);
tv->setModel (radModel);
QMdiSubWindow * subW = m_mdiArea->addSubWindow (tv);
tv->show ();

But one bug arises
ASSERT failure in QVector<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qvector.h, line 351

If I try to construct model with 10000 columns then all works fine. Where is my error and which way I have to solve this problem ?

wysota
24th December 2012, 11:02
2*11776*100000 = ~2.35*10^9 = ~2G items. Can your computer really handle QStandardItemModel with so many items? Does your machine have more than 16G RAM?

YuriyRusinov
24th December 2012, 11:33
Unfortunately not, I try to control some input items.