| 1566 | } |
| 1567 | |
| 1568 | void BoxPlotPrivate::updatePixmap() { |
| 1569 | PERFTRACE(name() + QLatin1String(Q_FUNC_INFO)); |
| 1570 | m_pixmap = QPixmap(m_boundingRectangle.width(), m_boundingRectangle.height()); |
| 1571 | if (m_boundingRectangle.width() == 0. || m_boundingRectangle.height() == 0.) { |
| 1572 | m_hoverEffectImageIsDirty = true; |
| 1573 | m_selectionEffectImageIsDirty = true; |
| 1574 | return; |
| 1575 | } |
| 1576 | m_pixmap.fill(Qt::transparent); |
| 1577 | QPainter painter(&m_pixmap); |
| 1578 | painter.setRenderHint(QPainter::Antialiasing); |
| 1579 | painter.translate(-m_boundingRectangle.topLeft()); |
| 1580 | |
| 1581 | draw(&painter); |
| 1582 | painter.end(); |
| 1583 | |
| 1584 | m_hoverEffectImageIsDirty = true; |
| 1585 | m_selectionEffectImageIsDirty = true; |
| 1586 | Q_EMIT q->changed(); |
| 1587 | update(); |
| 1588 | } |
| 1589 | |
| 1590 | void BoxPlotPrivate::draw(QPainter* painter) { |
| 1591 | PERFTRACE(name() + QLatin1String(Q_FUNC_INFO)); |