QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCFileDialogController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QUrl>
5#include <QtQmlIntegration/QtQmlIntegration>
6
7class QGCFileDialogController : public QObject
8{
9 Q_OBJECT
10 QML_ELEMENT
11 QML_SINGLETON
12
13public:
14 explicit QGCFileDialogController(QObject *parent = nullptr);
16
18 Q_INVOKABLE static QStringList getFiles(const QString &directoryPath, const QStringList &nameFilters);
19
22 Q_INVOKABLE static QString fullyQualifiedFilename(const QString &directoryPath, const QString &filename, const QStringList &nameFilters = QStringList());
23
25 Q_INVOKABLE static bool fileExists(const QString &filename);
26
28 Q_INVOKABLE static void deleteFile(const QString &filename);
29
30 Q_INVOKABLE static QString urlToLocalFile(QUrl url);
31
35 Q_INVOKABLE static QString fullFolderPathToShortMobilePath(const QString &fullFolderPath);
36
39 Q_INVOKABLE void importFromNativePicker();
40
41signals:
44 void fileImported(const QString& filePath);
45
48 void importFailed(const QString& errorMessage);
49
50private:
51#ifdef Q_OS_ANDROID
52 void _handleImportResult(const QString& filePath);
53#endif
54};
void fileImported(const QString &filePath)
static Q_INVOKABLE bool fileExists(const QString &filename)
Check for file existence of specified fully qualified file name.
static Q_INVOKABLE QString fullFolderPathToShortMobilePath(const QString &fullFolderPath)
static Q_INVOKABLE QString urlToLocalFile(QUrl url)
static Q_INVOKABLE void deleteFile(const QString &filename)
Deletes the file specified by the fully qualified file name.
static Q_INVOKABLE QStringList getFiles(const QString &directoryPath, const QStringList &nameFilters)
Return all file in the specified path which match the specified extension.
Q_INVOKABLE void importFromNativePicker()
static Q_INVOKABLE QString fullyQualifiedFilename(const QString &directoryPath, const QString &filename, const QStringList &nameFilters=QStringList())
void importFailed(const QString &errorMessage)