Hi, I am having a strange problem with QFileDialog. Basically i have created a very simple piece of code for test purposes:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QStringList fileNames;
QFileDialog dialog(this);
// dialog.setDirectory("C:\\Qt\\2010.05\\test1\\");
// dialog.setFileMode(QFileDialog::ExistingFiles);
//dialog.setNameFilter(trUtf8("CIFs (*.cif)"));
if (dialog.exec())
fileNames = dialog.selectedFiles();
}
MainWindow::~MainWindow()
{
delete ui;
}
This creates the dialog box when executed but it is very slow to open and there seems to be severe problems with the operation of the dialogbox itself.
Here is a screendump: http://img192.imageshack.us/i/picture1rz.png
So first the 'main window'with the icons is not correct as it is not showing any of the files in the directory indicated and it doesnt update when i change the directory to be 'looked in'using the navigation controls. I also cannot double click on the icons in this window. Note that the lines that are commented out dont seem to cause the problem....
Can someone please help me as i can create my application without being able to select and open multiple files.
Thanks
Matt
Added after 11 minutes:
UPDATE: I have just tried using the static call to QFileDialog:
QString fileName;
fileName = QFileDialog::getOpenFileName(this);
And this produces and entirely different selection window (which looks more like the 'usual' windows dialog and this works correctly, however i cannot with this select and load multiple files????
Bookmarks