Results 1 to 5 of 5

Thread: problem clear QStringList

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    61
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem clear QStringList

    Hi!
    I need to clear the velf to show only inserted into the first "for".
    when compile and launching program occurs: Segmentation fault.

    Qt Code:
    1. int i = 0;
    2. while (i < list.size()){
    3. if (i <= -1)
    4. break;
    5. if (list.at(i).contains("SPNT",Qt::CaseSensitive)){
    6. qDebug() << "SPNT: " << list.at(i);
    7. i+=1;
    8. }else{
    9. for (int j = i+1, k = 0; j < list.indexOf("SPNT",i); ++j, ++k){
    10. velf.insert(k, list.at(j)); //velf[k] = list[j]; thus also occurs error
    11. }
    12. for (int i = 0; i < velf.size(); ++i)
    13. qDebug() << "VELF: " << velf.at(i);
    14. velf.clear();
    15. i = list.indexOf("SPNT",i);
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 

    Somebody has any idea?
    Thanks.
    Last edited by jaca; 29th May 2008 at 21:55.

Similar Threads

  1. QStringList
    By jaca in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2008, 10:12
  2. QStringList scope problem
    By ht1 in forum Qt Programming
    Replies: 5
    Last Post: 30th November 2007, 19:44
  3. svn problem: help me clear the repository
    By magland in forum General Discussion
    Replies: 1
    Last Post: 26th September 2007, 01:54
  4. QStringList in QObject::connect
    By DPinLV in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2006, 17:01
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.