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. [SOLVED] Layout Management - Grid Layout
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Layout Management - Grid Layout

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.7k 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.
  • M Offline
    M Offline
    maximus
    wrote on last edited by
    #1

    Hi,

    I would like to achieve a GridLayout similar to this :
    https://www.dropbox.com/s/fj51uqlusrijc78/gridInterface.png
    Of course this is just an example I will not copy the design.

    I tried with a QGridLayout, no option to show "lines" between items.
    I tried with a QTableWidget, seems like a lot of works to edit the grid so in order to show specifics lines only, and have header with icons

    Is there a better alternative? Maybe just a standard QGridLayout and simulate the lines with QFrame ?

    Thanks!


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maximus
      wrote on last edited by
      #2

      QGridLayout with QFrame is a good alternative with a nice look. but my line cannot overlap.. searching for a solution now


      Free Indoor Cycling Software - https://maximumtrainer.com

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tilsitt
        wrote on last edited by
        #3

        Hi,

        you could also use style sheets to achieve such a result.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maximus
          wrote on last edited by
          #4

          I just hit a wall with the QFrame in a QGridLayout.
          The widget cannot "overlap" so my line are not continue

          Here's a screenshot:
          https://www.dropbox.com/s/ge1riijk8icf3wh/gridTestInterface.png


          Free Indoor Cycling Software - https://maximumtrainer.com

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maximus
            wrote on last edited by
            #5

            I would just like the white line to continue a little more, I tried negative margin but not working. there's probably a solution with stylesheet?

            Current Interface:
            https://www.dropbox.com/s/ge1riijk8icf3wh/gridTestInterface.png
            ( I want to vertical white line to be uninterrupted)

            Current stylesheet:
            @/* vertical lines /
            QFrame#frame_vline, #frame_vline_2, #frame_vline_3 {
            color: rgb(255,255,255);
            margin-bottom:-15px; /
            not working, I would like the line to continue over just a few pixel.. */
            }@


            Free Indoor Cycling Software - https://maximumtrainer.com

            1 Reply Last reply
            0
            • M Offline
              M Offline
              maximus
              wrote on last edited by
              #6

              Found a solution, but not 100% what I would like.
              I have to edit the generated ui_[file].h and force column span

              I cannot find a way to do it with designer yet.
              gridLayout->addWidget(frame_vline_2, 0, 1, 3, 1);


              Free Indoor Cycling Software - https://maximumtrainer.com

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maximus
                wrote on last edited by
                #7

                Okay it is possible to overlap widget in gridLayout
                You just cannot do it with Designer

                have to open to ui file with Text editor and add rowspan manually to the xml
                Then it display good in designer and no need to write code ;)

                <item row="0" column="6" rowspan="4">
                <widget class="QFrame" name="frame_vline_4">


                Free Indoor Cycling Software - https://maximumtrainer.com

                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