Fix crash in dumpConfiguration
Some qpa backends do not provide a QPlatformNativeInterface. Hence, check whether return value is valid. Change-Id: Iab46bc59a151aa244fcfebf58edb37496369db89 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
4d07042c70
commit
1e1eddb2de
@ -157,11 +157,13 @@ static void dumpConfiguration(QTextStream &str)
|
||||
}
|
||||
|
||||
// On Windows, this will provide addition GPU info similar to the output of dxdiag.
|
||||
const QVariant gpuInfoV = QGuiApplication::platformNativeInterface()->property("gpu");
|
||||
if (gpuInfoV.type() == QVariant::Map) {
|
||||
const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString();
|
||||
if (!description.isEmpty())
|
||||
str << "\nGPU:\n" << description << "\n\n";
|
||||
if (QGuiApplication::platformNativeInterface()) {
|
||||
const QVariant gpuInfoV = QGuiApplication::platformNativeInterface()->property("gpu");
|
||||
if (gpuInfoV.type() == QVariant::Map) {
|
||||
const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString();
|
||||
if (!description.isEmpty())
|
||||
str << "\nGPU:\n" << description << "\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user