| 1527 | } |
| 1528 | |
| 1529 | void HistogramPrivate::updatePixmap() { |
| 1530 | m_pixmap = QPixmap(m_boundingRectangle.width(), m_boundingRectangle.height()); |
| 1531 | if (m_boundingRectangle.width() == 0. || m_boundingRectangle.height() == 0.) { |
| 1532 | m_hoverEffectImageIsDirty = true; |
| 1533 | m_selectionEffectImageIsDirty = true; |
| 1534 | return; |
| 1535 | } |
| 1536 | m_pixmap.fill(Qt::transparent); |
| 1537 | QPainter painter(&m_pixmap); |
| 1538 | painter.setRenderHint(QPainter::Antialiasing); |
| 1539 | painter.translate(-m_boundingRectangle.topLeft()); |
| 1540 | |
| 1541 | draw(&painter); |
| 1542 | painter.end(); |
| 1543 | |
| 1544 | m_hoverEffectImageIsDirty = true; |
| 1545 | m_selectionEffectImageIsDirty = true; |
| 1546 | Q_EMIT q->changed(); |
| 1547 | update(); |
| 1548 | } |
| 1549 | |
| 1550 | /*! |
| 1551 | Reimplementation of QGraphicsItem::paint(). This function does the actual painting of the curve. |