+ QGraphicsWidget::resizeEvent(event);
+
+ if (!m_pixmap.isNull()) {
+ const int pixmapSize = m_pixmap.size().width(); // Pixmap width is always equal pixmap height
+
+ if (pixmapSize != iconSize()) {
+ // If the required icon size is different from the actual pixmap size,
+ // overwrite the m_pixmap with an empty pixmap and reload the new
+ // icon on next re-painting.
+ m_pixmap = QPixmap();
+ }
+ }