forked from qt-creator/qt-creator
Utils: Provide FilePath based wrappers for common dialogs
Change-Id: I464a7b5775495f32648905335f2d798384867900 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
#include <QUrl>
|
||||
#include <QXmlStreamWriter> // Mac.
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
#include <QFileDialog>
|
||||
#endif
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
@@ -128,6 +132,32 @@ public:
|
||||
static bool renameFile(const FilePath &srcFilePath, const FilePath &tgtFilePath);
|
||||
|
||||
static void setDeviceFileHooks(const DeviceFileHooks &hooks);
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
static void setDialogParentGetter(const std::function<QWidget *()> &getter);
|
||||
|
||||
static FilePath getOpenFilePath(const QString &caption = {},
|
||||
const FilePath &dir = {},
|
||||
const QString &filter = {},
|
||||
QString *selectedFilter = nullptr,
|
||||
QFileDialog::Options options = {});
|
||||
|
||||
static FilePath getSaveFilePath(const QString &caption = {},
|
||||
const FilePath &dir = {},
|
||||
const QString &filter = {},
|
||||
QString *selectedFilter = nullptr,
|
||||
QFileDialog::Options options = {});
|
||||
|
||||
static FilePath getExistingDirectory(const QString &caption = {},
|
||||
const FilePath &dir = {},
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly);
|
||||
|
||||
static FilePaths getOpenFilePaths(const QString &caption = {},
|
||||
const FilePath &dir = {},
|
||||
const QString &filter = {},
|
||||
QString *selectedFilter = nullptr,
|
||||
QFileDialog::Options options = {});
|
||||
#endif
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user