Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.5.3
-
None
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; }