Add checkbox to QFileDialog
Unsolved
General and Desktop
-
I'm calling QFileDialog::getExistingDirectory, but I would like to add a checkbox on the bottom right. What is the best way of doing it?
-
You have to write your own dialog - QFileDialog does not support this.
-
I tried this solution but I don't get how to extract the layout from subclassed QFileDialog.
QGridLayout* mainLayout = dynamic_cast<QGridLayout*>(this->layout());
This doesn't work.
-
How to you execute the dialog? You have to use exec(), not one of the static functions...
-
@Christian-Ehrlicher I'm calling
exec()
, but the thing is thatthis->layout()
returns 0 in my case. I have no idea why is that considering my code looks pretty much the same as in the example here -
Please provide some code.
-
From your "example":
- Are you using QFileDialog::DontUseNativeDialog ? -> I am now! Problem solved - thanks.
Have you tried this?
Make sure, that your this-Pointer is not NULL