Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77039

QSaveFile::size() reports 0 after writing a file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      When porting from QFile:

           QSaveFile sf(path);
              if (sf.open(QIODevice::WriteOnly)) {
                  sf.write("Hello\n");
                  ok = sf.commit();
                  if (ok)
                      qDebug() << "Wrote " << sf.size() << " bytes to " << path;
              }
      

      prints

      Wrote  0  bytes to  "/tmp/test.txt"
      Empty filename passed to function
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                dfaure_kdab David Faure
                Reporter:
                kleint Friedemann Kleint
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes