NDSFactory/ui/utils/filepicker.h
2024-08-19 17:06:18 +02:00

21 lines
480 B
C

#pragma once
#include <QFileDialog>
QString customSaveFileDialog(const QString& title, const QString& defaultName, const QString& filter)
{
static QString lastUsedPath;
QString selectedPath = QFileDialog::getSaveFileName(
Q_NULLPTR,
title,
lastUsedPath + defaultName,
filter);
if (!selectedPath.isNull())
lastUsedPath = selectedPath.mid(0, selectedPath.lastIndexOf('/', Qt::CaseInsensitive)+1);
return selectedPath;
}