mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-03 16:45:24 +08:00
update
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <QFile>
|
||||
#include <QColor>
|
||||
#include <QtQml/qqml.h>
|
||||
#include "singleton.h"
|
||||
|
||||
/**
|
||||
* @brief The FluTools class
|
||||
@ -12,71 +13,39 @@
|
||||
class FluTools : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QML_NAMED_ELEMENT(FluTools)
|
||||
QML_SINGLETON
|
||||
private:
|
||||
explicit FluTools(QObject *parent = nullptr);
|
||||
static FluTools* m_instance;
|
||||
public:
|
||||
static FluTools *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine)
|
||||
{
|
||||
return getInstance();
|
||||
}
|
||||
static FluTools *getInstance();
|
||||
|
||||
SINGLETONG(FluTools)
|
||||
static FluTools *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();}
|
||||
Q_INVOKABLE int qtMajor();
|
||||
|
||||
Q_INVOKABLE int qtMinor();
|
||||
|
||||
Q_INVOKABLE bool isMacos();
|
||||
|
||||
Q_INVOKABLE bool isLinux();
|
||||
|
||||
Q_INVOKABLE bool isWin();
|
||||
|
||||
Q_INVOKABLE void clipText(const QString& text);
|
||||
|
||||
Q_INVOKABLE QString uuid();
|
||||
|
||||
Q_INVOKABLE QString readFile(const QString& fileName);
|
||||
|
||||
Q_INVOKABLE void setQuitOnLastWindowClosed(bool val);
|
||||
|
||||
Q_INVOKABLE void setOverrideCursor(Qt::CursorShape shape);
|
||||
|
||||
Q_INVOKABLE void restoreOverrideCursor();
|
||||
|
||||
Q_INVOKABLE QString html2PlantText(const QString& html);
|
||||
|
||||
Q_INVOKABLE QString toLocalPath(const QUrl& url);
|
||||
|
||||
Q_INVOKABLE void deleteItem(QObject *p);
|
||||
|
||||
Q_INVOKABLE QString getFileNameByUrl(const QUrl& url);
|
||||
|
||||
Q_INVOKABLE QRect getVirtualGeometry();
|
||||
|
||||
Q_INVOKABLE QString getApplicationDirPath();
|
||||
|
||||
Q_INVOKABLE QUrl getUrlByFilePath(const QString& path);
|
||||
|
||||
Q_INVOKABLE QColor colorAlpha(const QColor&,qreal alpha);
|
||||
|
||||
Q_INVOKABLE QString md5(QString text);
|
||||
|
||||
Q_INVOKABLE QString sha256(QString text);
|
||||
|
||||
Q_INVOKABLE QString toBase64(QString text);
|
||||
|
||||
Q_INVOKABLE QString fromBase64(QString text);
|
||||
|
||||
Q_INVOKABLE bool removeDir(QString dirPath);
|
||||
|
||||
Q_INVOKABLE bool removeFile(QString filePath);
|
||||
|
||||
Q_INVOKABLE void showFileInFolder(QString path);
|
||||
|
||||
};
|
||||
|
||||
#endif // FLUTOOLS_H
|
||||
|
Reference in New Issue
Block a user