Results 1 to 3 of 3

Thread: qlist error

  1. #1
    Join Date
    Dec 2009
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Wink qlist error

    Hi,

    I am doing following in the attached file 1.txt.

    a) read a list
    b) for each item in the list
    c) run an external process save it in A file
    d) read A file, save modification in B file
    e) thatz it

    and following error occurs.

    ASSERT failure in QList<T>:perator[]: "index out of range", file /opt/qtsdk-2009.02/qt/include/QtCore/qlist.h, line 403

    2.txt is one instance of file 1.txt ( no loop ) and it runs successfully.

    How is it possible to have the loop run successfully modifying the file.
    Please suggest with an example. That will help.

    PS: you will need file queue_output.txt in tmp folder to run this code.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: qlist error

    The error is in here:
    Qt Code:
    1. while(!tFile->atEnd())
    2. {
    3.  
    4. line = tFile->readLine();
    5. QStringList lineWithoutSlashAnne_01 = QString(line).split("\n");
    6.  
    7. lineWithoutSlashAnne_02 = lineWithoutSlashAnne_01[i]; ///<- i is an iterator for queueList and not for the stringlist.
    8. /// And therfor as the error says: i is out of lineWithoutSlashAnne_01 range.
    9. if (lineWithoutSlashAnne_02.contains(QRegExp("^projects")))
    10. {
    11. lineWithoutSlashAnne_02.append(" "+projNm);
    12. // come a line back remove the project line and add this line
    13. qDebug() << "project " << lineWithoutSlashAnne_02;
    14.  
    15. }
    16. out << lineWithoutSlashAnne_02 << endl;
    17. }
    To copy to clipboard, switch view to plain text mode 

    And I don't know what you are doing...

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qlist error

    And I don't know what you are doing...
    He is starting multiple threads on the same subject which starts to annoy me.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Gtk error when installing Qt in linux
    By john_god in forum Installation and Deployment
    Replies: 1
    Last Post: 18th November 2009, 05:08
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  5. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31

Tags for this Thread

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.