Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Add checkbox to QFileDialog
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.
krzysieklfc last edited by krzysieklfc
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...
Please provide some code.
Pl45m4 last edited by
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
@Pl45m4 That solved it. Thanks for help