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. [Solved] How to create such a pattern using QML
QtWS25 Last Chance

[Solved] How to create such a pattern using QML

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 6 Posters 4.1k 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.
  • K Offline
    K Offline
    kamalakshantv
    wrote on 4 Jul 2011, 11:34 last edited by
    #1

    I want to display an element is the below mentioned pattern

    !http://i55.tinypic.com/akigt3.jpg!

    How can I achieve it in QML

    Edit: updated the pattern

    [EDIT: fixed image link, Volker]

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      Zmozie
      wrote on 4 Jul 2011, 12:57 last edited by
      #2

      It should be easy, I would put the circles in an Item for each row and anchor it to the center. Then the middle row just have one less circle and will be layout exactly like that.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kamalakshantv
        wrote on 4 Jul 2011, 13:08 last edited by
        #3

        Thank you, I had used it like that, but wanted to know if it can be displayed like that using grid and repeater.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kenotenshi
          wrote on 4 Jul 2011, 13:10 last edited by
          #4

          You can check out one of my tutorial on my blog where I create circle components and I use a Row coupled with a Repeater ("here":http://bsauts-en.blogspot.com/2011/02/second-qml-tutorial.html)
          From that starting point, it should be easy for you to define 3 Rows.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            huluyige
            wrote on 4 Jul 2011, 15:55 last edited by
            #5

            my workground is just like the one of kenotenshi:

            using repeaters in 3 Rows

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kamalakshantv
              wrote on 5 Jul 2011, 09:14 last edited by
              #6

              I have followed the same. But wanted to know if there was any way to make it using Grid and single repeater. It seems it cannot be done so.

              Thank you all.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DenisKormalev
                wrote on 5 Jul 2011, 11:43 last edited by
                #7

                QtK, it is of course cann not be done with Grid. grid has square cells and in your example cells are hexagonal. So you need something like HexagonalGrid (which of course is not available in Qt, so you need to write by yourself)

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  task_struct
                  wrote on 5 Jul 2011, 12:20 last edited by
                  #8

                  You can create circles dynamicly with JS and position them. On odd rows circles start from x=0, x = circle.width, x = circle.width*2, .., x = circle.width * n and on even rows from x = circle.width / 2, x = circle.width + circle.width/2, ..., x = circle.width * n + circle.width/2. Also you can add spacing in calculations.

                  "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

                  • Linu...
                  1 Reply Last reply
                  0

                  8/8

                  5 Jul 2011, 12:20

                  • Login

                  • Login or register to search.
                  8 out of 8
                  • First post
                    8/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved