Skip to content

Commit fcf3631

Browse files
committed
fix: recalculate state on scrollbar policy change
Fixed an issue where scrollbar visibility states were not properly updated when the scroll policy changed. Added a handler for the policyChanged signal to trigger state condition recalculation, ensuring the scrollbar appears/disappears correctly according to policy settings. Influence: 1. Test scrollbar visibility when changing between ScrollBar.AsNeeded, ScrollBar.AlwaysOn, and ScrollBar.AlwaysOff policies 2. Verify scrollbar appears and disappears correctly based on content size and policy settings 3. Check that scrollbar state transitions smoothly when policy changes dynamically 4. Test with different scrollbar orientations (vertical/horizontal) fix: 修复滚动条策略变更时状态未更新的问题 修复了滚动条可见性状态在滚动策略变更时未正确更新的问题。添加了对 policyChanged 信号的处理程序,触发状态条件重新计算,确保滚动条根据策略设 置正确显示/隐藏。 Influence: 1. 测试在 ScrollBar.AsNeeded、ScrollBar.AlwaysOn 和 ScrollBar.AlwaysOff 策略之间切换时的滚动条可见性 2. 验证滚动条根据内容大小和策略设置正确显示和隐藏 3. 检查策略动态变化时滚动条状态转换是否平滑 4. 测试不同滚动条方向(垂直/水平)的情况 PMS: BUG-338239
1 parent fc9ec9e commit fcf3631

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

qt6/src/qml/ScrollBar.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ T.ScrollBar {
4545
onSizeChanged: {
4646
Qt.callLater(() => { __calculateStateConditions() })
4747
}
48+
onPolicyChanged: {
49+
Qt.callLater(() => { __calculateStateConditions() })
50+
}
4851

4952
states: [
5053
State {

0 commit comments

Comments
 (0)