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

QFileDialog disables "Create New Folder" button in Documents

    XMLWordPrintable

Details

    Description

      On Vista, if one opens a non-native QFileDialog in "Documents", the "Create New Folder" button is disabled. The native file dialog has the button enabled. QFileInfo returns read and execute permissions only on the folder and that appears to be the reason why the button is disabled.


      Example:

      #include <QtGui>
      #include <stdio.h>
      
      class FileDialog : public QFileDialog
      {
      public:
          FileDialog(QWidget *parent, const QString &caption, const QString &dir)
              : QFileDialog(parent, caption, dir)
          {
              QToolButton *button = findChild<QToolButton *>("newFolderButton");
              button->setEnabled(true);
          }
      };
      
      int main(int argc, char **argv)
      {
          QApplication a(argc, argv);
          const QString path("C:\\Users\\you\\Documents");
          QFileInfo fi(path);
          QFile::Permissions perm = fi.permissions();
          printf("0x%0X", (int)perm);
      
          FileDialog fd(NULL, "foobar", path);
          fd.exec();
          return 0;
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mch Jervey Kong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes