How to disable a button in a QFileDialog?
Hello,
I have a FileDialog:
Quote:
QString fileName = QFileDialog::getExistingDirectory(this,tr("OPEN DIRECTORY"));
It's created with three buttons by default (Create a new directory, open and cancel). I would like to eliminate the button "Create a new directory" from the FileDialog. How could I do this? Thanks!
Re: How to disable a button in a QFileDialog?
You have to write the custom one in this case.
For reference even style sheet is not applied even if you set it on the main application. :(
Re: How to disable a button in a QFileDialog?
Are you using the native dialog ? If so, you will need platform specific code to do that (Call SHBrowseForFolder with BIF_NONEWFOLDERBUTTON flag). If not, then you can subclass.
Note that BIF_NONEWFOLDERBUTTON is only available on Comdlg V6.0+ (WinXP+)