How to create File dialog with Tree view?
-
Tree view directory selection dialog use following code @QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home",
QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks);@But This dialog was display in center of the PC manitor. So i write Qfiledialog class with treeview option
like@QFileDialog dialog(this->ui.tabWidget);
dialog.setWindowTitle("Select "+ui.label_3->text());
QFileSystemModel *model = new QFileSystemModel(this);
model->setResolveSymlinks(true);QTreeView *tree = new QTreeView();
//tree->setModel(model);
//dialog.findChild(tree)
dialog.exec();@i select directory on File dialog box. But File dialog box have display from Tree view style.
-
Hi,
If can look int "QDirModel":http://qt-project.org/doc/qt-4.8/qdirmodel.html#details and "QFileSystemModel":http://qt-project.org/doc/qt-4.8/qfilesystemmodel.html examples. But your question is still not clear what exactly is your requirement. If you have implemented some code then kindly provide it so that it will be more clear for us to understand .
Regards
SoumitraEDIT: Thanks for the code previously it was just displaying "KK"