Skip to content

Instantly share code, notes, and snippets.

@penk
Last active June 29, 2021 23:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penk/dea91ab88e3e8c838662 to your computer and use it in GitHub Desktop.
Save penk/dea91ab88e3e8c838662 to your computer and use it in GitHub Desktop.
minimal QtWebEngine example
#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();
}
import QtQuick 2.0
import QtWebEngine 1.0
import QtQuick.Window 2.0
WebEngineView {
width: Screen.width
height: Screen.height
url: 'http://duckduckgo.com'
}
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