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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.8.0 FF
    • 5.13.0, 5.15.4, 6.4.0 Beta4
    • Core: I/O
    • None
    • Linux/X11
    • ba2f79459 (dev)

      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
      

        1. qtbug77039.zip
          1 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            dfaure_kdab David Faure
            kleint Friedemann Kleint
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes