Don't animate TreeView expansions

Some styles set a QStyle::SH_Widget_Animation_Duration. An animation
does not go well with just-in-time population of the expanded content.
This change avoids that for all TreeViews.

Fixes: QTCREATORBUG-24834
Change-Id: I16ca4c61733d8875e713d7349ed6b99ba37ecf74
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2020-10-30 22:19:37 +01:00
parent 7b3accc78e
commit dca5cb4f14

View File

@@ -387,6 +387,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const
if (Utils::HostOsInfo::isMacHost()) if (Utils::HostOsInfo::isMacHost())
ret = QFormLayout::AllNonFixedFieldsGrow; ret = QFormLayout::AllNonFixedFieldsGrow;
break; break;
case QStyle::SH_Widget_Animation_Duration:
if (widget->inherits("QTreeView"))
ret = 0;
break;
default: default:
break; break;
} }