Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "qdesigner.h"
5#include <QtCore/qlibraryinfo.h>
6#include <QtCore/qdir.h>
7#include <QtCore/qoperatingsystemversion.h>
8
9#include <stdlib.h>
10
12
13static const char rhiBackEndVar[] = "QSG_RHI_BACKEND";
14
15int main(int argc, char *argv[])
16{
17 // Enable the QWebEngineView, QQuickWidget plugins on Windows.
18 if (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::Windows
19 && !qEnvironmentVariableIsSet(rhiBackEndVar)) {
20 qputenv(rhiBackEndVar, "gl");
21 }
22
23 // required for QWebEngineView
24 QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
25
26 QDesigner app(argc, argv);
27 switch (app.parseCommandLineArguments()) {
28 case QDesigner::ParseArgumentsSuccess:
29 break;
30 case QDesigner::ParseArgumentsError:
31 return 1;
32 case QDesigner::ParseArgumentsHelpRequested:
33 return 0;
34 }
35 QGuiApplication::setQuitOnLastWindowClosed(false);
36
37 return QApplication::exec();
38}
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77
QDesigner(int &argc, char **argv)
Definition qdesigner.cpp:58
static QT_USE_NAMESPACE const char rhiBackEndVar[]
Definition main.cpp:13