summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmservices.cpp
blob: e767295e4160c23270b34bddd1502681ab0fd963 (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().toEcmaString(),
                                                 emscripten::val("_blank"));
    return true;
}

QT_END_NAMESPACE