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. Layout and expanding dialog issue
Forum Updated to NodeBB v4.3 + New Features

Layout and expanding dialog issue

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

    I am trying to design a window that will expand and show a QGroupBox when the "Match" button is clicked. In my MainWindow constructor, I call:
    @ ui->matchingGroupBox->hide();
    layout()->setSizeConstraint(QLayout::SetFixedSize);@

    As such, my problem comes in when I apply a GridLayout or Vertical layout to the MainWindow.
    I want it to look like the left pic at execution. But after I apply a grid or vertical layout to the mainWindow, I get the right pic.
    !http://snag.gy/GQAMo.jpg(No Layout Applied)! .............!http://snag.gy/0FowC.jpg(Layout Applied)!

    At runtime, the Match button does work, hiding the groupBox and resizing the MainWindow. My theories are (1) one of the widgets in the top section is expanding. And (2) the textEdit in the Matching Group Box is vertically expanding. I've set all size policies to Fixed so I'm stumped. I'm clearly missing some obvious concept behind layouts here. Any help us much appreciate and let me know more info is needed.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      If the top layout has a size policy of Fixed then its width will be fixed at the size dictated by the size hints returned by the contained widgets. Note that this is not necessarily related to the current size in the Designer.

      A QGridLayout may have an empty cell to the right of the lower QGroupBox that can be eliminated by dragging the right-hand side of the group box across and then select Simplify Grid Layout.

      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