Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Resize widgets within the same QGroupBox
QtWS25 Last Chance

Resize widgets within the same QGroupBox

Scheduled Pinned Locked Moved Mobile and Embedded
linuxc++sizewidgetsqgroupbox
2 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    marlenet15
    wrote on 21 Sept 2015, 22:56 last edited by
    #1

    So for the QGroupBox, I have three widgets: line edit, label, and a button. I grouped them together using QVBoxLayout. However, they stretch across the whole main window taking all the space. My main question is that since the button is at the bottom, is it possible for the button to not be stretched across the whole main window? I have been trying to look for tutorials or forums but I can't seem to find anything. Also, if it is not too much to ask, I was also wondering if there are two widgets side by side such as two buttons, is it possible to distribute the size of each widget like button 1 40% and button 2 60 %?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Sept 2015, 20:49 last edited by
      #2

      Hi,

      You can add a stretch before or after the button so it will be pushed against a border.

      For your second question, you can again use the stretch like described here

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      2/2

      22 Sept 2015, 20:49

      • Login

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