Results 1 to 3 of 3

Thread: Index out of Range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4

    Default Index out of Range

    Hi Friends,

    I am getting an error 'Index out of Range' in this program

    Qt Code:
    1. QDir dir(ImagesDirPath);
    2. dir.setFilter(QDir::Files | QDir::NoSymLinks);
    3. QStringList filters;
    4. filters << "*.xml";
    5. dir.setNameFilters(filters);
    6. dir.setSorting(QDir::Name);
    7.  
    8. QStringList Strlist;
    9. QFileInfoList list = dir.entryInfoList();
    10.  
    11. for (int i = 0; i < list.size(); ++i)
    12. {
    13. QFileInfo fileInfo = list.at(i);
    14. Strlist<<fileInfo.baseName();
    15. }
    16.  
    17. ui.comboBox_2->insertItems(0,Strlist);
    To copy to clipboard, switch view to plain text mode 

    How to solve this?

    Thanks in Advance..
    Last edited by jpn; 19th August 2008 at 12:10. Reason: missing [code] tags

Similar Threads

  1. Replies: 3
    Last Post: 25th July 2008, 14:30
  2. QList index out of range problem
    By MarkoSan in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2008, 08:40
  3. QProcess readStdOut index
    By user_mail07 in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2008, 19:37
  4. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  5. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48

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.