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. Aligning ListView
Forum Updated to NodeBB v4.3 + New Features

Aligning ListView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 417 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.
  • R Offline
    R Offline
    RobM
    wrote on last edited by
    #1

    I have this ListView, and I am trying to figure out how to align it from the right to the left without flipping the items in the list. Here is the code:

        ListView
        {
          anchors.left: label.right
          anchors.top: parent.top
          anchors.right: parent.right
          anchors.bottom: parent.bottom
          orientation: ListView.Horizontal
          width: parent.width
          anchors.rightMargin: control.style.rightPadding ? control.style.rightPadding : control.style.padding
          spacing: 5
          model: presentationManager.guidancePresenter.statusOptionsList
          delegate: IconButton
          {
            id: statusIconButton
            ...
        }
    

    Now when I add the following: LayoutDirection: Qt.RightToLeft it does align the list to the right side, but for some reason it flips the list so that the last item in the list is on the right instead of the left. Is there any way around this without reorganizing the items in the list?

    ODБOïO 1 Reply Last reply
    0
    • R RobM

      I have this ListView, and I am trying to figure out how to align it from the right to the left without flipping the items in the list. Here is the code:

          ListView
          {
            anchors.left: label.right
            anchors.top: parent.top
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            orientation: ListView.Horizontal
            width: parent.width
            anchors.rightMargin: control.style.rightPadding ? control.style.rightPadding : control.style.padding
            spacing: 5
            model: presentationManager.guidancePresenter.statusOptionsList
            delegate: IconButton
            {
              id: statusIconButton
              ...
          }
      

      Now when I add the following: LayoutDirection: Qt.RightToLeft it does align the list to the right side, but for some reason it flips the list so that the last item in the list is on the right instead of the left. Is there any way around this without reorganizing the items in the list?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi
      Your issue is not very clear

      @RobM said in Aligning ListView:

      it does align the list to the right side,

      RowLayout{
       //   layoutDirection: Qt.RightToLeft   :  this will affect the order for the Button and the List, 
         Button{}
         ListView{
         //layoutDirection: Qt.RightToLeft  : this will affect the order of the items in the list
         }
      }
      

      i hope this helps

      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