add alert

This commit is contained in:
王劲鹏
2021-04-22 11:43:48 +08:00
committed by osborn
parent 7bcb711dfe
commit 70cf4acd5b
11 changed files with 166 additions and 0 deletions

View File

@@ -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__";

View File

@@ -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;

View 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);
}
}

View 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