Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ImplicitWidth of ScrollView handle doesn't work
Forum Updated to NodeBB v4.3 + New Features

ImplicitWidth of ScrollView handle doesn't work

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 171 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kamichanw
    wrote on 5 Aug 2023, 07:11 last edited by
    #1

    In following code, I want width of ScrollView handle can be changed when SplitHandle.hovered or SplitHandle.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.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kamichanw
      wrote on 6 Aug 2023, 16:02 last edited by
      #2

      I found that the reason why implicitWidth doesn't change is that attched properties don't affect binding, that is, when SplitHandle.hovered, SplitHandle.pressed etc are changed, implicitWidth won't change just like there is no xxxChanged signal emiited. However, SplitHandle.onHoveredChanged still makes sense. Is this qt bug?

      1 Reply Last reply
      0

      1/2

      5 Aug 2023, 07:11

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved