How to open a file and directory in QT

I want to open the directory and file using the same function. Is it possible to do the same in QT. I used

QString directory = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
      "",
     QFileDialog::ShowDirsOnly
     | QFileDialog::DontResolveSymlinks);

Here I can only open the directory. How to open a file and directory with one function

+3
source share
2 answers

, , QFileDialog ... , QDirModel. ... "" - QTreeView QDirModel, /. . Dir View Qt Assistant.

EDIT: QFileSystemModel QDirModel. .

+2

Source: https://habr.com/ru/post/1739256/


All Articles