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. BoxLayout rookie question
Forum Updated to NodeBB v4.3 + New Features

BoxLayout rookie question

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 762 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.
  • ALLINXXXA Offline
    ALLINXXXA Offline
    ALLINXXX
    wrote on last edited by
    #1

    Hi!
    Here's my situation:
    I got three Layouts:
    1.QHBoxLayout(parent) aka mainLayout
    2.QVBoxLayout(child) aka vLayout1
    3.QVBoxLayout(child) aka vLayout2

    mainLayout->addLayout(vLayout1);
    mainLayout->addLayout(vLayout2);

    My question is:
    1.How to divide the layouts within the mainLayout equally (If I got 3 layouts in the mainLayout,each of which contains 1/3 place of the mainLayout).

    2.How to add a separator(a vertical,visible line,just like the separator in QMenu) between the two vLayouts (No QFrame please);

    thanks!

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      The answer for both questions is QSplitter use setStretchFactor with the same value to make the layouts take equal space then you can set the handle stylesheet to make it show just a border

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      ALLINXXXA 1 Reply Last reply
      2
      • VRoninV VRonin

        The answer for both questions is QSplitter use setStretchFactor with the same value to make the layouts take equal space then you can set the handle stylesheet to make it show just a border

        ALLINXXXA Offline
        ALLINXXXA Offline
        ALLINXXX
        wrote on last edited by
        #3

        @VRonin Thanks

        1 Reply Last reply
        1

        • Login

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