Last active
June 29, 2021 23:25
-
-
Save penk/dea91ab88e3e8c838662 to your computer and use it in GitHub Desktop.
minimal QtWebEngine example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtGui/QGuiApplication> | |
#include <QtQml/QQmlApplicationEngine> | |
#include <QtWebEngine/qtwebengineglobal.h> | |
int main(int argc, char *argv[]) | |
{ | |
QGuiApplication app(argc, argv); | |
QtWebEngine::initialize(); | |
QQmlApplicationEngine appEngine; | |
appEngine.load(QUrl("main.qml")); | |
return app.exec(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtWebEngine 1.0 | |
import QtQuick.Window 2.0 | |
WebEngineView { | |
width: Screen.width | |
height: Screen.height | |
url: 'http://duckduckgo.com' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET = browser | |
TEMPLATE = app | |
SOURCES = main.cpp | |
QT += qml quick webengine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment