[Qt-interest] from QIcon to QImage
Matthias Rauter
Matthias.Rauter at student.uibk.ac.at
Wed Sep 29 10:34:37 CEST 2010
Zitat von "Gabriel M. Beddingfield" <gabrbedd at gmail.com>:
>
>
> On Tue, 28 Sep 2010, pmqt71 wrote:
>
>> Hi,
>>
>> I would like to draw an icon using QPainter.
>>
>> Because QPainter has a *drawImage* method but not a *drawIcon*, I need to
>> convert QIcon to QImage.
>>
>> some help?
>
> Use QIcon::pixmap() to get a QPixmap of the icon, and
> use QPainter::drawPixmap().
>
> -gabriel
>
or icon.paint(&painter, ...) :)
matti
More information about the Qt-interest-old
mailing list