ImplicitWidth of ScrollView handle doesn't work
-
wrote on 5 Aug 2023, 07:11 last edited by
In following code, I want width of
ScrollView
handle can be changed whenSplitHandle.hovered
orSplitHandle.pressed
is 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
implitWidth
has no effect. The width of handle is constantly 1. -
wrote on 6 Aug 2023, 16:02 last edited by
I found that the reason why
implicitWidth
doesn't change is that attched properties don't affect binding, that is, whenSplitHandle.hovered
,SplitHandle.pressed
etc are changed,implicitWidth
won't change just like there is noxxxChanged
signal emiited. However,SplitHandle.onHoveredChanged
still makes sense. Is this qt bug?
1/2