How to implement the browse button functionality as show in the image
-
Is there any standard we can select the path and same can we shown in project location
-
Hi
something like. ( note linux path. :)QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home", QFileDialog::ShowDirsOnly| QFileDialog::DontResolveSymlinks);
-
@Qt-Enthusiast
its just
ui->LineEditName->setText(dir); -
This post is deleted!
-
@Qt-Enthusiast
You cant.
you have to make your own QDialog then.
The QFileDialog cannot be altered. -
Any inputs will help . or if we have similar code that will help
-
@Qt-Enthusiast
Sorry, i have no samples of such dialog as most of us uses
the QFileDialog to look like the platform. -
This post is deleted!
-
Define a custom QDialog, add a QTreeView, set a QFileSystemModel, handle QTreeView selection events to update Directory LineEdit.
For the combobox with recent directory selection you need to save history to disk. You could use QSettings to save this list of Directories. Use a QVector <QString> to store the strings because it is easier to prepend strings at top of the list.
Populate the recent ComboBox with the saved strings.
When you select a directory, make sure it is not in the recent list yet before saving, otherwise just move the existing directory to the first position of the Vector.
I thing this is pretty easy to achieve. Do you have a specific question or problem?