| 125 | } |
| 126 | |
| 127 | virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, |
| 128 | QIcon::State state) override |
| 129 | { |
| 130 | // This function is necessary to create an EMPTY pixmap. It's called always |
| 131 | // before paint() |
| 132 | QImage img(size, QImage::Format_ARGB32); |
| 133 | img.fill(qRgba(0, 0, 0, 0)); |
| 134 | QPixmap pix = QPixmap::fromImage(img, Qt::NoFormatConversion); |
| 135 | { |
| 136 | QPainter painter(&pix); |
| 137 | QRect r(QPoint(0.0, 0.0), size); |
| 138 | this->paint(&painter, r, mode, state); |
| 139 | } |
| 140 | return pix; |
| 141 | } |
| 142 | }; |
| 143 | |
| 144 |