impl open url
This commit is contained in:
parent
dbbc7db31a
commit
7df3e61f9d
@ -5,6 +5,7 @@
|
|||||||
#include "loader/DoricJSLoaderManager.h"
|
#include "loader/DoricJSLoaderManager.h"
|
||||||
#include "utils/DoricUtils.h"
|
#include "utils/DoricUtils.h"
|
||||||
|
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
@ -108,4 +109,15 @@ void DoricNavigatorPlugin::popToRoot(QString jsValueString,
|
|||||||
DoricThreadMode::JS);
|
DoricThreadMode::JS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) {}
|
void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) {
|
||||||
|
getContext()->getDriver()->asyncCall(
|
||||||
|
[jsValueString] { QDesktopServices::openUrl(QUrl(jsValueString)); },
|
||||||
|
DoricThreadMode::UI);
|
||||||
|
|
||||||
|
getContext()->getDriver()->asyncCall(
|
||||||
|
[this, callbackId] {
|
||||||
|
QVariantList args;
|
||||||
|
DoricPromise::resolve(getContext(), callbackId, args);
|
||||||
|
},
|
||||||
|
DoricThreadMode::JS);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user