Results 1 to 4 of 4

Thread: Missng last lines when read file wth readLine()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Missng last lines when read file wth readLine()

    Hi, i'm trying to read a entire file:

    Qt Code:
    1. QFile lista(path);
    2. if(!lista.open(QFile::ReadOnly))
    3. {
    4. QMessageBox msgBox;
    5. msgBox.setText(tr("Could not open file.(2)"));
    6. msgBox.setStandardButtons(QMessageBox::Ok);
    7. msgBox.exec();
    8. } else {
    9. QTextStream strim(&lista);
    10.  
    11. while(!lista.atEnd()) {
    12. qDebug() << strim.readLine();
    13. }
    14. }
    15. lista.close();
    To copy to clipboard, switch view to plain text mode 

    But i can't read the last lines, it never read the last lines of files, sometimes 50, sometimes 100,.....

    What can be wrong??
    Last edited by aguayro; 20th August 2012 at 02:22.

Similar Threads

  1. Autorepeat within eventfilter
    By Patrick_Bao in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2010, 07:37
  2. Replies: 6
    Last Post: 14th October 2010, 06:58
  3. QTreeWidget and eventFilter
    By luoyes in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 06:38
  4. sceneEventFilter or eventFilter
    By zgulser in forum Qt Programming
    Replies: 7
    Last Post: 4th May 2009, 07:50
  5. paintEvent in eventFilter
    By kernel_panic in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 20:59

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.