add alert
This commit is contained in:
@@ -28,6 +28,8 @@ const QString DoricConstant::TEMPLATE_CONTEXT_DESTROY =
|
||||
const QString DoricConstant::GLOBAL_DORIC = "doric";
|
||||
const QString DoricConstant::DORIC_CONTEXT_INVOKE = "jsCallEntityMethod";
|
||||
const QString DoricConstant::DORIC_TIMER_CALLBACK = "jsCallbackTimer";
|
||||
const QString DoricConstant::DORIC_BRIDGE_RESOLVE = "jsCallResolve";
|
||||
const QString DoricConstant::DORIC_BRIDGE_REJECT = "jsCallReject";
|
||||
|
||||
const QString DoricConstant::DORIC_ENTITY_RESPONSE = "__response__";
|
||||
const QString DoricConstant::DORIC_ENTITY_INIT = "__init__";
|
||||
|
@@ -25,6 +25,8 @@ public:
|
||||
static const QString GLOBAL_DORIC;
|
||||
static const QString DORIC_CONTEXT_INVOKE;
|
||||
static const QString DORIC_TIMER_CALLBACK;
|
||||
static const QString DORIC_BRIDGE_RESOLVE;
|
||||
static const QString DORIC_BRIDGE_REJECT;
|
||||
|
||||
static const QString DORIC_ENTITY_RESPONSE;
|
||||
static const QString DORIC_ENTITY_CREATE;
|
||||
|
23
doric-Qt/doric/utils/DoricDialogOnAcceptedBridge.cpp
Normal file
23
doric-Qt/doric/utils/DoricDialogOnAcceptedBridge.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "DoricDialogOnAcceptedBridge.h"
|
||||
#include "plugin/DoricModalPlugin.h"
|
||||
|
||||
#include <QQuickWindow>
|
||||
|
||||
DoricDialogOnAcceptedBridge::DoricDialogOnAcceptedBridge(QObject *parent)
|
||||
: QObject(parent) {}
|
||||
|
||||
void DoricDialogOnAcceptedBridge::onClick(QString windowPointer,
|
||||
QString pluginPointer,
|
||||
QString callbackId) {
|
||||
{
|
||||
QObject *object = (QObject *)(windowPointer.toULongLong());
|
||||
QQuickWindow *window = dynamic_cast<QQuickWindow *>(object);
|
||||
window->deleteLater();
|
||||
}
|
||||
|
||||
{
|
||||
QObject *object = (QObject *)(pluginPointer.toULongLong());
|
||||
DoricModalPlugin *modalPlugin = dynamic_cast<DoricModalPlugin *>(object);
|
||||
modalPlugin->onAccept(callbackId);
|
||||
}
|
||||
}
|
16
doric-Qt/doric/utils/DoricDialogOnAcceptedBridge.h
Normal file
16
doric-Qt/doric/utils/DoricDialogOnAcceptedBridge.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef DORICDIALOGONACCEPTEDBRIDGE_H
|
||||
#define DORICDIALOGONACCEPTEDBRIDGE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class DoricDialogOnAcceptedBridge : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DoricDialogOnAcceptedBridge(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE
|
||||
void onClick(QString windowPointer, QString pluginPointer,
|
||||
QString callbackId);
|
||||
};
|
||||
|
||||
#endif // DORICDIALOGONACCEPTEDBRIDGE_H
|
Reference in New Issue
Block a user