Results 1 to 2 of 2

Thread: alter minimum size of a QSpinBox

  1. #1
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question alter minimum size of a QSpinBox

    I've switched some controls from a QLineEdit to a QSpinBox and the minimum size is too wide: they stretch out the gridlayout needlessly. I played around a bit and see that the minimum size is based on the formatting of the min/max values (I use custom strings as well).

    Now, my max/min are quite extreme since occasionally such values may be entered. Under normal situations the range is a lot smaller. I would like somehow to have the min width be based on the normal circumstances rather than the extremes.

    Is this easily possible? I looked first a minimumSizeHint but I see no way to determine the size of the borders and up/down buttons.

  2. #2
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: alter minimum size of a QSpinBox

    My quick hack is to return a special string when the min/max are passed as values to textFromValue. It then uses these strings to get the width.

Similar Threads

  1. Qt static link with minimum size
    By foens in forum Installation and Deployment
    Replies: 0
    Last Post: 25th February 2010, 13:09
  2. Replies: 2
    Last Post: 23rd March 2009, 18:26
  3. Minimum QGroupBox size
    By klnusbaum in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2008, 18:22
  4. Shrink QMainWindow to Minimum Size
    By kloffy in forum Qt Programming
    Replies: 4
    Last Post: 17th February 2008, 18:54
  5. QMenuBar minimum size
    By Angelo Moriconi in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 22:14

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.