如何像QFileDialog得到文件名一样得到目录名?

时间:2023-01-03 22:35:53
就像QFileDialog::getOpenFileNames那样
我想在选择文件对话框中返回目录
该怎么办?

1 个解决方案

#1


try

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

#1


try

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