Results 1 to 2 of 2

Thread: Hi all. I give up (not really, but yes, kind of)

  1. #1
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4 Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows

    Question Hi all. I give up (not really, but yes, kind of)

    Hi all-

    I admit I just don't get QT's layouts and spacers. Every time I think I know what's going on, QT Creator does something different and I am back to square one.

    In this case, and it's just an example, I have two push buttons I want to make small; they just have labels "A" and "B". I resize them to the right dimensions, set horizontal and vertical policies to "fixed", then I apply a horizontal layout, and suddenly the buttons are reset to their original size.

    I get the concept of layouts, I can lay stuff out in grids, vertical, horizontal, etc., and that they can be nested and so forth, but what I'm having such a hard time with is telling QT "there are just some things I want you to leave alone. Period." None of the websites or documentation I've found seems to address this particular aspect.

    Is there any way to do this? This is my big "missing piece" of QT; I'm absolutely in love with the framework, the classes, everything...it's just this one thing that I can't seem to have a solution for.

    Thanks for any info,

    Tachoknight

  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: Hi all. I give up (not really, but yes, kind of)

    Quote Originally Posted by tachoknight View Post
    In this case, and it's just an example, I have two push buttons I want to make small; they just have labels "A" and "B". I resize them to the right dimensions, set horizontal and vertical policies to "fixed", then I apply a horizontal layout, and suddenly the buttons are reset to their original size.
    This is because QPushButton has a minimal size hint set which means it can never be smaller than 80x25 (or something like that) when controlled by a layout. Use QToolButton instead.

    I get the concept of layouts, I can lay stuff out in grids, vertical, horizontal, etc., and that they can be nested and so forth, but what I'm having such a hard time with is telling QT "there are just some things I want you to leave alone. Period."
    Set the size policy to Ignore.
    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:

    tachoknight (4th December 2010)

Similar Threads

  1. Can anybody explain me this 'kind of casting'¿?
    By tonnot in forum General Programming
    Replies: 6
    Last Post: 28th November 2010, 19:39
  2. diffrend kind of lists of GUI
    By tomixer in forum Qt Programming
    Replies: 7
    Last Post: 12th September 2010, 22:44
  3. How to code this kind of UI?
    By stephenteh in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 23rd September 2009, 11:31

Tags for this Thread

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.