| 77 | } |
| 78 | |
| 79 | bool SidePane::eventFilter(QObject *object, QEvent *event) |
| 80 | { |
| 81 | if (object == viewport()) { |
| 82 | if (event->type() == QEvent::Resize) |
| 83 | updateSizeHint(); |
| 84 | else if (event->type() == QEvent::ScreenChangeInternal) |
| 85 | m_background = QPixmap(); |
| 86 | else if (event->type() == QEvent::Paint) { |
| 87 | if (m_background.isNull()) |
| 88 | m_background = UIResources::themedPixmap(QStringLiteral("kdab-gammaray-logo.png"), this); |
| 89 | |
| 90 | qreal dpr = 1.0; |
| 91 | dpr = m_background.devicePixelRatio(); |
| 92 | QPainter p(viewport()); |
| 93 | p.drawPixmap(viewport()->width() - (m_background.width() / dpr), |
| 94 | viewport()->height() - (m_background.height() / dpr), m_background); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | return QListView::eventFilter(object, event); |
| 99 | } |
| 100 | |
| 101 | void SidePane::updateSizeHint() |
| 102 | { |
nothing calls this directly
no test coverage detected