Results 1 to 2 of 2

Thread: Widgets and Layouts

  1. #1
    Join Date
    Apr 2014
    Posts
    34
    Thanks
    14
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Widgets and Layouts

    Hello,

    After allocating widgets and the layout, in which order should the following be done:
    a. Setting the widgets size properties, then putting them in the layout?
    b. Putting the widgets in the layout and then setting their size properties?

    (Or does it matter?)

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Widgets and Layouts

    In principal it should not matter.
    However, from experience, if you are using "exotic" size properties, mixing fixed with preferred, different spacings etc, the result can be other than you'd expect due to the interplay of these size properties of the widgets and the layout.
    What I do when I have a complex layout is do it in designer and tweak it until I got what I was after and then take the generated code as a base for my actual code.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 2
    Last Post: 23rd October 2012, 01:10
  2. Qt Designer : Layouts disable widgets :( !!!
    By QAmazigh in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2009, 14:48
  3. Aligning widgets in different layouts
    By negritot in forum Qt Tools
    Replies: 4
    Last Post: 9th March 2009, 16:07
  4. Layouts
    By csvivek in forum Qt Tools
    Replies: 3
    Last Post: 7th May 2008, 07:22
  5. Layouts
    By Dumbledore in forum Qt Tools
    Replies: 1
    Last Post: 14th October 2007, 01:01

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.