Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Which layout is the most suitable for this situation?
Forum Updated to NodeBB v4.3 + New Features

Which layout is the most suitable for this situation?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 964 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    i want to add 1 control in the 1st row, and 3 controls in the 2nd row, and 5 controls in the 3rd row...
    so which layout is the most suitable for this situation?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ion_knight
      wrote on last edited by
      #2

      You will require multiple layouts to achieve this, what you will need to create is one vertical layout and 2 horizontal layouts one for each row that contains more than one control. Then set the horizontal layouts to the vertical layout and ur done.

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        In addition to ion_knight post, you can use QGridLayout with appropriate spanning. This will be more efficient as well.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          In addition to ion_knight and Dheerendra posts.
          Use horizontal and or vertical "spacers":http://doc.qt.digia.com/2.3/designer/chap4_2.html if you need to arrange the widgets inside the layouts.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            opengpu
            wrote on last edited by
            #5

            thank you ,
            can i add spacers on QGridLayout ?
            and can i add spacers for QGraphicsLayout?

            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