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

QFileDialog::getOpenFileNames returns filenames with slash, not backslash in Windows XP

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.2
    • None
    • Windows XP, Windows 7

    Description

      In Windows XP calling of QFileDialog::getOpenFileNames returns filenames with slash, not backslash as awaited.
      for example we see in DbgView
      "C:/Documents and Settings/qq/Local Settings/Application Data/Google/Chrome/Application/chrome.exe"

      In Windows 7 it returns filenames with backslash as awaited.
      for example we see in DbgView
      "C:\Documents and Settings\qq\Local Settings\Application Data\Google\Chrome\Application\chrome.exe"

      ...
      QString curdir;
      QDir::setCurrent(curdir);
      QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select files"),
          curdir,
          tr("Any file (*.*)"));
      
      if (fileNames.count()<=0)
          return;
      
      QStringList lstNotAddFiles;
      
      for(int i=0;i<fileNames.count();++i) {
          QString	fileName = fileNames.at(i);		
      
          qDebug() << fileName;
      }
      ...
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              pet Aleks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes