Kylin/Fluent/Utilities.h
2024-08-23 00:04:16 +08:00

27 lines
672 B
C++

#ifndef UTILITIES_H
#define UTILITIES_H
#include <QObject>
#include <QQmlEngine>
#include <QQuickWindow>
class Utilities : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
static Utilities *instance();
static Utilities *create(QQmlEngine *, QJSEngine *);
Q_INVOKABLE int windowBuildNumber();
Q_INVOKABLE bool isWindows11OrGreater();
Q_INVOKABLE bool isWin();
Q_INVOKABLE bool isMacos();
Q_INVOKABLE QRect desktopAvailableGeometry(QQuickWindow *window);
Q_INVOKABLE QUrl getUrlByFilePath(const QString &path);
protected:
Utilities(QObject *parent = nullptr);
};
#endif // UTILITIES_H