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

Qdir::filePath()函数文档不对

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.8.0
    • None
    • iOS/tvOS/watchOS

    Description

      QString QDir::filePath(const QString &fileName) const

      Returns the path name of a file in the directory. Does not check if the file actually exists in the directory; but see exists(). If the QDir is relative the returned path name will also be relative. Redundant multiple separators or "." and ".." directories in fileName are not removed (see cleanPath()).

      Qdir::filePath()函数还具有将一个路径和一个文件名称合并的功能。如:

      QDir dst;

      QString s

          dst=QDir("f:/abf/1312"); ,

         s=dst.filePath("e:/abc/file1.txt");

      s=dst.filePath("e:/abc/file1.txt");

      那么s="e:/abc/file1.txt"

      s=dst.filePath("1.txt");

      s="f:/abf/1312/1.txt"

      完全不同的两种结果。而帮助文档上只给出了一种!!!!!!!

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            lgsanfeng Guangjia Song
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: