Add QT_QPA_SYSTEM_ICON_THEME to override icon theme name

On a plain X11 desktop, it otherwise ends up empty.

Pick-to: 5.15
Task-number: QTBUG-25351
Task-number: QTBUG-25718
Task-number: QTBUG-74252
Change-Id: I50a522a3e1761e422d5949d5338869ceb9e5e89d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
This commit is contained in:
Shawn Rutledge 2020-05-29 11:25:14 +02:00
parent 4dfaa1d60a
commit d268b91907

View File

@ -79,6 +79,9 @@ QIconLoader::QIconLoader() :
static inline QString systemThemeName()
{
const auto override = qgetenv("QT_QPA_SYSTEM_ICON_THEME");
if (!override.isEmpty())
return QString::fromLocal8Bit(override);
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
const QVariant themeHint = theme->themeHint(QPlatformTheme::SystemIconThemeName);
if (themeHint.isValid())