Register QStandardPaths enums & flags
This allows QML StandardPaths to use the same enums without having to duplicate them. Change-Id: Ibfc63a97a8ba31e5c4dc11e3e8fee9d753087c54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
dbea509223
commit
af87bf4b14
@ -41,6 +41,7 @@
|
|||||||
#define QSTANDARDPATHS_H
|
#define QSTANDARDPATHS_H
|
||||||
|
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
|
#include <QtCore/qobjectdefs.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -49,6 +50,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class Q_CORE_EXPORT QStandardPaths
|
class Q_CORE_EXPORT QStandardPaths
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Do not re-order, must match QDesktopServices
|
// Do not re-order, must match QDesktopServices
|
||||||
enum StandardLocation {
|
enum StandardLocation {
|
||||||
@ -73,6 +76,7 @@ public:
|
|||||||
AppConfigLocation,
|
AppConfigLocation,
|
||||||
AppLocalDataLocation = DataLocation
|
AppLocalDataLocation = DataLocation
|
||||||
};
|
};
|
||||||
|
Q_ENUM(StandardLocation)
|
||||||
|
|
||||||
static QString writableLocation(StandardLocation type);
|
static QString writableLocation(StandardLocation type);
|
||||||
static QStringList standardLocations(StandardLocation type);
|
static QStringList standardLocations(StandardLocation type);
|
||||||
@ -82,6 +86,7 @@ public:
|
|||||||
LocateDirectory = 0x1
|
LocateDirectory = 0x1
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(LocateOptions, LocateOption)
|
Q_DECLARE_FLAGS(LocateOptions, LocateOption)
|
||||||
|
Q_FLAG(LocateOptions)
|
||||||
|
|
||||||
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
|
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
|
||||||
static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
|
static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user