PDA

View Full Version : A very small push button



Gnurou
10th November 2009, 09:20
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.

lyuts
10th November 2009, 10:30
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.

Gnurou
15th November 2009, 04:04
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.