From a7aaa84f0c18c150e7d7671663a175d99cad3d49 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Mar 2019 13:37:51 +0100 Subject: qtdiag/Windows: Output all graphics adapters Use the new functionality in the QPA interface. Task-number: QTBUG-50371 Task-number: QTBUG-65882 Change-Id: Id42ae50099fe5064e32dedbe6364254058a0508f Reviewed-by: Oliver Wolff --- src/qtdiag/qtdiag.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp index d07921d07..c7de04de9 100644 --- a/src/qtdiag/qtdiag.cpp +++ b/src/qtdiag/qtdiag.cpp @@ -679,11 +679,15 @@ QString qtDiag(unsigned flags) // On Windows, this will provide addition GPU info similar to the output of dxdiag. if (const QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) { - const QVariant gpuInfoV = ni->property("gpu"); - if (gpuInfoV.type() == QVariant::Map) { - const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString(); - if (!description.isEmpty()) - str << "\nGPU:\n" << description; + const QVariant gpuInfoV = ni->property("gpuList"); + if (gpuInfoV.type() == QVariant::List) { + const auto gpuList = gpuInfoV.toList(); + for (int i = 0; i < gpuList.size(); ++i) { + const QString description = + gpuList.at(i).toMap().value(QStringLiteral("printable")).toString(); + if (!description.isEmpty()) + str << "\nGPU #" << (i + 1) << ":\n" << description << '\n'; + } } } return result; -- cgit v1.2.3