aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2020-06-16 17:03:47 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2020-06-17 17:42:01 +0200
commit83fb4f6743860bfb746e6243aad00513d498db4f (patch)
tree816bf1a1d509124c6bfb4fc34cce2a4ed885f40e /tools/qml
parent48e919e9647fd07351be37e1ad7efdda9c550be9 (diff)
Clean up QT_CONFIG(opengl)
Accelerated graphics is now possible without OpenGL support. With this change, a Qt build with -no-opengl can still run Qt Quick with a Vulkan, Metal, or Direct3D backend. Fixes: QTBUG-84027 Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tools/qml')
-rw-r--r--tools/qml/main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 71bd104596..bf1f96b54f 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -282,12 +282,12 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath)
void LoadWatcher::checkForWindow(QObject *o)
{
-#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
+#if defined(QT_GUI_LIB)
if (o->isWindowType() && o->inherits("QQuickWindow"))
haveWindow = true;
#else
Q_UNUSED(o)
-#endif // QT_GUI_LIB && !QT_NO_OPENGL
+#endif // QT_GUI_LIB
}
void quietMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const QString &msg)
@@ -480,7 +480,7 @@ int main(int argc, char *argv[])
QCoreApplication::translate("main", "Run animations off animation tick rather than wall time."));
parser.addOption(fixedAnimationsOption);
QCommandLineOption rhiOption(QStringList() << QStringLiteral("r") << QStringLiteral("rhi"),
- QCoreApplication::translate("main", "Use the Qt graphics abstraction (RHI) instead of OpenGL directly. "
+ QCoreApplication::translate("main", "Set the backend for the Qt graphics abstraction (RHI). "
"Backend is one of: default, vulkan, metal, d3d11, gl"),
QStringLiteral("backend"));
parser.addOption(rhiOption);
@@ -534,7 +534,7 @@ int main(int argc, char *argv[])
if (!customSelectors.isEmpty())
e.setExtraFileSelectors(customSelectors);
-#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
+#if defined(QT_GUI_LIB)
if (qEnvironmentVariableIsSet("QSG_CORE_PROFILE") || qEnvironmentVariableIsSet("QML_CORE_PROFILE")) {
QSurfaceFormat surfaceFormat;
surfaceFormat.setStencilBufferSize(8);
@@ -553,7 +553,6 @@ int main(int argc, char *argv[])
if (parser.isSet(dummyDataOption))
dummyDir = parser.value(dummyDataOption);
if (parser.isSet(rhiOption)) {
- qputenv("QSG_RHI", "1");
const QString rhiBackend = parser.value(rhiOption);
if (rhiBackend == QLatin1String("default"))
qunsetenv("QSG_RHI_BACKEND");