Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-51062

Section labels in BottomToTop ListView

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • None

      It should be possible to display sections of "bottom to top" oriented ListView like in normal ListVIew, i.e. at the top of the section. Now it displays at the bottom of the section.

      https://forum.qt.io/topic/64000/sections-of-bottom-to-top-oriented-list-view

      An example

      import QtQuick 2.3
      import QtQuick.Window 2.2
      
      Window {
          id: window
          width: 300
          height: listview.contentHeight
          visible: true
      
          ListView {
              id: listview
              anchors.fill: parent
              verticalLayoutDirection: ListView.BottomToTop
              spacing: 20
      
              delegate: Text {
                  text: model.text
              }
      
              section.property: "section"
              section.delegate: Text {
                  color: "red"
                  text: section
                  width: parent.width
                  horizontalAlignment: Text.AlignHCenter
              }
      
              model: ListModel {
                  ListElement { text: "Moi"; section: "2016-02-11" }
                  ListElement { text: "Hello"; section: "2016-02-11" }
                  ListElement { text: "Halo"; section: "2016-02-11" }
      
                  ListElement { text: "Hola"; section: "2016-02-10" }
                  ListElement { text: "Hei"; section: "2016-02-10" }
                  ListElement { text: "Hallo"; section: "2016-02-10" }
      
                  ListElement { text: "Moin"; section: "2016-02-09" }
                  ListElement { text: "Ciao"; section: "2016-02-09" }
                  ListElement { text: "Hej"; section: "2016-02-09" }
              }
          }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jpnurmi J-P Nurmi
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes