summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qapplication.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 0b6e0cd8f70..8a041a4ac2c 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3640,7 +3640,9 @@ void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
bool QApplication::isEffectEnabled(Qt::UIEffect effect)
{
CHECK_QAPP_INSTANCE(false)
- return QColormap::instance().depth() >= 16
+ const auto primaryScreenDepth = QGuiApplication::primaryScreen() ?
+ QGuiApplication::primaryScreen()->depth() : 24;
+ return primaryScreenDepth >= 16
&& (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect)
&& (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));
}