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

QStandardPaths: Possible bug on windows?

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.0 RC2
    • Core: Other
    • None
    • Windows 10 and Mac OS X using Qt 15.5.0RC

    • Windows

    Description

      Hi,

      I use QStandardPaths to retrieve specific folder locations on Mac/Win.
      For testing I wrote this final code below.

      The result on windows is this:
      QDir::separator = "
      "
      QStandardPaths::DesktopLocation = "C:/Users/ademmler/Desktop"

      But I would expect this:
      QStandardPaths::DesktopLocation = "C:\\Users\\ademmler
      Desktop"

      The results on Mac/OS X are fine:
      QDir::separator = "/"
      QStandardPaths::DesktopLocation = "/Users/ademmler/Desktop"

      The minimal code for testing:

      #include <QCoreApplication>
      #include <QStandardPaths>
      #include <QDir>
      #include <QDebug>

      int main(int argc, char *argv[])

      { QCoreApplication a(argc, argv); qDebug() << "QDir::separator = " << QString(QDir::separator()) << Qt::endl; qDebug() << "QStandardPaths::DesktopLocation = " << QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) << Qt::endl; return a.exec(); }

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            ademmler ademmler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes