Results 1 to 9 of 9

Thread: Problem with QList

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QList

    false in both cases.. hmmm

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

    Default Re: Problem with QList

    Is the code you posted the exact code you use?
    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.


  3. #3
    Join Date
    Feb 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QList

    Qt Code:
    1. void CodebookCreator::loadImages(QString &dir, QStringList &files)
    2. {
    3. QDir::setCurrent(dir);
    4. QStringList::iterator i = files.begin();
    5. while (i != files.end()) {
    6. if (QFile::exists(*i)) {
    7. QImage img(*i);
    8. images << img;
    9. i++;
    10. } else {
    11. QMessageBox::warning(0, "Datei nicht gefunden",
    12. "Datei " + *i + " konnte nicht geladen werden.");
    13. i++;
    14. }
    15. }
    16. }
    To copy to clipboard, switch view to plain text mode 

    thats it.

    only the header file differs.

    Qt Code:
    1. QList<QImage> images;
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. QVector<QImage> images;
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Problem with QList

    And it works with vector but not with a list?
    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.


  5. #5
    Join Date
    Feb 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QList

    I tested it again. It works with both, i just misinterpreted the debug output ... i'm not very experienced with my IDE, sorry for that.

    br
    Garg

Similar Threads

  1. Sorting using qSort(), - if QList contains POINTERS
    By joseph in forum Qt Programming
    Replies: 13
    Last Post: 18th August 2013, 18:55
  2. QList, copy problems
    By Valheru in forum Qt Programming
    Replies: 4
    Last Post: 5th February 2010, 00:06
  3. Destroying a QList the right way
    By Cruz in forum Newbie
    Replies: 1
    Last Post: 19th January 2009, 10:52
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. QList problem
    By acix in forum General Programming
    Replies: 6
    Last Post: 29th April 2006, 13:08

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.