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. QVBoxLayout::setStretchFactor dosen't work
Qt 6.11 is out! See what's new in the release blog

QVBoxLayout::setStretchFactor dosen't work

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

    0_1527130400188_QQ截图20180524045110.png

    I have set the stretch-factor of two layouts, why it dosen't work?

    A 1 Reply Last reply
    0
    • LimerL Limer

      0_1527130400188_QQ截图20180524045110.png

      I have set the stretch-factor of two layouts, why it dosen't work?

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @Limer Those stretch factors are nowhere near being realized in that size of a window. With a 1 you are saying basically you want a minimum widget stretch of 1 and the other is 4. Your window is so big that these would be nowhere near being used. It looks like it's behaving as expected.

      What exactly are you trying to do? There's probably another way to go about what you are wanting. My guess is you are trying to compress the QLabels so they appear in a tight single spaced section ... if that's the case you just need to add column stretches, i.e. gLayout1->setColumnStretch(0,1); and gLayout1->setColumnStretch(1,1);. I'm guessing a bit here, I very rarely use grid layouts much preferring vbox and hbox to form up my "grid".

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      2

      • Login

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