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. ListView's Highlight Rectangle Height
Qt 6.11 is out! See what's new in the release blog

ListView's Highlight Rectangle Height

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.4k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have this listview:

    @ListView {
    id: list1
    x: -1
    y: 14
    width: modalList.width - 20
    height: modalList.height - 20
    anchors.horizontalCenter: parent.horizontalCenter
    clip: false
    z: 1
    visible: true
    anchors.top: modalList.top
    anchors.bottom: parent.bottom
    highlight: Rectangle { color: "#b5b5b5"; radius: 5; height: 80; width: modalList.width; clip: false; anchors.horizontalCenter: parent.horizontalCenter }
    highlightMoveDuration: 250
    highlightMoveSpeed: 450
    focus: true
    spacing: 12
    snapMode: ListView.SnapToItem

         model: innerModel
    
         delegate: Text {
             x:10
             y:10
             clip: true
             text: name
             color: "#333333"
             verticalAlignment: Text.AlignVCenter
             horizontalAlignment: Text.AlignHCenter
             font.pixelSize:36
             font.bold: true
             font.family: "Arial"
         }@
    

    And despite the fact that I set my highlight rectangle to be 80 pixels tall it always just takes on the height of the letters being displayed in the list. Any ideas on why I cannot control this? I have full control over width.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      Highlight is controlled by list, so if you want to have bigger highlight you need to have bigger list elements. As I see you don't set their height, maybe it will help?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        How do I control the size of the list items?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          list item=delegate

          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