Qt 6.11 is out! See what's new in the release
blog
ImplicitWidth of ScrollView handle doesn't work
-
In following code, I want width of
ScrollViewhandle can be changed whenSplitHandle.hoveredorSplitHandle.pressedis true.import QtQuick import QtQuick.Controls SplitView { id: control handle: Rectangle { id: splitViewHandle implicitWidth: SplitHandle.hovered || SplitHandle.pressed ? 4 : 1 implicitHeight: implicitWidth color: SplitHandle.hovered || SplitHandle.pressed ? "#0078D4" : "#313131" Behavior on color { ColorAnimation { duration: 130 } } containmentMask: Item { height: splitViewHandle.height width: 10 x: (splitViewHandle.width - width) / 2 } } }However, it seems that my binding for
implitWidthhas no effect. The width of handle is constantly 1. -
I found that the reason why
implicitWidthdoesn't change is that attched properties don't affect binding, that is, whenSplitHandle.hovered,SplitHandle.pressedetc are changed,implicitWidthwon't change just like there is noxxxChangedsignal emiited. However,SplitHandle.onHoveredChangedstill makes sense. Is this qt bug?