2023-04-27 17:29:39 +08:00
|
|
|
|
#ifndef FLUTOOLS_H
|
|
|
|
|
#define FLUTOOLS_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QtQml/qqml.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The FluTools class
|
|
|
|
|
*/
|
|
|
|
|
class FluTools : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
QML_NAMED_ELEMENT(FluTools)
|
|
|
|
|
QML_SINGLETON
|
2023-05-11 18:24:58 +08:00
|
|
|
|
private:
|
2023-04-27 17:29:39 +08:00
|
|
|
|
explicit FluTools(QObject *parent = nullptr);
|
2023-05-11 18:24:58 +08:00
|
|
|
|
static FluTools* m_instance;
|
|
|
|
|
public:
|
|
|
|
|
static FluTools *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine)
|
|
|
|
|
{
|
|
|
|
|
return getInstance();
|
|
|
|
|
}
|
|
|
|
|
static FluTools *getInstance();
|
2023-04-27 17:29:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* @brief clipText 将字符串添加到剪切板
|
|
|
|
|
* @param text
|
|
|
|
|
*/
|
|
|
|
|
Q_INVOKABLE void clipText(const QString& text);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief uuid 获取uuid
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
Q_INVOKABLE QString uuid();
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // FLUTOOLS_H
|