PDA

View Full Version : QFile dialog, native view



franco.amato
16th February 2010, 19:29
Hi I would like to open a dialog to allow the user to choose a directory.
At the moment I only wrote these line of code:


void ConfigDlg::chooseSrcDir()
{
QFileDialog dialog(this);
dialog.setFileMode( QFileDialog::DirectoryOnly );

dialog.exec();
}

where ConfigDlg inherits from QDialod so:

#ifndef __CONFIGDLG_H__
#define __CONFIGDLG_H__

#include "GeneratedFiles/ui_configDlg.h"
#include <QDialog>

class ConfigDlg : public QDialog
{
Q_OBJECT

public:
ConfigDlg( QWidget *parent );
virtual ~ConfigDlg();

private slots:
void chooseSrcDir();
void chooseOutputDir();

protected:

private:
Ui::configDlg ui;
};

#endif __CONFIGDLG_H__.
The exec doesn't display the dialog in native mode, but in Qt mode, and this is extremely slow on my machine.
How can I force Qt to show the dialog in native mode?

Best Regards,
Frank

Lykurg
16th February 2010, 19:37
Try to use QFileDialog::getExistingDirectory().

franco.amato
17th February 2010, 02:24
Try to use QFileDialog::getExistingDirectory().

I don't know why the dialogs in Qt mode are slower than native mode

Lykurg
17th February 2010, 02:32
I don't know why the dialogs in Qt mode are slower than native mode
me neither but did you get a nativ dialog throug the mentiond static version? Because you normally should.

franco.amato
17th February 2010, 05:15
me neither but did you get a nativ dialog throug the mentiond static version? Because you normally should.

Yes I got it.
Thank you very much