2023-05-22 16:17:51 +08:00
|
|
|
#include "WindowHelper.h"
|
2023-02-27 18:46:39 +08:00
|
|
|
|
2023-03-13 21:18:51 +08:00
|
|
|
#include "FluRegister.h"
|
2023-04-11 23:12:31 +08:00
|
|
|
#include "FluApp.h"
|
2023-03-13 21:18:51 +08:00
|
|
|
|
2023-02-27 18:46:39 +08:00
|
|
|
WindowHelper::WindowHelper(QObject *parent)
|
|
|
|
: QObject{parent}
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-04-11 23:12:31 +08:00
|
|
|
void WindowHelper::initWindow(QQuickWindow* window){
|
2023-02-27 23:04:52 +08:00
|
|
|
this->window = window;
|
2023-04-12 00:15:38 +08:00
|
|
|
}
|
|
|
|
|
2023-04-15 09:45:54 +08:00
|
|
|
QVariant WindowHelper::createRegister(QQuickWindow* window,const QString& path){
|
|
|
|
FluRegister *p = new FluRegister(window);
|
|
|
|
p->from(window);
|
2023-03-13 21:18:51 +08:00
|
|
|
p->path(path);
|
|
|
|
return QVariant::fromValue(p);
|
|
|
|
}
|
2023-04-11 23:12:31 +08:00
|
|
|
|
2023-05-11 18:24:58 +08:00
|
|
|
void WindowHelper::deleteWindow(){
|
2023-04-11 23:12:31 +08:00
|
|
|
if(this->window){
|
2023-05-11 18:24:58 +08:00
|
|
|
FluApp::getInstance()->wnds.remove(this->window->winId());
|
2023-04-11 23:12:31 +08:00
|
|
|
this->window->deleteLater();
|
|
|
|
}
|
|
|
|
}
|