PDA

View Full Version : reduce space-size of buttons



clepto
31st May 2012, 14:27
Hello,

look at the pictures here:
http://ubuntuone.com/6rpPTkQeIauvyZQhMoUh0p
http://ubuntuone.com/47k64UGZRjpzVL0aEkADay

as you can see i have some buttons and i want to reduce the space between them, in the second picture you can see that the button get the most space...
i have created the button with this code (example for play button) :

mplay_pauseButton.setIcon(mplayIcon);
mplay_pauseButton.setIconSize(mplayPixmap.rect().s ize());
mplay_pauseButton.setFlat(true); were mplayPixmap is the pixmap with the icon

any idea how to reduce the space?

wysota
31st May 2012, 14:39
Are you using QToolButton or QPushButton?

clepto
31st May 2012, 16:40
qpushbutton

wysota
31st May 2012, 16:45
Use QToolButton then.

Spitfire
31st May 2012, 17:00
And/or crop your images to avoid empty space around them (GIMP is your friend :) ).

clepto
31st May 2012, 17:21
And/or crop your images to avoid empty space around them (GIMP is your friend :) ).

i used gimp but i cannot crop it anymore..

i used QToolButton

wysota
31st May 2012, 20:58
QPushButton enforces a fixed minimum size so cropping the icon will not change anything.

clepto
31st May 2012, 22:39
ok thanks!