Results 1 to 3 of 3

Thread: Layout woes

  1. #1
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Layout woes

    Hello out there,
    slowly advancing on Qt's learning curve some things already work. However I am using nested layouts and the result looks plain ugly, probably due to the default values for spacing/margins.

    Problem no. 1: My central widget is a splitter, and this widget cannot be chosen from within QtDesigner - or can it?

    So I am left with creating the layouts at runtime, and this leads to
    Question no. 2: Experimenting programmatically with different values for e.g. setContentsMargins() is tedious: Change one value, compile, run, no - doesn't look any better, goto step 1, ...
    I wonder: Is there a way one could influence these settings from within the debugger? Then I could set a break point on some signal handler, try out other values and continue.

    How do the you, the more experienced developers, handle this?
    Oh, in case it matters: This is Qt 4.5.2 on Windows XP.
    Any help will be greatly appreciated.
    Best regards
    Helmut Giese

  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 woes

    Quote Originally Posted by hgiese View Post
    Problem no. 1: My central widget is a splitter, and this widget cannot be chosen from within QtDesigner - or can it?
    Yes it can. Select at least two widgets on your form and choose one of the two splitter options from the layout toolbar (splitters are not available in the widget box).

    Question no. 2: Experimenting programmatically with different values for e.g. setContentsMargins() is tedious: Change one value, compile, run, no - doesn't look any better, goto step 1, ...
    You shouldn't touch setContentsMargins. If you have to adjust margins or spacing, use QLayout::setMargin() and QLayout::setSpacing().

    I wonder: Is there a way one could influence these settings from within the debugger? Then I could set a break point on some signal handler, try out other values and continue.
    Use Designer instead.

    How do the you, the more experienced developers, handle this?
    See the answer above
    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.


  3. The following user says thank you to wysota for this useful post:

    hgiese (3rd September 2009)

  4. #3
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Layout woes

    Hi wysota,
    Quote Originally Posted by wysota View Post
    Yes it can. Select at least two widgets on your form and choose one of the two splitter options from the layout toolbar (splitters are not available in the widget box).
    thanks a lot - now this sounds _really_ helpful. Being able to work with the designer should be a lot easier.

    You shouldn't touch setContentsMargins. If you have to adjust margins or spacing, use QLayout::setMargin() and QLayout::setSpacing().
    Now that I know about the 'splitter options' I probably won't have to.

    I'll give it a try tomorrow - kind'a late over here by now.
    Again many thanks for your advice and best regards
    Helmut Giese

Similar Threads

  1. Resizing dialog with form layout
    By elizabeth.h1 in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2009, 19:58
  2. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  3. Qt like Layout Manager available for .NET platform
    By vkhaitan in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2008, 13:36
  4. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  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.