qshapedpixmapdndwindow.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qshapedpixmapdndwindow.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QShapedPixmapWindow::QShapedPixmapWindow(QScreen *screen)-
6 : m_useCompositing(true)-
7{-
8 setScreen(screen);-
9 QSurfaceFormat format;-
10 format.setAlphaBufferSize(8);-
11 setFormat(format);-
12 setFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint-
13 | Qt::WindowTransparentForInput | Qt::WindowDoesNotAcceptFocus);-
14}
never executed: end of block
0
15-
16QShapedPixmapWindow::~QShapedPixmapWindow()-
17{-
18}-
19-
20void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap)-
21{-
22 m_pixmap = pixmap;-
23 if (!m_useCompositing
!m_useCompositingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
24 const QBitmap mask = m_pixmap.mask();-
25 if (!mask.isNull()
!mask.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
26 if (!handle()
!handle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
27 create();
never executed: create();
0
28 setMask(mask);-
29 }
never executed: end of block
0
30 }
never executed: end of block
0
31}
never executed: end of block
0
32-
33void QShapedPixmapWindow::setHotspot(const QPoint &hotspot)-
34{-
35 m_hotSpot = hotspot;-
36}
never executed: end of block
0
37-
38void QShapedPixmapWindow::paintEvent(QPaintEvent *)-
39{-
40 if (!m_pixmap.isNull()
!m_pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
41 const QRect rect(QPoint(0, 0), size());-
42 QPainter painter(this);-
43 if (m_useCompositing
m_useCompositingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
44 painter.setCompositionMode(QPainter::CompositionMode_Source);
never executed: painter.setCompositionMode(QPainter::CompositionMode_Source);
0
45 else-
46 painter.fillRect(rect, QGuiApplication::palette().base());
never executed: painter.fillRect(rect, QGuiApplication::palette().base());
0
47 painter.drawPixmap(rect, m_pixmap);-
48 }
never executed: end of block
0
49}
never executed: end of block
0
50-
51void QShapedPixmapWindow::updateGeometry(const QPoint &pos)-
52{-
53 QSize size(1, 1);-
54 if (!m_pixmap.isNull()
!m_pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
55 size = qFuzzyCompare(m_pixmap.devicePixelRatio(), qreal(1.0))
qFuzzyCompare(...), qreal(1.0))Description
TRUEnever evaluated
FALSEnever evaluated
0
56 ? m_pixmap.size()-
57 : (QSizeF(m_pixmap.size()) / m_pixmap.devicePixelRatio()).toSize();-
58 }
never executed: end of block
0
59 setGeometry(QRect(pos - m_hotSpot, size));-
60}
never executed: end of block
0
61-
62-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9