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. How to reduce the size of QVBoxLayout
Forum Updated to NodeBB v4.3 + New Features

How to reduce the size of QVBoxLayout

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.2k 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.
  • H Offline
    H Offline
    herculis
    wrote on last edited by
    #1

    Hello guys i have a QVBoxLayout and in that i have some qwidgets but when i run the code it displays a big QVBoxLayout and in that widget in that i want the QVBoxLayout to upto the size of widget so that no extra space should be dere in the QVBoxLayout.
    How can ia do this can u help me in this
    Thanks

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

      Layout does according to widget. Your QWidget should be guiding this. Can you check what is the size of the widget you are putting ? Did you check on setGeometry on layout ? Can you post your sample code ?

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

      1 Reply Last reply
      0
      • H Offline
        H Offline
        herculis
        wrote on last edited by
        #3

        widget size is normal its not an issue.Issue is with size of QVBoxLayout

        1 Reply Last reply
        0
        • JeroentjehomeJ Offline
          JeroentjehomeJ Offline
          Jeroentjehome
          wrote on last edited by
          #4

          Hi,
          The layout will resize with the parent object. The widgets in the layout will resize accordingly. Only when your widgets are set to fixed sizes or limited size the layout will expand and 'empty' space will be shown. So how do you build up your parent widget? (MainWindow??).

          Greetz, Jeroen

          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