Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | void QPaintDeviceWindow::update() | - |
5 | { | - |
6 | update(QRect(QPoint(0,0), size())); | - |
7 | } | - |
8 | void QPaintDeviceWindow::update(const QRect &rect) | - |
9 | { | - |
10 | QPaintDeviceWindowPrivate * const d = d_func(); | - |
11 | d->dirtyRegion += rect; | - |
12 | if (isExposed()) | - |
13 | requestUpdate(); | - |
14 | } | - |
15 | void QPaintDeviceWindow::update(const QRegion ®ion) | - |
16 | { | - |
17 | QPaintDeviceWindowPrivate * const d = d_func(); | - |
18 | d->dirtyRegion += region; | - |
19 | if (isExposed()) | - |
20 | requestUpdate(); | - |
21 | } | - |
22 | void QPaintDeviceWindow::paintEvent(QPaintEvent *event) | - |
23 | { | - |
24 | (void)event;; | - |
25 | | - |
26 | } | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | int QPaintDeviceWindow::metric(PaintDeviceMetric metric) const | - |
32 | { | - |
33 | QScreen *screen = this->screen(); | - |
34 | if (!screen && QGuiApplication::primaryScreen()) | - |
35 | screen = QGuiApplication::primaryScreen(); | - |
36 | | - |
37 | switch (metric) { | - |
38 | case PdmWidth: | - |
39 | return width(); | - |
40 | case PdmWidthMM: | - |
41 | if (screen) | - |
42 | return width() * screen->physicalSize().width() / screen->geometry().width(); | - |
43 | break; | - |
44 | case PdmHeight: | - |
45 | return height(); | - |
46 | case PdmHeightMM: | - |
47 | if (screen) | - |
48 | return height() * screen->physicalSize().height() / screen->geometry().height(); | - |
49 | break; | - |
50 | case PdmDpiX: | - |
51 | if (screen) | - |
52 | return qRound(screen->logicalDotsPerInchX()); | - |
53 | break; | - |
54 | case PdmDpiY: | - |
55 | if (screen) | - |
56 | return qRound(screen->logicalDotsPerInchY()); | - |
57 | break; | - |
58 | case PdmPhysicalDpiX: | - |
59 | if (screen) | - |
60 | return qRound(screen->physicalDotsPerInchX()); | - |
61 | break; | - |
62 | case PdmPhysicalDpiY: | - |
63 | if (screen) | - |
64 | return qRound(screen->physicalDotsPerInchY()); | - |
65 | break; | - |
66 | case PdmDevicePixelRatio: | - |
67 | return int(QWindow::devicePixelRatio()); | - |
68 | break; dead code: break; | - |
69 | case PdmDevicePixelRatioScaled: | - |
70 | return int(QWindow::devicePixelRatio() * devicePixelRatioFScale()); | - |
71 | break; dead code: break; | - |
72 | default: | - |
73 | break; | - |
74 | } | - |
75 | | - |
76 | return QPaintDevice::metric(metric); | - |
77 | } | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | void QPaintDeviceWindow::exposeEvent(QExposeEvent *exposeEvent) | - |
83 | { | - |
84 | (void)exposeEvent;; | - |
85 | QPaintDeviceWindowPrivate * const d = d_func(); | - |
86 | if (isExposed()) { | - |
87 | d->markWindowAsDirty(); | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | d->doFlush(QRect(QPoint(0, 0), size())); | - |
93 | } else if (!d->dirtyRegion.isEmpty()) { | - |
94 | | - |
95 | requestUpdate(); | - |
96 | } | - |
97 | } | - |
98 | | - |
99 | | - |
100 | | - |
101 | | - |
102 | bool QPaintDeviceWindow::event(QEvent *event) | - |
103 | { | - |
104 | QPaintDeviceWindowPrivate * const d = d_func(); | - |
105 | | - |
106 | if (event->type() == QEvent::UpdateRequest) { | - |
107 | if (handle()) | - |
108 | d->handleUpdateEvent(); | - |
109 | return true; | - |
110 | } | - |
111 | | - |
112 | return QWindow::event(event); | - |
113 | } | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | QPaintDeviceWindow::QPaintDeviceWindow(QPaintDeviceWindowPrivate &dd, QWindow *parent) | - |
119 | : QWindow(dd, parent) | - |
120 | { | - |
121 | } | - |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | QPaintEngine *QPaintDeviceWindow::paintEngine() const | - |
127 | { | - |
128 | return 0; | - |
129 | } | - |
130 | | - |
131 | | - |
| | |