Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFile failing on readLine() on Windows
QtWS25 Last Chance

QFile failing on readLine() on Windows

Scheduled Pinned Locked Moved General and Desktop
qfilewindowsreadline
7 Posts 2 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cmulcahy
    wrote on 10 Jun 2015, 20:01 last edited by cmulcahy 6 Oct 2015, 20:02
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Jun 2015, 20:09 last edited by
      #2

      Hi,

      There's something not clear, when you say it doesn't even read one line, do you mean that your application crashes or that the loop is not entered at all ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cmulcahy
        wrote on 10 Jun 2015, 20:18 last edited by
        #3

        Crashes. It successfully passes the

        while (!in.atEnd()) {
        

        and crashes on the next line. On Windows, it goes into "Not Responding" then exits.

        I tried this:

        while (!in.atEnd()) {
                    QMessageBox(QMessageBox::Information, "test", "BEFORE",QMessageBox::Ok).exec();
                    line = in.readLine();
                    QMessageBox(QMessageBox::Information, "test", "AFTER",QMessageBox::Ok).exec();
        ...
        

        On Windows, I get the BEFORE message, then crash. On Mac and Linux, I get BEFORE and AFTER messages for each line in the script and no crash.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Jun 2015, 20:20 last edited by
          #4

          Pretty strange, can you reproduce it with a minimal compilable example ?
          By the way, which version of Qt are you using ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cmulcahy
            wrote on 10 Jun 2015, 21:00 last edited by
            #5

            http://sumrandomguy.com/TestReadLine.zip is the project
            http://sumrandomguy.com/TestReadLine.exe is the compiled output

            Using Qt 5.4

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 10 Jun 2015, 21:01 last edited by
              #6

              Look like its not, the source link at least causes a 404

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cmulcahy
                wrote on 10 Jun 2015, 21:11 last edited by
                #7

                Sorry. Didn't notice my upload failed. It's fixed.

                1 Reply Last reply
                0

                5/7

                10 Jun 2015, 21:00

                • Login

                • Login or register to search.
                5 out of 7
                • First post
                  5/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved