PDA

View Full Version : extending native-style QFileDialog



tangens
10th February 2010, 16:46
is there any means of extending (=adding widgets to) the native style QFileDialog?

I'm working on Windows and would like to use the native(!) look of the QFileDialog for letting the user export some data.
However I would like to add some controls on it to let them customize the export:
basically adding a QLabel and a QComboBox.

In Win32 or MFC you can do this by using SetTemplate for example.

I already tried adding a control like this:



QFileDialog *exportDialog = new QFileDialog();
QLabel *label = new QLabel(exportDialog);
label->setText("New label");
QGridLayout *layout = (QGridLayout*)exportDialog->layout();
layout->addWidget(label, 0, 0);
exportDialog->setModal(true);
exportDialog->show();


but this apparently turns off the native look.
Is there anyway to do this or is it just impossible?

Thanks!

wysota
19th February 2010, 12:16
The native dialog is only used from within the static methods of QFileDialog so you can't customize it. If you want a custom native file dialog, use native API for the whole dialog.