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

Method eventFilter

ui/sidepane.cpp:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool 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
101void SidePane::updateSizeHint()
102{

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