[SOLVED] Display highlight over the delegate in ListView



  • Hi All,

    I'm trying to make highlight in ListView overlap delegates.
    Documentation says that the default stacking order of delegate instances is 1 and of highlight is 0. I need to make it vice versa.

    Is that even possible? Next piece of test code doesn't work for me.

    @import QtQuick 2.0

    Rectangle {
    width: 640
    height: 480
    color: "green"

    ListView{
        anchors.fill: parent
        focus: true
        spacing : 5
    
        highlight:  Rectangle {
            width: 200
            height: 100
            color:"red"
    
            z:100
        }
    
        model: 3
        delegate: Rectangle{
            width: 100
            height: 100
            color: "blue"
    
            z:0
        }
    }
    

    }@


  • Moderators

    Hi,

    You code works as expected. Tested with Qt 5.3.1 on Ubuntu 14.04



  • Thanks. I tested it against 5.1.1 and it didn't work. Checked with 5.3 and it's really ok.
    [quote author="p3c0" date="1410776620"]Hi,

    You code works as expected. Tested with Qt 5.3.1 on Ubuntu 14.04[/quote]


  • Moderators

    Good... Then please mark the post as solved.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.