kernel/qplatformscreen.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4QPlatformScreen::QPlatformScreen() -
5 : d_ptr(new QPlatformScreenPrivate) -
6{ -
7 QPlatformScreenPrivate * const d = d_func(); -
8 d->screen = 0; -
9}
executed: }
Execution Count:289
289
10 -
11QPlatformScreen::~QPlatformScreen() -
12{ -
13 QPlatformScreenPrivate * const d = d_func(); -
14 -
15 QGuiApplicationPrivate::screen_list.removeOne(d->screen); -
16 delete d->screen; -
17}
executed: }
Execution Count:287
287
18QPixmap QPlatformScreen::grabWindow(WId window, int x, int y, int width, int height) const -
19{ -
20 (void)window;; -
21 (void)x;; -
22 (void)y;; -
23 (void)width;; -
24 (void)height;; -
25 return QPixmap();
never executed: return QPixmap();
0
26} -
27 -
28 -
29 -
30 -
31 -
32 -
33 -
34QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const -
35{ -
36 QWindowList list = QGuiApplication::topLevelWindows(); -
37 for (int i = list.size()-1; i >= 0; --i) {
never evaluated: i >= 0
0
38 QWindow *w = list[i]; -
39 if (w->isVisible() && w->geometry().contains(pos))
never evaluated: w->isVisible()
never evaluated: w->geometry().contains(pos)
0
40 return w;
never executed: return w;
0
41 }
never executed: }
0
42 -
43 return 0;
never executed: return 0;
0
44} -
45QList<QPlatformScreen *> QPlatformScreen::virtualSiblings() const -
46{ -
47 QList<QPlatformScreen *> list; -
48 list << const_cast<QPlatformScreen *>(this); -
49 return list;
never executed: return list;
0
50} -
51 -
52QScreen *QPlatformScreen::screen() const -
53{ -
54 const QPlatformScreenPrivate * const d = d_func(); -
55 return d->screen;
executed: return d->screen;
Execution Count:171730
171730
56} -
57QSizeF QPlatformScreen::physicalSize() const -
58{ -
59 static const int dpi = 100; -
60 return QSizeF(geometry().size()) / dpi * qreal(25.4);
never executed: return QSizeF(geometry().size()) / dpi * qreal(25.4);
0
61} -
62QDpi QPlatformScreen::logicalDpi() const -
63{ -
64 QSizeF ps = physicalSize(); -
65 QSize s = geometry().size(); -
66 -
67 return QDpi(25.4 * s.width() / ps.width(), 0
68 25.4 * s.height() / ps.height());
never executed: return QDpi(25.4 * s.width() / ps.width(), 25.4 * s.height() / ps.height());
0
69} -
70qreal QPlatformScreen::devicePixelRatio() const -
71{ -
72 return 1.0;
executed: return 1.0;
Execution Count:2
2
73} -
74 -
75 -
76 -
77 -
78 -
79 -
80 -
81qreal QPlatformScreen::refreshRate() const -
82{ -
83 return 60;
never executed: return 60;
0
84} -
85Qt::ScreenOrientation QPlatformScreen::nativeOrientation() const -
86{ -
87 return Qt::PrimaryOrientation;
never executed: return Qt::PrimaryOrientation;
0
88} -
89Qt::ScreenOrientation QPlatformScreen::orientation() const -
90{ -
91 return Qt::PrimaryOrientation;
never executed: return Qt::PrimaryOrientation;
0
92} -
93void QPlatformScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask) -
94{ -
95 (void)mask;; -
96}
executed: }
Execution Count:3
3
97 -
98QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window) -
99{ -
100 return window->screen()->handle();
executed: return window->screen()->handle();
Execution Count:171342
171342
101} -
102QPlatformScreenPageFlipper *QPlatformScreen::pageFlipper() const -
103{ -
104 return 0;
never executed: return 0;
0
105} -
106 -
107 -
108 -
109 -
110 -
111 -
112QPlatformCursor *QPlatformScreen::cursor() const -
113{ -
114 return 0;
never executed: return 0;
0
115} -
116 -
117 -
118 -
119 -
120 -
121void QPlatformScreen::resizeMaximizedWindows() -
122{ -
123 QList<QWindow*> windows = QGuiApplication::allWindows(); -
124 -
125 -
126 const QRect oldGeometry = screen()->geometry(); -
127 const QRect oldAvailableGeometry = screen()->availableGeometry(); -
128 const QRect newGeometry = geometry(); -
129 const QRect newAvailableGeometry = availableGeometry(); -
130 -
131 -
132 for (int i = 0; i < windows.size(); ++i) {
never evaluated: i < windows.size()
0
133 QWindow *w = windows.at(i); -
134 -
135 if (platformScreenForWindow(w) != this)
never evaluated: platformScreenForWindow(w) != this
0
136 continue;
never executed: continue;
0
137 -
138 if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry)
never evaluated: w->windowState() & Qt::WindowFullScreen
never evaluated: w->geometry() == oldGeometry
0
139 w->setGeometry(newGeometry);
never executed: w->setGeometry(newGeometry);
0
140 else if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry)
never evaluated: w->windowState() & Qt::WindowMaximized
never evaluated: w->geometry() == oldAvailableGeometry
0
141 w->setGeometry(newAvailableGeometry);
never executed: w->setGeometry(newAvailableGeometry);
0
142 } -
143}
never executed: }
0
144 -
145 -
146 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial