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

Provide content alignment for Flickable item

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Open
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Quick: Other
    • Labels:
      None

      Description

      There's no clear way to align Flickable item content inside of the the item. For example in some cases ListView content is wanted to be aligned to bottom. It should be possible without changing list ordering like Listview.BottomToTop does.

      So there should be some content alignment property to align Flickable item content. It could be horizontal & vertical alignment properties like Text element has:
      Flickable.contentHorizontalAlignment
      Flickable.contentVerticalAlignment

      Or anchor like Item has:
      Flickable.contentAnchors

      Anchoring might give possibility to anchor content outside the Flickable item. Don't know is that good or bad.

      For the listView bottom alignment issue there's workaround to use topMargin depending of the contentHeight:

          ListView {
              anchors.fill: parent
              model: ListModel {
                  ListElement { name: "first" }
                  ListElement { name: "second" }
                  ListElement { name: "third" }
              }
             topMargin: height-contentHeight
              delegate: Text {
                  width: ListView.view.width
                  text: name
              }
          }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              qtcomsupport Qt Support
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes