Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Highlight sizing



  • Hello,
    I would like to change the Highlight size (width and height) but I can't change the size it still depends on the delegate size.

    Here is the my highlight component :

            Component {
                id: highlight
                Rectangle {
                    height: 50
                    width: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    radius: height/6
                    color: "#b3b3b3"
    
                }
            }
    


  • @DavidM29 really ? ... are you sure ? the code i send you in your previous post :

    https://forum.qt.io/topic/94722/handle-the-highlight-of-listview/20

    you can fully customize the highlight.



  • @LeLev
    Yes when I use this code which is the one you gave me :

        width: listView.currentItem.width/10; height: listView.currentItem.height
    

    The Highlight start like that :
    0_1537367201700_a72b6ccc-4022-4474-a858-c62697dac821-image.png

    then it turn like that with an animation :
    0_1537367248883_c9660eff-ee75-4011-b45b-08be78462688-image.png

    At strat it fill the delagate

    I believe it is because I have to keep the highlightFollowsCurrentItem property to true. But if I change this I'll have trouble as soon as the ListView will scroll on the press of one button.
    Here is what its looks like :
    0_1537368401189_bug.gif


Log in to reply