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. Gridview / Grid - How to implement the following with a model
QtWS25 Last Chance

Gridview / Grid - How to implement the following with a model

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlgridviewgridmodelflickable
5 Posts 2 Posters 1.5k 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.
  • N Offline
    N Offline
    Nagarjun
    wrote on last edited by Nagarjun
    #1

    Hi all,

    I need to implement the following in qml. I am new to QML and qt.

    gridview_model.jpg

    As shown in the image, The alternative rows should be in a different layout (left to right / right to left).
    I tried implementing this with Gridview. But if i change the layout direction of one row its changing the whole Gridview's layout for all the rows. So how to implement this image in QML ?

    Is there any way to implement in Gridview or does QML have some container to do this ?
    And also I need to show the arrows in between those grids. The final output should look same as the image.
    Kindly help me here.

    Thanks.

    ODБOïO 1 Reply Last reply
    0
    • N Nagarjun

      Hi all,

      I need to implement the following in qml. I am new to QML and qt.

      gridview_model.jpg

      As shown in the image, The alternative rows should be in a different layout (left to right / right to left).
      I tried implementing this with Gridview. But if i change the layout direction of one row its changing the whole Gridview's layout for all the rows. So how to implement this image in QML ?

      Is there any way to implement in Gridview or does QML have some container to do this ?
      And also I need to show the arrows in between those grids. The final output should look same as the image.
      Kindly help me here.

      Thanks.

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

      @Nagarjun hi

      can you explain a bit more what you want to implement?
      you can make similar layout like this but by default it is not in the order you want

       GridLayout{
              anchors.fill: parent
              columns: 6
              Repeater{
                  model: 21
                  Rectangle{
                     Layout.rowSpan: index === 0 ? 4 : 1
                      height: 40
                      width: height
                      color: "blue"
                      Text {
                          anchors.centerIn: parent
                          text: index
                      }
                  }
              }
          }
      

      maybe see QML Flow type

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nagarjun
        wrote on last edited by
        #3

        @LeLev

        I want to show page where the items are displayed exactly as shown on the image attached.

        The Grid will have multiple rectangles and the rows are displayed in the following order.
        For example: If the grid has 4 rows, then 1st row will be represented as flow from left to right. The 2nd row will be represented as flow from right to left. Then 3rd row Left to right and 4th row as right to left. (Check attached image for row representation)

        And also I have to represent the arrows in between the items as shown in picture.

        ODБOïO 1 Reply Last reply
        0
        • N Nagarjun

          @LeLev

          I want to show page where the items are displayed exactly as shown on the image attached.

          The Grid will have multiple rectangles and the rows are displayed in the following order.
          For example: If the grid has 4 rows, then 1st row will be represented as flow from left to right. The 2nd row will be represented as flow from right to left. Then 3rd row Left to right and 4th row as right to left. (Check attached image for row representation)

          And also I have to represent the arrows in between the items as shown in picture.

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

          @Nagarjun did you try my example? all you have to add to it is a function to show the correct numbers and the arrows.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Nagarjun
            wrote on last edited by
            #5

            Hi @LeLev,

            I tried your solution. Its showing the image. That is fine.
            Now if i have more elements then its filling in the same space.
            I need to scroll thorough the screen to see the elements.
            How to do that ? How should I use Flickable in this case.

            Note: For example: If the screen layout is 500x500, and each element size id 50x50,
            then i should only see 16 elements initially. I have to scroll down on the screen to see the remaining elements.

            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