PDA

View Full Version : Run time error related to QList



Channareddy
20th June 2011, 07:25
Hi,
I am using QList for creating dynamic QComboBoxes and i am getting run time error as below
ASSERT failure in QList<T>::at: "index out of range", file c:\Qt\2010.05\qt\include/QtCore/../../src/corelib/tools/qlist.h, line 455

This problem is occurring many times in my application.Here is my code which uses QList n combo boxes.

QList<QComboBox *> comboArray;
for (int i = 0; i < 5000; ++i)
comboArray << new QComboBox(this);

previously when i encountered this problem i increased i size from 500 to 5000 but after some time its showing same error.Any help is appreciated.Please help me..:)
Thank you..

nish
20th June 2011, 08:11
the problem is not in this code.. check where you use the list in your code

comboArray[i] or something where i >= 5000 or negetive

ChrisW67
20th June 2011, 08:24
Run it in the debugger. When it crashes look at the backtrace to find the offending line in your code.