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.
|
// On Windows, this will provide addition GPU info similar to the output of dxdiag.
|
||||||
const QVariant gpuInfoV = QGuiApplication::platformNativeInterface()->property("gpu");
|
if (QGuiApplication::platformNativeInterface()) {
|
||||||
if (gpuInfoV.type() == QVariant::Map) {
|
const QVariant gpuInfoV = QGuiApplication::platformNativeInterface()->property("gpu");
|
||||||
const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString();
|
if (gpuInfoV.type() == QVariant::Map) {
|
||||||
if (!description.isEmpty())
|
const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString();
|
||||||
str << "\nGPU:\n" << description << "\n\n";
|
if (!description.isEmpty())
|
||||||
|
str << "\nGPU:\n" << description << "\n\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user