Results 1 to 2 of 2

Thread: layout problems

  1. #1
    Join Date
    Mar 2010
    Posts
    107
    Thanks
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default layout problems

    hello all
    I am having trouble with layout in qtdesigner
    I want to layout some widgets like this -
    <label> <line text edit>
    <label> <line text edit> <button>
    <label> <combo box>
    I want the combo box to be a fixed size and the line edits to reasonably long
    So I created the widgets the size that I want then selected them alll and applied a grid layout. This almost gives me what I want except that the combo box is the same size as the line edits.
    So I made the combo box have a fixed horizontal policy and tried again. The combo box is now a fixed size but is alot smaller than i specified

    How can I fix this?


    TIA

    Graham

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: layout problems

    What do you consider "reasonably long"?

    Try using QFormLayout instead of QGridLayout, maybe the default settings fit your usecase better. If not then you have to adjust minimumSize or reimplement minimumSizeHint or sizeHint for the widgets that look wrong.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. problems with layout - (stretch)
    By pakine in forum Qt Programming
    Replies: 3
    Last Post: 25th August 2010, 13:42
  2. Problems with layout
    By franco.amato in forum Qt Programming
    Replies: 6
    Last Post: 21st January 2010, 15:42
  3. QWidget layout problems
    By MarkoSan in forum Newbie
    Replies: 3
    Last Post: 12th January 2010, 10:23
  4. Problems with QMainWindow and layout
    By franco.amato in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2009, 22:49
  5. Resizing problems when applying a layout
    By JimBrown in forum Newbie
    Replies: 1
    Last Post: 21st February 2007, 22:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.