[Qt-interest] from QIcon to QImage

Gabriel M. Beddingfield gabrbedd at gmail.com
Tue Sep 28 17:45:59 CEST 2010



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




More information about the Qt-interest-old mailing list