FluentUI/src/WindowHelper.h
2023-05-11 18:24:58 +08:00

45 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef WINDOWHELPER_H
#define WINDOWHELPER_H
#include <QObject>
#include <QQuickWindow>
#include <QtQml/qqml.h>
#include <QQuickItem>
#include <QWindow>
#include <QJsonObject>
/**
* @brief The WindowHelper class
*/
class WindowHelper : public QObject
{
Q_OBJECT
QML_NAMED_ELEMENT(WindowHelper)
public:
explicit WindowHelper(QObject *parent = nullptr);
/**
* @brief initWindow FluWindow中初始化调用
* @param window
*/
Q_INVOKABLE void initWindow(QQuickWindow* window);
/**
* @brief deleteWindow 销毁窗口释放资源QML中的Window close并不会销毁窗口只是把窗口隐藏了
*/
Q_INVOKABLE void deleteWindow();
/**
* @brief createRegister 创建一个FluRegsiter对象在FluWindow中registerForWindowResult方法调用
* @param window
* @param path
* @return
*/
Q_INVOKABLE QVariant createRegister(QQuickWindow* window,const QString& path);
private:
QQuickWindow* window;
};
#endif // WINDOWHELPER_H