PDA

View Full Version : facing a trouble on QFileDialog



Askar
6th March 2010, 13:58
Dear Friends,
I want to reduce the size of QFileDialog , i tried using setFixedsize(x,y) function but the dialog size is not changing. the code is given below.


QFileDialog *file = new QFileDialog;
file->setFixedSize(320,240);
const QString fileName = file->getOpenFileName(this, Open File"),currentPath());

thanks

Regards Askar

aamer4yu
8th March 2010, 09:45
getOpenFileName is a static function. It will call the native dialog. So am afraid you might not be able to resize it. Am not sure though.

augusbas
8th March 2010, 11:22
Us the below code and try it



QFileDialog dlg;
dlg.setWindowTitle("Open");
dlg.setAcceptMode(QFileDialog::AcceptOpen);

dlg.setFileMode(QFileDialog::AnyFile);
dlg.setViewMode(QFileDialog::List);
dlg.setDirectory("/");
dlg.resize(320,240);
dlg.exec();