diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-13 13:37:51 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-14 15:21:57 +0000 |
commit | a7aaa84f0c18c150e7d7671663a175d99cad3d49 (patch) | |
tree | eb4df85bdf59c38ef6048221e16e6a00a3bcdca5 | |
parent | b4597180191734ca128772d2b8547c6e6c08efa2 (diff) | |
download | qttools-a7aaa84f0c18c150e7d7671663a175d99cad3d49.tar.gz |
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 <oliver.wolff@qt.io>
-rw-r--r-- | src/qtdiag/qtdiag.cpp | 14 |
1 files 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; |