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. [Solved] Create a dialog box with QDesigner
Forum Updated to NodeBB v4.3 + New Features

[Solved] Create a dialog box with QDesigner

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

    Regards

    I am working with QDesigner to create a simple dialog box, as yet not allocate space to create the effect you want.

    I want to create a dialog box divided into two parts, where the first occupy at least two thirds of the area of the dialog box and the second the remaining space (at most one-third).

    In each of the two areas I want to put a QGroupBox empty, alone with his title.

    I've been testing with QHBoxLayout, QVBoxLayout and QGridLayout, but I can not do exactly what I want, the space of the dialog box always halved.

    My thanks in advance to who can give me some advice or suggestion.

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QMartin
      wrote on last edited by
      #2

      Hello!

      Have you tried with a QSpacer? You can fix its length and position. A layout will always divide into equal parts the available amount of space. Once the spacer is introduced, then you could be able to use the layouts.

      Regards

      1 Reply Last reply
      0
      • I Offline
        I Offline
        isaacEnrique
        wrote on last edited by
        #3

        Thanks for the advice, but I do not understand exactly what you suggest.

        Are you suggesting that I use a QSpacer within QLayout or am I misunderstanding?

        Isaac Pérez
        Programming is understanding.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #4

          In the designer under the smart/tools panel on the left you will find Horizontal/Vertical spacers, you can place them in your dialog as per your requirement.

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            The solution without additional elements would be to create QVBoxLayout and add those two QGroupBoxes there.
            Then, in the sizePolicy property group set vertical stretch to 2 in the first groupbox and to 1 in the second.

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

              Like above, you a layout (doesn't really matter if a Hbox or Grid is used) and set the stretch factor and the sizeHint should have a 1 to 2 factor to get it started at the proper size! Should work nice then

              Greetz, Jeroen

              1 Reply Last reply
              0
              • I Offline
                I Offline
                isaacEnrique
                wrote on last edited by
                #7

                I have successfully managed to create dialog box with space divided any way you want (actually I did several days ago, specifically January 13, 2013 ... I had forgotten to thank all of you).

                As I said, thank you all for your comments and help.

                Isaac Pérez
                Programming is understanding.

                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