[Qt-interest] QPushButton + QIcon with large pixmap

Miguel Cardenas mfcardenas at gmail.com
Wed Apr 8 23:55:46 CEST 2009


Thanks a lot!!! I did not notice that function :P

On Wed, Apr 8, 2009 at 4:14 PM, Donal O'Connor <donaloconnor at gmail.com>wrote:

> Hey,
>
> Try, myPushbutton->setIconSize(QSize(w,h));
>
> Regards,
> Donal
>
>
>
> On Wed, Apr 8, 2009 at 10:10 PM, Miguel Cardenas <mfcardenas at gmail.com>wrote:
>
>> Hello list
>>
>> Am trying to set a pixmap to a button but have no success... using
>> setIcon() forces the image to about 16x16 pixmap no matter its original
>> size... in fact I want a button with a 150x150 image as the original pixmap.
>>
>> Trying to find an alternative followed the inheritance to QAbstractButton
>> and QWidget that has a setPixmap() function, but at the QPushButton level
>> that function it is not accessible or available and anyway there's no
>> warranty it will work:
>>
>> ffood.cpp:26: error: 'class QPushButton' has no member named 'setPixmap'
>>
>> What can I do to use larger images for buttons (instead of text)? my code
>> is this:
>>
>>       #include "mypixmap.xpm"
>>       ...
>>       mybutton = new QPushButton;
>>          mybutton->setIcon( QIcon( QPixmap(mypixmap) ) );
>>
>> but mypixmap is automatically forced to something like 16x16 while I
>> expect it as 150x150
>>
>> What can I do??? HELP!!!!!!!
>>
>> Thanks
>>
>> --
>> Miguel Cardenas
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
Miguel Cardenas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090408/05f97a81/attachment.html 


More information about the Qt-interest-old mailing list