Results 1 to 3 of 3

Thread: A very small push button

  1. #1
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default A very small push button

    Hello everybody,

    For the need of a custom player, I need to have very small push buttons that will command the play/pause/stop/etc functions. They will contain a very small pixmap (less than 10 pixels) and should not be larger than the pixmap's size.

    I have tried playing with QPushButton and QToolButton's setMinimumSize, but unfortunately the button will not get as small as I need - some fixed minimum size seems to be hardcoded or so. Would someone have a suggestion as to how I could obtain the desired effect without implementing a custom class? As much as possible, I'd like these buttons to be close to the user's style.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: A very small push button

    I think you are missing the point of setMinimumSize. It sets the size so that your widget doesn't get smaller that it. Having read your problem it looks like you need setMaximumSize.
    I'm a rebel in the S.D.G.

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

    Gnurou (15th November 2009)

  4. #3
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: A very small push button

    Quote Originally Posted by lyuts View Post
    I think you are missing the point of setMinimumSize. It sets the size so that your widget doesn't get smaller that it. Having read your problem it looks like you need setMaximumSize.
    How can one be as stupid as I've been on this one? I'll take the lack of sleep as an excuse. Indeed, changing setMaximumSize seems to be doing the desired effect. Thanks for pointing my absent-mindedness.

Similar Threads

  1. Rotate push button by 90 degrees
    By sasi in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2009, 12:26
  2. Designing the display content of a push button
    By cookie1909 in forum Newbie
    Replies: 4
    Last Post: 16th April 2009, 22:24
  3. Line edit and push button
    By dela in forum Newbie
    Replies: 1
    Last Post: 10th December 2008, 16:10
  4. Push Button problem!!
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2006, 16:31
  5. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40

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.