I have a problem with adding an extra checkbox to QFileDialog window. I'm talking about the same window which is opened during using QFileDialog::getSaveFileName.
I know how to do this in QT5, I need to make a subclass and set option QFileDialog::DontUseNativeDialog.
How can I do this in QT3?
Because there I don't have QFileDialog::DontUseNativeDialog. In QT3 there are fewer methods to choose.
Is there a similar method or maybe completely different approach to adding this checkbox?
While the static methods (like
getSaveFileName) use native dialogs, you can still subclassQFileDialogand useaddWidgetsmethod to add any widget underneath the file types combo box, i.e. at the bottom of the dialog.This is a very simple example, with a checkbox:
You can test it in a
main:To add a check box in the rightmost position, below the Cancel button, one could try to subclass a
QPushButton(which is the expected type), lay out a check box in it, override thepaintEventwith an empty implementation, so the push button won't be drawn at all (but the check box will).This way the check box can be added as the third argument of
addWidgets:and show up at the bottom right corner of the dialog box.