This commit is contained in:
朱子楚\zhuzi 2024-03-24 22:12:20 +08:00
parent 0ca486dfa1
commit 9d06c6d1e9
6 changed files with 44 additions and 56 deletions

View File

@ -10,6 +10,20 @@
#include <QClipboard>
#include <QTranslator>
FluWindowRegister::FluWindowRegister(QObject *parent):QObject{parent}{
from(nullptr);
to(nullptr);
path("");
}
void FluWindowRegister::launch(const QJsonObject& argument){
FluApp::getInstance()->navigate(path(),argument,this);
}
void FluWindowRegister::onResult(const QJsonObject& data){
Q_EMIT result(data);
}
FluApp::FluApp(QObject *parent):QObject{parent}{
useSystemAppBar(false);
}

View File

@ -9,10 +9,27 @@
#include <QJsonObject>
#include <QQmlEngine>
#include <QTranslator>
#include "FluWindowRegister.h"
#include <QQuickWindow>
#include "stdafx.h"
#include "singleton.h"
/**
* @brief The FluWindowRegister class
*/
class FluWindowRegister : public QObject
{
Q_OBJECT
Q_PROPERTY_AUTO(QQuickWindow*,from)
Q_PROPERTY_AUTO(QQuickWindow*,to)
Q_PROPERTY_AUTO(QString,path);
public:
explicit FluWindowRegister(QObject *parent = nullptr);
Q_INVOKABLE void launch(const QJsonObject& argument = {});
Q_INVOKABLE void onResult(const QJsonObject& data = {});
Q_SIGNAL void result(const QJsonObject& data);
};
/**
* @brief The FluApp class
*/

View File

@ -1,18 +0,0 @@
#include "FluWindowRegister.h"
#include "FluApp.h"
#include <QCoreApplication>
FluWindowRegister::FluWindowRegister(QObject *parent):QObject{parent}{
from(nullptr);
to(nullptr);
path("");
}
void FluWindowRegister::launch(const QJsonObject& argument){
FluApp::getInstance()->navigate(path(),argument,this);
}
void FluWindowRegister::onResult(const QJsonObject& data){
Q_EMIT result(data);
}

View File

@ -1,25 +0,0 @@
#ifndef FLUWINDOWREGISTER_H
#define FLUWINDOWREGISTER_H
#include <QObject>
#include <QQuickWindow>
#include <QJsonObject>
#include "stdafx.h"
/**
* @brief The FluWindowRegister class
*/
class FluWindowRegister : public QObject
{
Q_OBJECT
Q_PROPERTY_AUTO(QQuickWindow*,from)
Q_PROPERTY_AUTO(QQuickWindow*,to)
Q_PROPERTY_AUTO(QString,path);
public:
explicit FluWindowRegister(QObject *parent = nullptr);
Q_INVOKABLE void launch(const QJsonObject& argument = {});
Q_INVOKABLE void onResult(const QJsonObject& data = {});
Q_SIGNAL void result(const QJsonObject& data);
};
#endif // FLUWINDOWREGISTER_H

View File

@ -25,12 +25,7 @@ FluTextBox{
function handleClick(modelData){
control_popup.visible = false
control.itemClicked(modelData)
d.updateText(modelData.title)
}
function updateText(text){
d.flagVisible = false
control.text = text
d.flagVisible = true
control.updateText(modelData.title)
}
function loadData(){
var result = []
@ -137,4 +132,9 @@ FluTextBox{
control_popup.visible = true
}
}
function updateText(text){
d.flagVisible = false
control.text = text
d.flagVisible = true
}
}

View File

@ -24,12 +24,7 @@ FluTextBox{
function handleClick(modelData){
control_popup.visible = false
control.itemClicked(modelData)
d.updateText(modelData.title)
}
function updateText(text){
d.flagVisible = false
control.text = text
d.flagVisible = true
control.updateText(modelData.title)
}
function loadData(){
var result = []
@ -136,4 +131,9 @@ FluTextBox{
control_popup.visible = true
}
}
function updateText(text){
d.flagVisible = false
control.text = text
d.flagVisible = true
}
}