Results 1 to 6 of 6

Thread: Is there any way to fix base size of widgets

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Is there any way to fix base size of widgets

    Is there any way to define, in example, a height for Label to let every Label I drop onto my form has this height ?
    (I'd like to define this for some basic widgets).
    Any idea ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is there any way to fix base size of widgets

    I assume you are talking about Designer.

    The size of widget will ultimately be set by the layout, its content and size hints, and the min/max width/height of the widget, so it is largely irrelevant what size they are when you first drop them onto their parent widget. You cannot affect the default value for these properties but you can bulk change them:
    • Drop all the QLabels on their parent widget
    • Select all the labels
    • Alter the minimum or maximum size properties

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there any way to fix base size of widgets

    mmm
    Now I have 20 px. for the height of lineEdits and 22 for comboBox. As you can see a LineEdit placed next to a comboBox cannot be right aligned.
    So I'd like to have 22 px for every lineEdit I use.

    ( And depending on my scenario maybe I'd choose another heoights)

    I imagine there is a place where it is defined this, where ? Is does not exist something like 'profil' ????
    Thanks.

  4. #4
    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: Is there any way to fix base size of widgets

    As you were told the initial size of the label is irrelevant so nobody bothers to define profiles for sizes when dropping widgets in Designer. If you really want it, drop a label on your form, give it the size you want and then drag the label back to your widget toolbox. A new entry should appear in the bottom that contains your widget as a stencil. With a bit of luck it will retain the size you set, so dragging it back to the form will let you clone the stencil into widget instances. This stencil is persistant over Designer runs so you only need to do it once.
    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.


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

    tonnot (24th August 2011)

  6. #5
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there any way to fix base size of widgets

    OH! What a superb trick !!!
    Thanks !!!

    By last. Is there any way to unable de QT3support widgets ? I dont use them and I would like not to see them (they ocupy unusefull space). Any another trick ?
    Last edited by tonnot; 24th August 2011 at 10:10.

  7. #6
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Is there any way to fix base size of widgets

    Just delete the files for plugins you don't need from QTDir/plugins/designer
    Don't write a post just to thank someone, use "Thanks" button.

Similar Threads

  1. initial size of widgets in a QSplitter
    By momesana in forum Newbie
    Replies: 3
    Last Post: 12th July 2012, 15:41
  2. Widgets: Let the user change the size
    By Donner in forum Qt Programming
    Replies: 2
    Last Post: 14th November 2010, 20:13
  3. Embedded widgets size
    By Indalo in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2009, 10:12
  4. Size proportions of widgets in QSplitter
    By Boron in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2009, 18:25
  5. Forcing two widgets to the same size
    By dsandber in forum Qt Tools
    Replies: 3
    Last Post: 7th October 2007, 10:11

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.