summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmservices.cpp
blob: f5fd4e4790f15fcfdde5a636ef079c0e2bceca90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include "qwasmservices.h"

#include <QtCore/QUrl>
#include <QtCore/QDebug>

#include <emscripten/val.h>

QT_BEGIN_NAMESPACE

bool QWasmServices::openUrl(const QUrl &url)
{
    emscripten::val::global("window").call<void>("open", url.toString().toJsString(),
                                                 emscripten::val("_blank"));
    return true;
}

QT_END_NAMESPACE