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

Explicitly document behavior for QFileInfo if file is directory

    XMLWordPrintable

Details

    • 0211dfd92 (dev), cddf6498d (6.7), e409ae4fa (6.6)

    Description

      Despite the name, QFileInfo can also represent a directory. The behavior of methods like QFileInfo::path() can then be confusing, see e.g. https://forum.qt.io/topic/153585/correctly-create-qdir-from-qfileinfo/10

      Suggestion: Make the distinction between (file) object and file in the documentation. This is done already partially. COmpare e.g.

      > Returns the path of the object's parent directory as a QDir object.

      vs

      > Returns the file's path.

      Also, make behavior of https://doc.qt.io/qt-6/qfileinfo.html#absoluteDir more explicit, e.g. with a code snippet.

      Attachments

        For Gerrit Dashboard: QTBUG-120688
        # Subject Branch Project Status CR V

        Activity

          People

            docteam Qt Documentation Team
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: