MCPcopy Create free account
hub / github.com/KDAB/GammaRay / eventFilter

Method eventFilter

ui/aboutwidget.cpp:102–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102bool AboutWidget::eventFilter(QObject *object, QEvent *event)
103{
104 if (object == m_backgroundWindow) {
105 if (event->type() == QEvent::ScreenChangeInternal)
106 m_watermark = QPixmap();
107 else if (event->type() == QEvent::Paint) {
108 if (m_watermark.isNull())
109 m_watermark = UIResources::themedPixmap(QStringLiteral("watermark.png"), this);
110
111 qreal dpr = 1.0;
112 dpr = m_watermark.devicePixelRatio();
113 QPainter p(m_backgroundWindow);
114 p.drawPixmap(m_backgroundWindow->width() - (m_watermark.width() / dpr),
115 m_backgroundWindow->height() - (m_watermark.height() / dpr), m_watermark);
116 }
117 }
118
119 return QWidget::eventFilter(object, event);
120}

Callers

nothing calls this directly

Calls 4

QPixmapClass · 0.85
typeMethod · 0.45
isNullMethod · 0.45
drawPixmapMethod · 0.45

Tested by

no test coverage detected