[Qt-interest] QPushButton icon size
Andreas Diehl
Andreas_Diehl at abs.org
Wed Apr 15 16:09:14 CEST 2009
What is your intention?
When the icon is 64x64 than the button must be a bit larger because it
has a border etc.
Have you tried QPushButton::setIconSize(const QSize&) to modify the
button's icon size? Otherwise I guess you must first
change the icon's size before giving it to the button.
Or try using QToolButton instead of QPushButton and set its style to
Qt::ToolButtonIconOnly.
Regards,
Andreas
________________________________
Von: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] Im Auftrag von Riccardo
Roasio
Gesendet: Mittwoch, 15. April 2009 15:51
An: qt-interest at trolltech.com
Betreff: [Qt-interest] QPushButton icon size
Hi,
i'm trying to set an icon for a button but i'm not able to set
its dimension properly...
QIcon *calculatorIcon=new QIcon();
calculatorIcon->addFile("/home/citec/development/Qt/Test/icons/calculato
r.png");
calculatorButton= new QPushButton(*calculatorIcon,"",this);
calculatorButton->setFixedSize(64,64);
What's wrong with this piece of code?
I'm expecting the icon to become 64x64 pixel... (the original
icon is 64x64 png image)
Thanks,
Riccardo
--
Mit freundlichen Gru?en
Andreas Diehl
-------------------------- ABS -------------------------
ABS Systemberatung OHG Tel: +49 (0)7053/9290-03
Hauffstr. 9 Fax: +49 (0)7053/9290-
D-75385 Bad Teinach-Zavelstein http://www.abs.org
Registergericht Calw HRA 1031
[mailto:Andreas_Diehl at abs.org]
----- Loesungen fuer den Maschinen- und Anlagenbau -----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090415/06f1824c/attachment.html
More information about the Qt-interest-old
mailing list