Add option to select folder

This commit is contained in:
WarmUpTill 2022-11-16 22:01:21 +01:00 committed by WarmUpTill
parent 1be2764d7b
commit 034a5255a5
2 changed files with 4 additions and 1 deletions

View File

@ -43,8 +43,10 @@ void FileSelection::BrowseButtonClicked()
QString path;
if (_type == FileSelection::Type::WRITE) {
path = QFileDialog::getSaveFileName(this, "", defaultPath);
} else {
} else if (_type == FileSelection::Type::READ) {
path = QFileDialog::getOpenFileName(this, "", defaultPath);
} else {
path = QFileDialog::getExistingDirectory(this, "", defaultPath);
}
if (path.isEmpty()) {

View File

@ -10,6 +10,7 @@ public:
enum class Type {
READ,
WRITE,
FOLDER,
};
FileSelection(FileSelection::Type type = FileSelection::Type::READ,