summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-04-16 10:29:04 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-06-03 00:38:32 +0000
commita9227776e05cd21f362b365eee73ab9c7b9f4bd6 (patch)
tree080eacba57b1631de75de7ca07647c5bb5cd57eb
parent1a1cb8f24b0c159305213d0c7f60dfe65f238b18 (diff)
downloadqttools-a9227776e05cd21f362b365eee73ab9c7b9f4bd6.tar.gz
qtdiag: Show more useful information about styles and platform themes
Only listing the names that we're requesting is misleading. It does not show actual capability. Instead, show both what we're requesting and what is available. Change-Id: I0e1a09998253489388abfffd14b5f0eb4315ab77 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/qtdiag/qtdiag.cpp20
-rw-r--r--src/qtdiag/qtdiag.pro2
2 files changed, 17 insertions, 5 deletions
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp
index 71c3d3397..437f11ce9 100644
--- a/src/qtdiag/qtdiag.cpp
+++ b/src/qtdiag/qtdiag.cpp
@@ -64,9 +64,14 @@
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformscreen.h>
#include <qpa/qplatformtheme.h>
+#include <qpa/qplatformthemefactory_p.h>
#include <qpa/qplatformnativeinterface.h>
#include <private/qhighdpiscaling_p.h>
+#ifdef QT_WIDGETS_LIB
+# include <QtWidgets/QStyleFactory>
+#endif
+
#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -469,16 +474,21 @@ QString qtDiag(unsigned flags)
const QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme();
str << "\nTheme:"
- "\n Available : " << platformIntegration->themeNames()
- << "\n Styles : " << platformTheme->themeHint(QPlatformTheme::StyleNames).toStringList();
+ "\n Platforms requested : " << platformIntegration->themeNames()
+ << "\n available : " << QPlatformThemeFactory::keys()
+#ifdef QT_WIDGETS_LIB
+ << "\n Styles requested : " << platformTheme->themeHint(QPlatformTheme::StyleNames).toStringList()
+ << "\n available : " << QStyleFactory::keys()
+#endif
+ ;
const QString iconTheme = platformTheme->themeHint(QPlatformTheme::SystemIconThemeName).toString();
if (!iconTheme.isEmpty()) {
- str << "\n Icon theme : " << iconTheme
+ str << "\n Icon theme : " << iconTheme
<< ", " << platformTheme->themeHint(QPlatformTheme::SystemIconFallbackThemeName).toString()
- << " from " << platformTheme->themeHint(QPlatformTheme::IconThemeSearchPaths).toStringList() << '\n';
+ << " from " << platformTheme->themeHint(QPlatformTheme::IconThemeSearchPaths).toStringList();
}
if (const QFont *systemFont = platformTheme->font())
- str << "\n System font : " << *systemFont<< '\n';
+ str << "\n System font : " << *systemFont<< '\n';
if (platformTheme->usePlatformNativeDialog(QPlatformTheme::FileDialog))
str << " Native file dialog\n";
diff --git a/src/qtdiag/qtdiag.pro b/src/qtdiag/qtdiag.pro
index 1dacd9c0b..b9b3c6e56 100644
--- a/src/qtdiag/qtdiag.pro
+++ b/src/qtdiag/qtdiag.pro
@@ -1,6 +1,8 @@
CONFIG += console
QT += core-private gui-private
+qtHaveModule(widgets): QT += widgets
+
qtHaveModule(network) {
QT += network
DEFINES += NETWORK_DIAG