Verified Commit a058ef6c authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Call QtWebEngine::initialize before creating the QApplication on >= Qt 5.14

parent c8647306
......@@ -36,11 +36,22 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
// Setup QtWebEngine
qputenv("QTWEBENGINE_DIALOG_SET", "QtQuickControls2");
#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0)
QtWebEngine::initialize();
#endif
QApplication app(argc, argv);
QCoreApplication::setOrganizationName("KDE");
QCoreApplication::setOrganizationDomain("mobile.kde.org");
QCoreApplication::setApplicationName("angelfish");
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QtWebEngine::initialize();
#endif
// Command line parser
QCommandLineParser parser;
parser.addPositionalArgument("url", i18n("URL to open"), "[url]");
......@@ -52,10 +63,6 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
// Setup QtWebEngine
qputenv("QTWEBENGINE_DIALOG_SET", "QtQuickControls2");
QtWebEngine::initialize();
// initial url command line parameter
QUrl initialUrl;
if (!parser.positionalArguments().isEmpty())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment