Results 1 to 3 of 3

Thread: Run time error related to QList

  1. #1
    Join Date
    Jun 2011
    Posts
    26
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Run time error related to QList

    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..

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Run time error related to QList

    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

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Run time error related to QList

    Run it in the debugger. When it crashes look at the backtrace to find the offending line in your code.

Similar Threads

  1. Replies: 4
    Last Post: 20th August 2010, 13:54
  2. qlist error
    By knishaq in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2009, 13:07
  3. Replies: 0
    Last Post: 6th December 2009, 04:33
  4. is it a C++ error or Qt/Qwt related?
    By jiveaxe in forum Qwt
    Replies: 9
    Last Post: 18th November 2007, 09:24
  5. Compile error related with Qcoreevent
    By Pragya in forum Qt Programming
    Replies: 0
    Last Post: 11th May 2007, 12:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.