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. [SOLVED] Display highlight over the delegate in ListView
QtWS25 Last Chance

[SOLVED] Display highlight over the delegate in ListView

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 791 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.
  • Y Offline
    Y Offline
    Yrchgrchh
    wrote on last edited by
    #1

    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
        }
    }
    

    }@

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

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

      157

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        Yrchgrchh
        wrote on last edited by
        #3

        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]

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

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

          157

          1 Reply Last reply
          0

          • Login

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