Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qguiapplication.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||||||||||||||
18 | __attribute__((visibility("default"))) bool qt_is_gui_used = true; | - | ||||||||||||||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||||||||||||||
20 | Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
21 | Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier; | - | ||||||||||||||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||||||||||||||
23 | QPointF QGuiApplicationPrivate::lastCursorPosition(qInf(), qInf()); | - | ||||||||||||||||||||||||||||||||||||
24 | - | |||||||||||||||||||||||||||||||||||||
25 | Qt::MouseButtons QGuiApplicationPrivate::tabletState = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
26 | QWindow *QGuiApplicationPrivate::tabletPressTarget = 0; | - | ||||||||||||||||||||||||||||||||||||
27 | QWindow *QGuiApplicationPrivate::currentMouseWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||||||||||||||
29 | QString QGuiApplicationPrivate::styleOverride; | - | ||||||||||||||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||||||||||||||
31 | Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive; | - | ||||||||||||||||||||||||||||||||||||
32 | - | |||||||||||||||||||||||||||||||||||||
33 | bool QGuiApplicationPrivate::highDpiScalingUpdated = false; | - | ||||||||||||||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||||||||||||||
35 | QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0; | - | ||||||||||||||||||||||||||||||||||||
36 | QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0; | - | ||||||||||||||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||||||||||||||
38 | QList<QObject *> QGuiApplicationPrivate::generic_plugin_list; | - | ||||||||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||||||||||||||
41 | bool QGuiApplicationPrivate::is_fallback_session_management_enabled = true; | - | ||||||||||||||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||||||||
44 | enum ApplicationResourceFlags | - | ||||||||||||||||||||||||||||||||||||
45 | { | - | ||||||||||||||||||||||||||||||||||||
46 | ApplicationPaletteExplicitlySet = 0x1, | - | ||||||||||||||||||||||||||||||||||||
47 | ApplicationFontExplicitlySet = 0x2 | - | ||||||||||||||||||||||||||||||||||||
48 | }; | - | ||||||||||||||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||||||||||||||
50 | static unsigned applicationResourceFlags = 0; | - | ||||||||||||||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||||||||||||||
52 | QIcon *QGuiApplicationPrivate::app_icon = 0; | - | ||||||||||||||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||||||||||||||
54 | QString *QGuiApplicationPrivate::platform_name = 0; | - | ||||||||||||||||||||||||||||||||||||
55 | QString *QGuiApplicationPrivate::displayName = 0; | - | ||||||||||||||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||||||||||||||
57 | QPalette *QGuiApplicationPrivate::app_pal = 0; | - | ||||||||||||||||||||||||||||||||||||
58 | - | |||||||||||||||||||||||||||||||||||||
59 | Qt::MouseButtons QGuiApplicationPrivate::buttons = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||||||||||||||
61 | ulong QGuiApplicationPrivate::mousePressTime = 0; | - | ||||||||||||||||||||||||||||||||||||
62 | Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
63 | int QGuiApplicationPrivate::mousePressX = 0; | - | ||||||||||||||||||||||||||||||||||||
64 | int QGuiApplicationPrivate::mousePressY = 0; | - | ||||||||||||||||||||||||||||||||||||
65 | int QGuiApplicationPrivate::mouse_double_click_distance = -1; | - | ||||||||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||||||||
67 | QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
68 | - | |||||||||||||||||||||||||||||||||||||
69 | static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto; | - | ||||||||||||||||||||||||||||||||||||
70 | static bool force_reverse = false; | - | ||||||||||||||||||||||||||||||||||||
71 | - | |||||||||||||||||||||||||||||||||||||
72 | QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0; | - | ||||||||||||||||||||||||||||||||||||
73 | QTouchDevice *QGuiApplicationPrivate::m_fakeTouchDevice = 0; | - | ||||||||||||||||||||||||||||||||||||
74 | int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0; | - | ||||||||||||||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||||||||||||||
77 | QClipboard *QGuiApplicationPrivate::qt_clipboard = 0; | - | ||||||||||||||||||||||||||||||||||||
78 | - | |||||||||||||||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||||||||||||||
80 | QList<QScreen *> QGuiApplicationPrivate::screen_list; | - | ||||||||||||||||||||||||||||||||||||
81 | - | |||||||||||||||||||||||||||||||||||||
82 | QWindowList QGuiApplicationPrivate::window_list; | - | ||||||||||||||||||||||||||||||||||||
83 | QWindow *QGuiApplicationPrivate::focus_window = 0; | - | ||||||||||||||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||||||||||||||
85 | static QBasicMutex applicationFontMutex; | - | ||||||||||||||||||||||||||||||||||||
86 | QFont *QGuiApplicationPrivate::app_font = 0; | - | ||||||||||||||||||||||||||||||||||||
87 | QStyleHints *QGuiApplicationPrivate::styleHints = nullptr; | - | ||||||||||||||||||||||||||||||||||||
88 | bool QGuiApplicationPrivate::obey_desktop_settings = true; | - | ||||||||||||||||||||||||||||||||||||
89 | - | |||||||||||||||||||||||||||||||||||||
90 | QInputDeviceManager *QGuiApplicationPrivate::m_inputDeviceManager = 0; | - | ||||||||||||||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||||||||||||||
92 | - | |||||||||||||||||||||||||||||||||||||
93 | bool QGuiApplicationPrivate::scrollNoPhaseAllowed = false; | - | ||||||||||||||||||||||||||||||||||||
94 | - | |||||||||||||||||||||||||||||||||||||
95 | static qreal fontSmoothingGamma = 1.7; | - | ||||||||||||||||||||||||||||||||||||
96 | - | |||||||||||||||||||||||||||||||||||||
97 | extern void qRegisterGuiVariant(); | - | ||||||||||||||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||||||||||||||
99 | extern void qRegisterGuiGetInterpolator(); | - | ||||||||||||||||||||||||||||||||||||
100 | - | |||||||||||||||||||||||||||||||||||||
101 | - | |||||||||||||||||||||||||||||||||||||
102 | static bool qt_detectRTLLanguage() | - | ||||||||||||||||||||||||||||||||||||
103 | { | - | ||||||||||||||||||||||||||||||||||||
104 | return never executed: force_reverse ^return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); never executed: return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); | 0 | ||||||||||||||||||||||||||||||||||||
105 | (QGuiApplication::tr("QT_LAYOUT_DIRECTION", never executed: return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); | 0 | ||||||||||||||||||||||||||||||||||||
106 | "Translate this string to the string 'LTR' in left-to-right" never executed: return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); | 0 | ||||||||||||||||||||||||||||||||||||
107 | " languages or to 'RTL' in right-to-left languages (such as Hebrew" never executed: return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); | 0 | ||||||||||||||||||||||||||||||||||||
108 | " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); never executed: return force_reverse ^ (QGuiApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); | 0 | ||||||||||||||||||||||||||||||||||||
109 | } | - | ||||||||||||||||||||||||||||||||||||
110 | - | |||||||||||||||||||||||||||||||||||||
111 | static void initPalette() | - | ||||||||||||||||||||||||||||||||||||
112 | { | - | ||||||||||||||||||||||||||||||||||||
113 | if (!QGuiApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||||||||||||||
114 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
115 | QGuiApplicationPrivate::app_pal = new QPalette(*themePalette); never executed: QGuiApplicationPrivate::app_pal = new QPalette(*themePalette); | 0 | ||||||||||||||||||||||||||||||||||||
116 | if (!QGuiApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||||||||||||||
117 | QGuiApplicationPrivate::app_pal = new QPalette(Qt::gray); never executed: QGuiApplicationPrivate::app_pal = new QPalette(Qt::gray); | 0 | ||||||||||||||||||||||||||||||||||||
118 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
119 | - | |||||||||||||||||||||||||||||||||||||
120 | static inline void clearPalette() | - | ||||||||||||||||||||||||||||||||||||
121 | { | - | ||||||||||||||||||||||||||||||||||||
122 | delete QGuiApplicationPrivate::app_pal; | - | ||||||||||||||||||||||||||||||||||||
123 | QGuiApplicationPrivate::app_pal = 0; | - | ||||||||||||||||||||||||||||||||||||
124 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
125 | - | |||||||||||||||||||||||||||||||||||||
126 | static void initFontUnlocked() | - | ||||||||||||||||||||||||||||||||||||
127 | { | - | ||||||||||||||||||||||||||||||||||||
128 | if (!QGuiApplicationPrivate::app_font
| 0 | ||||||||||||||||||||||||||||||||||||
129 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
130 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
131 | QGuiApplicationPrivate::app_font = new QFont(*font); never executed: QGuiApplicationPrivate::app_font = new QFont(*font); | 0 | ||||||||||||||||||||||||||||||||||||
132 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
133 | if (!QGuiApplicationPrivate::app_font
| 0 | ||||||||||||||||||||||||||||||||||||
134 | QGuiApplicationPrivate::app_font = never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont()); | 0 | ||||||||||||||||||||||||||||||||||||
135 | new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont()); never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont()); | 0 | ||||||||||||||||||||||||||||||||||||
136 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
137 | - | |||||||||||||||||||||||||||||||||||||
138 | static inline void clearFontUnlocked() | - | ||||||||||||||||||||||||||||||||||||
139 | { | - | ||||||||||||||||||||||||||||||||||||
140 | delete QGuiApplicationPrivate::app_font; | - | ||||||||||||||||||||||||||||||||||||
141 | QGuiApplicationPrivate::app_font = 0; | - | ||||||||||||||||||||||||||||||||||||
142 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||||||||||||||
144 | - | |||||||||||||||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||||||||||||||
147 | - | |||||||||||||||||||||||||||||||||||||
148 | - | |||||||||||||||||||||||||||||||||||||
149 | struct QWindowGeometrySpecification | - | ||||||||||||||||||||||||||||||||||||
150 | { | - | ||||||||||||||||||||||||||||||||||||
151 | static QWindowGeometrySpecification fromArgument(const QByteArray &a); | - | ||||||||||||||||||||||||||||||||||||
152 | void applyTo(QWindow *window) const; | - | ||||||||||||||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||||||||||||||
154 | Qt::Corner corner; | - | ||||||||||||||||||||||||||||||||||||
155 | int xOffset; | - | ||||||||||||||||||||||||||||||||||||
156 | int yOffset; | - | ||||||||||||||||||||||||||||||||||||
157 | int width; | - | ||||||||||||||||||||||||||||||||||||
158 | int height; | - | ||||||||||||||||||||||||||||||||||||
159 | }; | - | ||||||||||||||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||||||||||||||
161 | - | |||||||||||||||||||||||||||||||||||||
162 | static inline int nextGeometryToken(const QByteArray &a, int &pos, char *op) | - | ||||||||||||||||||||||||||||||||||||
163 | { | - | ||||||||||||||||||||||||||||||||||||
164 | *op = 0; | - | ||||||||||||||||||||||||||||||||||||
165 | const int size = a.size(); | - | ||||||||||||||||||||||||||||||||||||
166 | if (pos >= size
| 0 | ||||||||||||||||||||||||||||||||||||
167 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||||||||||||||
169 | *op = a.at(pos); | - | ||||||||||||||||||||||||||||||||||||
170 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
171 | pos++; never executed: pos++; | 0 | ||||||||||||||||||||||||||||||||||||
172 | else if (isdigit(*op)
| 0 | ||||||||||||||||||||||||||||||||||||
173 | * never executed: op = 'x';*op = 'x'; never executed: *op = 'x'; | 0 | ||||||||||||||||||||||||||||||||||||
174 | else | - | ||||||||||||||||||||||||||||||||||||
175 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||||||||||||||
177 | const int numberPos = pos; | - | ||||||||||||||||||||||||||||||||||||
178 | for ( ; pos < size
never executed: ; | 0 | ||||||||||||||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||||||||||||||
180 | bool ok; | - | ||||||||||||||||||||||||||||||||||||
181 | const int result = a.mid(numberPos, pos - numberPos).toInt(&ok); | - | ||||||||||||||||||||||||||||||||||||
182 | return never executed: okreturn ok ? result : -1;
never executed: return ok ? result : -1; | 0 | ||||||||||||||||||||||||||||||||||||
183 | } | - | ||||||||||||||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||||||||||||||
185 | QWindowGeometrySpecification QWindowGeometrySpecification::fromArgument(const QByteArray &a) | - | ||||||||||||||||||||||||||||||||||||
186 | { | - | ||||||||||||||||||||||||||||||||||||
187 | QWindowGeometrySpecification result = { Qt::TopLeftCorner, -1, -1, -1, -1 }; | - | ||||||||||||||||||||||||||||||||||||
188 | int pos = 0; | - | ||||||||||||||||||||||||||||||||||||
189 | for (int i = 0; i < 4
| 0 | ||||||||||||||||||||||||||||||||||||
190 | char op; | - | ||||||||||||||||||||||||||||||||||||
191 | const int value = nextGeometryToken(a, pos, &op); | - | ||||||||||||||||||||||||||||||||||||
192 | if (value < 0
| 0 | ||||||||||||||||||||||||||||||||||||
193 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
194 | switch (op) { | - | ||||||||||||||||||||||||||||||||||||
195 | case never executed: 'x':case 'x': never executed: case 'x': | 0 | ||||||||||||||||||||||||||||||||||||
196 | (result.width >= 0 ? result.height : result.width) = value; | - | ||||||||||||||||||||||||||||||||||||
197 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
198 | case never executed: '+':case '+': never executed: case '+': | 0 | ||||||||||||||||||||||||||||||||||||
199 | case never executed: '-':case '-': never executed: case '-': | 0 | ||||||||||||||||||||||||||||||||||||
200 | if (result.xOffset >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
201 | result.yOffset = value; | - | ||||||||||||||||||||||||||||||||||||
202 | if (op == '-'
| 0 | ||||||||||||||||||||||||||||||||||||
203 | result.corner = result.corner == Qt::TopRightCorner
never executed: result.corner = result.corner == Qt::TopRightCorner ? Qt::BottomRightCorner : Qt::BottomLeftCorner; | 0 | ||||||||||||||||||||||||||||||||||||
204 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
205 | result.xOffset = value; | - | ||||||||||||||||||||||||||||||||||||
206 | if (op == '-'
| 0 | ||||||||||||||||||||||||||||||||||||
207 | result.corner = Qt::TopRightCorner; never executed: result.corner = Qt::TopRightCorner; | 0 | ||||||||||||||||||||||||||||||||||||
208 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
209 | } | - | ||||||||||||||||||||||||||||||||||||
210 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
211 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||
212 | } | - | ||||||||||||||||||||||||||||||||||||
213 | - | |||||||||||||||||||||||||||||||||||||
214 | void QWindowGeometrySpecification::applyTo(QWindow *window) const | - | ||||||||||||||||||||||||||||||||||||
215 | { | - | ||||||||||||||||||||||||||||||||||||
216 | QRect windowGeometry = window->frameGeometry(); | - | ||||||||||||||||||||||||||||||||||||
217 | QSize size = windowGeometry.size(); | - | ||||||||||||||||||||||||||||||||||||
218 | if (width >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
219 | const QSize windowMinimumSize = window->minimumSize(); | - | ||||||||||||||||||||||||||||||||||||
220 | const QSize windowMaximumSize = window->maximumSize(); | - | ||||||||||||||||||||||||||||||||||||
221 | if (width >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
222 | size.setWidth(qBound(windowMinimumSize.width(), width, windowMaximumSize.width())); never executed: size.setWidth(qBound(windowMinimumSize.width(), width, windowMaximumSize.width())); | 0 | ||||||||||||||||||||||||||||||||||||
223 | if (height >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
224 | size.setHeight(qBound(windowMinimumSize.height(), height, windowMaximumSize.height())); never executed: size.setHeight(qBound(windowMinimumSize.height(), height, windowMaximumSize.height())); | 0 | ||||||||||||||||||||||||||||||||||||
225 | window->resize(size); | - | ||||||||||||||||||||||||||||||||||||
226 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
227 | if (xOffset >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
228 | const QRect availableGeometry = window->screen()->virtualGeometry(); | - | ||||||||||||||||||||||||||||||||||||
229 | QPoint topLeft = windowGeometry.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
230 | if (xOffset >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
231 | topLeft.setX(corner == Qt::TopLeftCorner || corner == Qt::BottomLeftCorner ? | - | ||||||||||||||||||||||||||||||||||||
232 | xOffset : | - | ||||||||||||||||||||||||||||||||||||
233 | qMax(availableGeometry.right() - size.width() - xOffset, availableGeometry.left())); | - | ||||||||||||||||||||||||||||||||||||
234 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
235 | if (yOffset >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
236 | topLeft.setY(corner == Qt::TopLeftCorner || corner == Qt::TopRightCorner ? | - | ||||||||||||||||||||||||||||||||||||
237 | yOffset : | - | ||||||||||||||||||||||||||||||||||||
238 | qMax(availableGeometry.bottom() - size.height() - yOffset, availableGeometry.top())); | - | ||||||||||||||||||||||||||||||||||||
239 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
240 | window->setFramePosition(topLeft); | - | ||||||||||||||||||||||||||||||||||||
241 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
242 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||||||||||||||
244 | static QWindowGeometrySpecification windowGeometrySpecification = { Qt::TopLeftCorner, -1, -1, -1, -1 }; | - | ||||||||||||||||||||||||||||||||||||
245 | QGuiApplication::QGuiApplication(int &argc, char **argv, int flags) | - | ||||||||||||||||||||||||||||||||||||
246 | - | |||||||||||||||||||||||||||||||||||||
247 | : QCoreApplication(*new QGuiApplicationPrivate(argc, argv, flags)) | - | ||||||||||||||||||||||||||||||||||||
248 | { | - | ||||||||||||||||||||||||||||||||||||
249 | d_func()->init(); | - | ||||||||||||||||||||||||||||||||||||
250 | - | |||||||||||||||||||||||||||||||||||||
251 | QCoreApplicationPrivate::eventDispatcher->startingUp(); | - | ||||||||||||||||||||||||||||||||||||
252 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||||||||||||||
257 | QGuiApplication::QGuiApplication(QGuiApplicationPrivate &p) | - | ||||||||||||||||||||||||||||||||||||
258 | : QCoreApplication(p) | - | ||||||||||||||||||||||||||||||||||||
259 | { | - | ||||||||||||||||||||||||||||||||||||
260 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||||||||||||||
263 | - | |||||||||||||||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||||||||||||||
265 | QGuiApplication::~QGuiApplication() | - | ||||||||||||||||||||||||||||||||||||
266 | { | - | ||||||||||||||||||||||||||||||||||||
267 | QGuiApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||||||||||||||
269 | d->eventDispatcher->closingDown(); | - | ||||||||||||||||||||||||||||||||||||
270 | d->eventDispatcher = 0; | - | ||||||||||||||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||||||||||||||
272 | - | |||||||||||||||||||||||||||||||||||||
273 | delete QGuiApplicationPrivate::qt_clipboard; | - | ||||||||||||||||||||||||||||||||||||
274 | QGuiApplicationPrivate::qt_clipboard = 0; | - | ||||||||||||||||||||||||||||||||||||
275 | - | |||||||||||||||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||||||||||||||
278 | delete d->session_manager; | - | ||||||||||||||||||||||||||||||||||||
279 | d->session_manager = 0; | - | ||||||||||||||||||||||||||||||||||||
280 | - | |||||||||||||||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||||||||||||||
282 | clearPalette(); | - | ||||||||||||||||||||||||||||||||||||
283 | QFontDatabase::removeAllApplicationFonts(); | - | ||||||||||||||||||||||||||||||||||||
284 | - | |||||||||||||||||||||||||||||||||||||
285 | - | |||||||||||||||||||||||||||||||||||||
286 | d->cursor_list.clear(); | - | ||||||||||||||||||||||||||||||||||||
287 | - | |||||||||||||||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||||||||||||||
289 | delete QGuiApplicationPrivate::app_icon; | - | ||||||||||||||||||||||||||||||||||||
290 | QGuiApplicationPrivate::app_icon = 0; | - | ||||||||||||||||||||||||||||||||||||
291 | delete QGuiApplicationPrivate::platform_name; | - | ||||||||||||||||||||||||||||||||||||
292 | QGuiApplicationPrivate::platform_name = 0; | - | ||||||||||||||||||||||||||||||||||||
293 | delete QGuiApplicationPrivate::displayName; | - | ||||||||||||||||||||||||||||||||||||
294 | QGuiApplicationPrivate::displayName = 0; | - | ||||||||||||||||||||||||||||||||||||
295 | delete QGuiApplicationPrivate::m_inputDeviceManager; | - | ||||||||||||||||||||||||||||||||||||
296 | QGuiApplicationPrivate::m_inputDeviceManager = 0; | - | ||||||||||||||||||||||||||||||||||||
297 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
298 | - | |||||||||||||||||||||||||||||||||||||
299 | QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) | - | ||||||||||||||||||||||||||||||||||||
300 | : QCoreApplicationPrivate(argc, argv, flags), | - | ||||||||||||||||||||||||||||||||||||
301 | inputMethod(0), | - | ||||||||||||||||||||||||||||||||||||
302 | lastTouchType(QEvent::TouchEnd), | - | ||||||||||||||||||||||||||||||||||||
303 | ownGlobalShareContext(false) | - | ||||||||||||||||||||||||||||||||||||
304 | { | - | ||||||||||||||||||||||||||||||||||||
305 | self = this; | - | ||||||||||||||||||||||||||||||||||||
306 | application_type = QCoreApplicationPrivate::Gui; | - | ||||||||||||||||||||||||||||||||||||
307 | - | |||||||||||||||||||||||||||||||||||||
308 | is_session_restored = false; | - | ||||||||||||||||||||||||||||||||||||
309 | is_saving_session = false; | - | ||||||||||||||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||||||||||||||
311 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
312 | void QGuiApplication::setApplicationDisplayName(const QString &name) | - | ||||||||||||||||||||||||||||||||||||
313 | { | - | ||||||||||||||||||||||||||||||||||||
314 | if (!QGuiApplicationPrivate::displayName
| 0 | ||||||||||||||||||||||||||||||||||||
315 | QGuiApplicationPrivate::displayName = new QString; never executed: QGuiApplicationPrivate::displayName = new QString; | 0 | ||||||||||||||||||||||||||||||||||||
316 | *QGuiApplicationPrivate::displayName = name; | - | ||||||||||||||||||||||||||||||||||||
317 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
318 | - | |||||||||||||||||||||||||||||||||||||
319 | QString QGuiApplication::applicationDisplayName() | - | ||||||||||||||||||||||||||||||||||||
320 | { | - | ||||||||||||||||||||||||||||||||||||
321 | return never executed: QGuiApplicationPrivate::displayNamereturn QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
never executed: return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName(); | 0 | ||||||||||||||||||||||||||||||||||||
322 | } | - | ||||||||||||||||||||||||||||||||||||
323 | QWindow *QGuiApplication::modalWindow() | - | ||||||||||||||||||||||||||||||||||||
324 | { | - | ||||||||||||||||||||||||||||||||||||
325 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 687, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: nullptr;return nullptr; never executed: }return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
326 | if (QGuiApplicationPrivate::self->modalWindowList.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
327 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
328 | return never executed: QGuiApplicationPrivate::self->modalWindowList.first();return QGuiApplicationPrivate::self->modalWindowList.first(); never executed: return QGuiApplicationPrivate::self->modalWindowList.first(); | 0 | ||||||||||||||||||||||||||||||||||||
329 | } | - | ||||||||||||||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||||||||||||||
331 | static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked) | - | ||||||||||||||||||||||||||||||||||||
332 | { | - | ||||||||||||||||||||||||||||||||||||
333 | QWindowPrivate *p = qt_window_private(window); | - | ||||||||||||||||||||||||||||||||||||
334 | if (p->blockedByModalWindow != shouldBeBlocked
| 0 | ||||||||||||||||||||||||||||||||||||
335 | p->blockedByModalWindow = shouldBeBlocked; | - | ||||||||||||||||||||||||||||||||||||
336 | QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked); | - | ||||||||||||||||||||||||||||||||||||
337 | QGuiApplication::sendEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
338 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(window->children())>::type> _container_((window->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *c = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
339 | if (c->isWindowType()
| 0 | ||||||||||||||||||||||||||||||||||||
340 | updateBlockedStatusRecursion(static_cast<QWindow *>(c), shouldBeBlocked); never executed: updateBlockedStatusRecursion(static_cast<QWindow *>(c), shouldBeBlocked); | 0 | ||||||||||||||||||||||||||||||||||||
341 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
342 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
343 | - | |||||||||||||||||||||||||||||||||||||
344 | void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) | - | ||||||||||||||||||||||||||||||||||||
345 | { | - | ||||||||||||||||||||||||||||||||||||
346 | bool shouldBeBlocked = false; | - | ||||||||||||||||||||||||||||||||||||
347 | if (!QWindowPrivate::get(window)->isPopup()
| 0 | ||||||||||||||||||||||||||||||||||||
348 | shouldBeBlocked = self->isWindowBlocked(window); never executed: shouldBeBlocked = self->isWindowBlocked(window); | 0 | ||||||||||||||||||||||||||||||||||||
349 | updateBlockedStatusRecursion(window, shouldBeBlocked); | - | ||||||||||||||||||||||||||||||||||||
350 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
351 | - | |||||||||||||||||||||||||||||||||||||
352 | void QGuiApplicationPrivate::showModalWindow(QWindow *modal) | - | ||||||||||||||||||||||||||||||||||||
353 | { | - | ||||||||||||||||||||||||||||||||||||
354 | self->modalWindowList.prepend(modal); | - | ||||||||||||||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||||||||||||||
357 | if (currentMouseWindow
| 0 | ||||||||||||||||||||||||||||||||||||
358 | bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow); | - | ||||||||||||||||||||||||||||||||||||
359 | if (shouldBeBlocked
| 0 | ||||||||||||||||||||||||||||||||||||
360 | - | |||||||||||||||||||||||||||||||||||||
361 | self->modalWindowList.removeFirst(); | - | ||||||||||||||||||||||||||||||||||||
362 | QEvent e(QEvent::Leave); | - | ||||||||||||||||||||||||||||||||||||
363 | QGuiApplication::sendEvent(currentMouseWindow, &e); | - | ||||||||||||||||||||||||||||||||||||
364 | currentMouseWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
365 | self->modalWindowList.prepend(modal); | - | ||||||||||||||||||||||||||||||||||||
366 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
367 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
368 | - | |||||||||||||||||||||||||||||||||||||
369 | QWindowList windows = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
370 | for (int i = 0; i < windows.count()
| 0 | ||||||||||||||||||||||||||||||||||||
371 | QWindow *window = windows.at(i); | - | ||||||||||||||||||||||||||||||||||||
372 | if (!window->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
373 | updateBlockedStatus(window); never executed: updateBlockedStatus(window); | 0 | ||||||||||||||||||||||||||||||||||||
374 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
375 | - | |||||||||||||||||||||||||||||||||||||
376 | updateBlockedStatus(modal); | - | ||||||||||||||||||||||||||||||||||||
377 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
378 | - | |||||||||||||||||||||||||||||||||||||
379 | void QGuiApplicationPrivate::hideModalWindow(QWindow *window) | - | ||||||||||||||||||||||||||||||||||||
380 | { | - | ||||||||||||||||||||||||||||||||||||
381 | self->modalWindowList.removeAll(window); | - | ||||||||||||||||||||||||||||||||||||
382 | - | |||||||||||||||||||||||||||||||||||||
383 | QWindowList windows = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
384 | for (int i = 0; i < windows.count()
| 0 | ||||||||||||||||||||||||||||||||||||
385 | QWindow *window = windows.at(i); | - | ||||||||||||||||||||||||||||||||||||
386 | if (window->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
387 | updateBlockedStatus(window); never executed: updateBlockedStatus(window); | 0 | ||||||||||||||||||||||||||||||||||||
388 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
389 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
390 | - | |||||||||||||||||||||||||||||||||||||
391 | - | |||||||||||||||||||||||||||||||||||||
392 | - | |||||||||||||||||||||||||||||||||||||
393 | - | |||||||||||||||||||||||||||||||||||||
394 | - | |||||||||||||||||||||||||||||||||||||
395 | - | |||||||||||||||||||||||||||||||||||||
396 | bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const | - | ||||||||||||||||||||||||||||||||||||
397 | { | - | ||||||||||||||||||||||||||||||||||||
398 | QWindow *unused = 0; | - | ||||||||||||||||||||||||||||||||||||
399 | if (!blockingWindow
| 0 | ||||||||||||||||||||||||||||||||||||
400 | blockingWindow = &unused; never executed: blockingWindow = &unused; | 0 | ||||||||||||||||||||||||||||||||||||
401 | - | |||||||||||||||||||||||||||||||||||||
402 | if (modalWindowList.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
403 | *blockingWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
404 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
405 | } | - | ||||||||||||||||||||||||||||||||||||
406 | - | |||||||||||||||||||||||||||||||||||||
407 | for (int i = 0; i < modalWindowList.count()
| 0 | ||||||||||||||||||||||||||||||||||||
408 | QWindow *modalWindow = modalWindowList.at(i); | - | ||||||||||||||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||||||||||||||
410 | { | - | ||||||||||||||||||||||||||||||||||||
411 | - | |||||||||||||||||||||||||||||||||||||
412 | QWindow *w = window; | - | ||||||||||||||||||||||||||||||||||||
413 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
414 | if (w == modalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
415 | *blockingWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
416 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
417 | } | - | ||||||||||||||||||||||||||||||||||||
418 | QWindow *p = w->parent(); | - | ||||||||||||||||||||||||||||||||||||
419 | if (!p
| 0 | ||||||||||||||||||||||||||||||||||||
420 | p = w->transientParent(); never executed: p = w->transientParent(); | 0 | ||||||||||||||||||||||||||||||||||||
421 | w = p; | - | ||||||||||||||||||||||||||||||||||||
422 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
423 | } | - | ||||||||||||||||||||||||||||||||||||
424 | - | |||||||||||||||||||||||||||||||||||||
425 | Qt::WindowModality windowModality = modalWindow->modality(); | - | ||||||||||||||||||||||||||||||||||||
426 | switch (windowModality) { | - | ||||||||||||||||||||||||||||||||||||
427 | case never executed: Qt::ApplicationModal:case Qt::ApplicationModal: never executed: case Qt::ApplicationModal: | 0 | ||||||||||||||||||||||||||||||||||||
428 | { | - | ||||||||||||||||||||||||||||||||||||
429 | if (modalWindow != window
| 0 | ||||||||||||||||||||||||||||||||||||
430 | *blockingWindow = modalWindow; | - | ||||||||||||||||||||||||||||||||||||
431 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
432 | } | - | ||||||||||||||||||||||||||||||||||||
433 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
434 | } | - | ||||||||||||||||||||||||||||||||||||
435 | case never executed: Qt::WindowModal:case Qt::WindowModal: never executed: case Qt::WindowModal: | 0 | ||||||||||||||||||||||||||||||||||||
436 | { | - | ||||||||||||||||||||||||||||||||||||
437 | QWindow *w = window; | - | ||||||||||||||||||||||||||||||||||||
438 | do { | - | ||||||||||||||||||||||||||||||||||||
439 | QWindow *m = modalWindow; | - | ||||||||||||||||||||||||||||||||||||
440 | do { | - | ||||||||||||||||||||||||||||||||||||
441 | if (m == w
| 0 | ||||||||||||||||||||||||||||||||||||
442 | *blockingWindow = m; | - | ||||||||||||||||||||||||||||||||||||
443 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
444 | } | - | ||||||||||||||||||||||||||||||||||||
445 | QWindow *p = m->parent(); | - | ||||||||||||||||||||||||||||||||||||
446 | if (!p
| 0 | ||||||||||||||||||||||||||||||||||||
447 | p = m->transientParent(); never executed: p = m->transientParent(); | 0 | ||||||||||||||||||||||||||||||||||||
448 | m = p; | - | ||||||||||||||||||||||||||||||||||||
449 | } never executed: while (mend of block
| 0 | ||||||||||||||||||||||||||||||||||||
450 | QWindow *p = w->parent(); | - | ||||||||||||||||||||||||||||||||||||
451 | if (!p
| 0 | ||||||||||||||||||||||||||||||||||||
452 | p = w->transientParent(); never executed: p = w->transientParent(); | 0 | ||||||||||||||||||||||||||||||||||||
453 | w = p; | - | ||||||||||||||||||||||||||||||||||||
454 | } never executed: while (wend of block
| 0 | ||||||||||||||||||||||||||||||||||||
455 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
456 | } | - | ||||||||||||||||||||||||||||||||||||
457 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
458 | ((!(false)) ? qt_assert_x("QGuiApplication", "internal error, a modal widget cannot be modeless",__FILE__,820) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
459 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
460 | } | - | ||||||||||||||||||||||||||||||||||||
461 | } | - | ||||||||||||||||||||||||||||||||||||
462 | *blockingWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
463 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
464 | } | - | ||||||||||||||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||||||||||||||
468 | - | |||||||||||||||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||||||||||||||
470 | QWindow *QGuiApplication::focusWindow() | - | ||||||||||||||||||||||||||||||||||||
471 | { | - | ||||||||||||||||||||||||||||||||||||
472 | return never executed: QGuiApplicationPrivate::focus_window;return QGuiApplicationPrivate::focus_window; never executed: return QGuiApplicationPrivate::focus_window; | 0 | ||||||||||||||||||||||||||||||||||||
473 | } | - | ||||||||||||||||||||||||||||||||||||
474 | QObject *QGuiApplication::focusObject() | - | ||||||||||||||||||||||||||||||||||||
475 | { | - | ||||||||||||||||||||||||||||||||||||
476 | if (focusWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
477 | return never executed: focusWindow()->focusObject();return focusWindow()->focusObject(); never executed: return focusWindow()->focusObject(); | 0 | ||||||||||||||||||||||||||||||||||||
478 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
479 | } | - | ||||||||||||||||||||||||||||||||||||
480 | QWindowList QGuiApplication::allWindows() | - | ||||||||||||||||||||||||||||||||||||
481 | { | - | ||||||||||||||||||||||||||||||||||||
482 | return never executed: QGuiApplicationPrivate::window_list;return QGuiApplicationPrivate::window_list; never executed: return QGuiApplicationPrivate::window_list; | 0 | ||||||||||||||||||||||||||||||||||||
483 | } | - | ||||||||||||||||||||||||||||||||||||
484 | QWindowList QGuiApplication::topLevelWindows() | - | ||||||||||||||||||||||||||||||||||||
485 | { | - | ||||||||||||||||||||||||||||||||||||
486 | const QWindowList &list = QGuiApplicationPrivate::window_list; | - | ||||||||||||||||||||||||||||||||||||
487 | QWindowList topLevelWindows; | - | ||||||||||||||||||||||||||||||||||||
488 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
489 | if (!list.at(i)->parent()
| 0 | ||||||||||||||||||||||||||||||||||||
490 | - | |||||||||||||||||||||||||||||||||||||
491 | - | |||||||||||||||||||||||||||||||||||||
492 | const bool embedded = list.at(i)->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
493 | if (!embedded
| 0 | ||||||||||||||||||||||||||||||||||||
494 | topLevelWindows.prepend(list.at(i)); never executed: topLevelWindows.prepend(list.at(i)); | 0 | ||||||||||||||||||||||||||||||||||||
495 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
496 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
497 | return never executed: topLevelWindows;return topLevelWindows; never executed: return topLevelWindows; | 0 | ||||||||||||||||||||||||||||||||||||
498 | } | - | ||||||||||||||||||||||||||||||||||||
499 | - | |||||||||||||||||||||||||||||||||||||
500 | QScreen *QGuiApplication::primaryScreen() | - | ||||||||||||||||||||||||||||||||||||
501 | { | - | ||||||||||||||||||||||||||||||||||||
502 | if (QGuiApplicationPrivate::screen_list.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
503 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
504 | return never executed: QGuiApplicationPrivate::screen_list.at(0);return QGuiApplicationPrivate::screen_list.at(0); never executed: return QGuiApplicationPrivate::screen_list.at(0); | 0 | ||||||||||||||||||||||||||||||||||||
505 | } | - | ||||||||||||||||||||||||||||||||||||
506 | - | |||||||||||||||||||||||||||||||||||||
507 | - | |||||||||||||||||||||||||||||||||||||
508 | - | |||||||||||||||||||||||||||||||||||||
509 | - | |||||||||||||||||||||||||||||||||||||
510 | - | |||||||||||||||||||||||||||||||||||||
511 | QList<QScreen *> QGuiApplication::screens() | - | ||||||||||||||||||||||||||||||||||||
512 | { | - | ||||||||||||||||||||||||||||||||||||
513 | return never executed: QGuiApplicationPrivate::screen_list;return QGuiApplicationPrivate::screen_list; never executed: return QGuiApplicationPrivate::screen_list; | 0 | ||||||||||||||||||||||||||||||||||||
514 | } | - | ||||||||||||||||||||||||||||||||||||
515 | qreal QGuiApplication::devicePixelRatio() const | - | ||||||||||||||||||||||||||||||||||||
516 | { | - | ||||||||||||||||||||||||||||||||||||
517 | - | |||||||||||||||||||||||||||||||||||||
518 | static qreal topDevicePixelRatio = 0.0; | - | ||||||||||||||||||||||||||||||||||||
519 | if (!qFuzzyIsNull(topDevicePixelRatio)
| 0 | ||||||||||||||||||||||||||||||||||||
520 | return never executed: topDevicePixelRatio;return topDevicePixelRatio; never executed: return topDevicePixelRatio; | 0 | ||||||||||||||||||||||||||||||||||||
521 | } | - | ||||||||||||||||||||||||||||||||||||
522 | - | |||||||||||||||||||||||||||||||||||||
523 | topDevicePixelRatio = 1.0; | - | ||||||||||||||||||||||||||||||||||||
524 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(QGuiApplicationPrivate::screen_list)>::type> _container_((QGuiApplicationPrivate::screen_list)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QScreen *screen = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
525 | topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio()); | - | ||||||||||||||||||||||||||||||||||||
526 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
527 | - | |||||||||||||||||||||||||||||||||||||
528 | return never executed: topDevicePixelRatio;return topDevicePixelRatio; never executed: return topDevicePixelRatio; | 0 | ||||||||||||||||||||||||||||||||||||
529 | } | - | ||||||||||||||||||||||||||||||||||||
530 | - | |||||||||||||||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||||||||||||||
532 | - | |||||||||||||||||||||||||||||||||||||
533 | - | |||||||||||||||||||||||||||||||||||||
534 | QWindow *QGuiApplication::topLevelAt(const QPoint &pos) | - | ||||||||||||||||||||||||||||||||||||
535 | { | - | ||||||||||||||||||||||||||||||||||||
536 | const QList<QScreen *> screens = QGuiApplication::screens(); | - | ||||||||||||||||||||||||||||||||||||
537 | if (!screens.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
538 | const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings(); | - | ||||||||||||||||||||||||||||||||||||
539 | QScreen *windowScreen = nullptr; | - | ||||||||||||||||||||||||||||||||||||
540 | - | |||||||||||||||||||||||||||||||||||||
541 | - | |||||||||||||||||||||||||||||||||||||
542 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(primaryScreens)>::type> _container_((primaryScreens)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QScreen *screen = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
543 | if (screen->geometry().contains(pos)
| 0 | ||||||||||||||||||||||||||||||||||||
544 | windowScreen = screen; | - | ||||||||||||||||||||||||||||||||||||
545 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
546 | } | - | ||||||||||||||||||||||||||||||||||||
547 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||||||||||||||
552 | if (!windowScreen
| 0 | ||||||||||||||||||||||||||||||||||||
553 | for (int i = 1; i < screens.size()
| 0 | ||||||||||||||||||||||||||||||||||||
554 | QScreen *screen = screens[i]; | - | ||||||||||||||||||||||||||||||||||||
555 | if (screen->geometry().contains(pos)
| 0 | ||||||||||||||||||||||||||||||||||||
556 | windowScreen = screen; | - | ||||||||||||||||||||||||||||||||||||
557 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
558 | } | - | ||||||||||||||||||||||||||||||||||||
559 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
560 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
561 | - | |||||||||||||||||||||||||||||||||||||
562 | if (windowScreen
| 0 | ||||||||||||||||||||||||||||||||||||
563 | const QPoint devicePosition = QHighDpi::toNativePixels(pos, windowScreen); | - | ||||||||||||||||||||||||||||||||||||
564 | return never executed: windowScreen->handle()->topLevelAt(devicePosition);return windowScreen->handle()->topLevelAt(devicePosition); never executed: return windowScreen->handle()->topLevelAt(devicePosition); | 0 | ||||||||||||||||||||||||||||||||||||
565 | } | - | ||||||||||||||||||||||||||||||||||||
566 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
567 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
568 | } | - | ||||||||||||||||||||||||||||||||||||
569 | QString QGuiApplication::platformName() | - | ||||||||||||||||||||||||||||||||||||
570 | { | - | ||||||||||||||||||||||||||||||||||||
571 | return never executed: QGuiApplicationPrivate::platform_namereturn QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
never executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString(); | 0 | ||||||||||||||||||||||||||||||||||||
572 | *QGuiApplicationPrivate::platform_name : QString(); never executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString(); | 0 | ||||||||||||||||||||||||||||||||||||
573 | } | - | ||||||||||||||||||||||||||||||||||||
574 | - | |||||||||||||||||||||||||||||||||||||
575 | static void init_platform(const QString &pluginArgument, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv) | - | ||||||||||||||||||||||||||||||||||||
576 | { | - | ||||||||||||||||||||||||||||||||||||
577 | - | |||||||||||||||||||||||||||||||||||||
578 | QStringList arguments = pluginArgument.split(QLatin1Char(':')); | - | ||||||||||||||||||||||||||||||||||||
579 | const QString name = arguments.takeFirst().toLower(); | - | ||||||||||||||||||||||||||||||||||||
580 | QString argumentsKey = name; | - | ||||||||||||||||||||||||||||||||||||
581 | argumentsKey[0] = argumentsKey.at(0).toUpper(); | - | ||||||||||||||||||||||||||||||||||||
582 | arguments.append(QLibraryInfo::platformPluginArguments(argumentsKey)); | - | ||||||||||||||||||||||||||||||||||||
583 | - | |||||||||||||||||||||||||||||||||||||
584 | - | |||||||||||||||||||||||||||||||||||||
585 | QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, argc, argv, platformPluginPath); | - | ||||||||||||||||||||||||||||||||||||
586 | if (QGuiApplicationPrivate::platform_integration
| 0 | ||||||||||||||||||||||||||||||||||||
587 | QGuiApplicationPrivate::platform_name = new QString(name); | - | ||||||||||||||||||||||||||||||||||||
588 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
589 | QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); | - | ||||||||||||||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||||||||||||||
591 | QString fatalMessage | - | ||||||||||||||||||||||||||||||||||||
592 | = ([]() -> QString { enum { Size = sizeof(u"" "This application failed to start because it could not find or load the Qt platform plugin \"%1\"\nin \"%2\".\n\n")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "This application failed to start because it could not find or load the Qt platform plugin \"%1\"\nin \"%2\".\n\n" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()).arg(name, QDir::toNativeSeparators(platformPluginPath));return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
593 | if (!keys.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
594 | fatalMessage += ([]() -> QString { enum { Size = sizeof(u"" "Available platform plugins are: %1.\n\n")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Available platform plugins are: %1.\n\n" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()).arg(return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
595 | keys.join(([]() -> QString { enum { Size = sizeof(u"" ", ")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ", " }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }())));return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
596 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
597 | fatalMessage += ([]() -> QString { enum { Size = sizeof(u"" "Reinstalling the application may fix this problem.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Reinstalling the application may fix this problem." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
598 | - | |||||||||||||||||||||||||||||||||||||
599 | - | |||||||||||||||||||||||||||||||||||||
600 | - | |||||||||||||||||||||||||||||||||||||
601 | - | |||||||||||||||||||||||||||||||||||||
602 | - | |||||||||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||||||||
604 | QMessageLogger(__FILE__, 1087, __PRETTY_FUNCTION__).fatal("%s", QString(fatalMessage).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||||||||||||||
605 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
606 | } | - | ||||||||||||||||||||||||||||||||||||
607 | - | |||||||||||||||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||||||||||||||
609 | - | |||||||||||||||||||||||||||||||||||||
610 | if (QGuiApplication::primaryScreen()
| 0 | ||||||||||||||||||||||||||||||||||||
611 | QGuiApplicationPrivate::highDpiScalingUpdated = true; | - | ||||||||||||||||||||||||||||||||||||
612 | QHighDpiScaling::updateHighDpiScaling(); | - | ||||||||||||||||||||||||||||||||||||
613 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
614 | - | |||||||||||||||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||||||||||||||
616 | - | |||||||||||||||||||||||||||||||||||||
617 | - | |||||||||||||||||||||||||||||||||||||
618 | QStringList themeNames; | - | ||||||||||||||||||||||||||||||||||||
619 | if (!platformThemeName.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
620 | themeNames.append(platformThemeName); never executed: themeNames.append(platformThemeName); | 0 | ||||||||||||||||||||||||||||||||||||
621 | - | |||||||||||||||||||||||||||||||||||||
622 | - | |||||||||||||||||||||||||||||||||||||
623 | themeNames += QGuiApplicationPrivate::platform_integration->themeNames(); | - | ||||||||||||||||||||||||||||||||||||
624 | - | |||||||||||||||||||||||||||||||||||||
625 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(themeNames)>::type> _container_((themeNames)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QString &themeName = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
626 | QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath); | - | ||||||||||||||||||||||||||||||||||||
627 | if (QGuiApplicationPrivate::platform_theme
| 0 | ||||||||||||||||||||||||||||||||||||
628 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
629 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||||||||||||||
633 | if (!QGuiApplicationPrivate::platform_theme
| 0 | ||||||||||||||||||||||||||||||||||||
634 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(themeNames)>::type> _container_((themeNames)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QString &themeName = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
635 | QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName); | - | ||||||||||||||||||||||||||||||||||||
636 | if (QGuiApplicationPrivate::platform_theme
| 0 | ||||||||||||||||||||||||||||||||||||
637 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
638 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
639 | - | |||||||||||||||||||||||||||||||||||||
640 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
641 | - | |||||||||||||||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||||||||||||||
643 | if (!QGuiApplicationPrivate::platform_theme
| 0 | ||||||||||||||||||||||||||||||||||||
644 | QGuiApplicationPrivate::platform_theme = new QPlatformTheme; never executed: QGuiApplicationPrivate::platform_theme = new QPlatformTheme; | 0 | ||||||||||||||||||||||||||||||||||||
645 | - | |||||||||||||||||||||||||||||||||||||
646 | - | |||||||||||||||||||||||||||||||||||||
647 | - | |||||||||||||||||||||||||||||||||||||
648 | - | |||||||||||||||||||||||||||||||||||||
649 | if (!arguments.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
650 | if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()
| 0 | ||||||||||||||||||||||||||||||||||||
651 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(arguments)>::type> _container_((arguments)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QString &argument = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
652 | const int equalsPos = argument.indexOf(QLatin1Char('=')); | - | ||||||||||||||||||||||||||||||||||||
653 | const QByteArray name = | - | ||||||||||||||||||||||||||||||||||||
654 | equalsPos != -1
| 0 | ||||||||||||||||||||||||||||||||||||
655 | const QVariant value = | - | ||||||||||||||||||||||||||||||||||||
656 | equalsPos != -1
| 0 | ||||||||||||||||||||||||||||||||||||
657 | nativeInterface->setProperty(name.constData(), value); | - | ||||||||||||||||||||||||||||||||||||
658 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
659 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
660 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
661 | - | |||||||||||||||||||||||||||||||||||||
662 | - | |||||||||||||||||||||||||||||||||||||
663 | fontSmoothingGamma = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal(); | - | ||||||||||||||||||||||||||||||||||||
664 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
665 | - | |||||||||||||||||||||||||||||||||||||
666 | static void init_plugins(const QList<QByteArray> &pluginList) | - | ||||||||||||||||||||||||||||||||||||
667 | { | - | ||||||||||||||||||||||||||||||||||||
668 | for (int i = 0; i < pluginList.count()
| 0 | ||||||||||||||||||||||||||||||||||||
669 | QByteArray pluginSpec = pluginList.at(i); | - | ||||||||||||||||||||||||||||||||||||
670 | int colonPos = pluginSpec.indexOf(':'); | - | ||||||||||||||||||||||||||||||||||||
671 | QObject *plugin; | - | ||||||||||||||||||||||||||||||||||||
672 | if (colonPos < 0
| 0 | ||||||||||||||||||||||||||||||||||||
673 | plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString()); never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString()); | 0 | ||||||||||||||||||||||||||||||||||||
674 | else | - | ||||||||||||||||||||||||||||||||||||
675 | plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1))); | 0 | ||||||||||||||||||||||||||||||||||||
676 | QLatin1String(pluginSpec.mid(colonPos+1))); never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1))); | 0 | ||||||||||||||||||||||||||||||||||||
677 | if (plugin
| 0 | ||||||||||||||||||||||||||||||||||||
678 | QGuiApplicationPrivate::generic_plugin_list.append(plugin); never executed: QGuiApplicationPrivate::generic_plugin_list.append(plugin); | 0 | ||||||||||||||||||||||||||||||||||||
679 | else | - | ||||||||||||||||||||||||||||||||||||
680 | QMessageLogger(__FILE__, 1163, __PRETTY_FUNCTION__).warning() << "No such plugin for spec " << pluginSpec; never executed: QMessageLogger(__FILE__, 1163, __PRETTY_FUNCTION__).warning() << "No such plugin for spec " << pluginSpec; | 0 | ||||||||||||||||||||||||||||||||||||
681 | } | - | ||||||||||||||||||||||||||||||||||||
682 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
683 | - | |||||||||||||||||||||||||||||||||||||
684 | void QGuiApplicationPrivate::createPlatformIntegration() | - | ||||||||||||||||||||||||||||||||||||
685 | { | - | ||||||||||||||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||||||||||||||
689 | QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true); | - | ||||||||||||||||||||||||||||||||||||
690 | - | |||||||||||||||||||||||||||||||||||||
691 | - | |||||||||||||||||||||||||||||||||||||
692 | QHighDpiScaling::initHighDpiScaling(); | - | ||||||||||||||||||||||||||||||||||||
693 | - | |||||||||||||||||||||||||||||||||||||
694 | - | |||||||||||||||||||||||||||||||||||||
695 | QString platformPluginPath = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); | - | ||||||||||||||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||||||||||||||
698 | QByteArray platformName; | - | ||||||||||||||||||||||||||||||||||||
699 | - | |||||||||||||||||||||||||||||||||||||
700 | platformName = "xcb"; | - | ||||||||||||||||||||||||||||||||||||
701 | - | |||||||||||||||||||||||||||||||||||||
702 | QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM"); | - | ||||||||||||||||||||||||||||||||||||
703 | if (!platformNameEnv.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
704 | platformName = platformNameEnv; | - | ||||||||||||||||||||||||||||||||||||
705 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
706 | - | |||||||||||||||||||||||||||||||||||||
707 | QString platformThemeName = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORMTHEME")); | - | ||||||||||||||||||||||||||||||||||||
708 | - | |||||||||||||||||||||||||||||||||||||
709 | - | |||||||||||||||||||||||||||||||||||||
710 | - | |||||||||||||||||||||||||||||||||||||
711 | QString icon; | - | ||||||||||||||||||||||||||||||||||||
712 | - | |||||||||||||||||||||||||||||||||||||
713 | int j = argc
| 0 | ||||||||||||||||||||||||||||||||||||
714 | for (int i=1; i<argc
| 0 | ||||||||||||||||||||||||||||||||||||
715 | if (!argv[i]
| 0 | ||||||||||||||||||||||||||||||||||||
716 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
717 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
718 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
719 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
720 | } | - | ||||||||||||||||||||||||||||||||||||
721 | const bool isXcb = platformName == "xcb"; | - | ||||||||||||||||||||||||||||||||||||
722 | const char *arg = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
723 | if (arg[1] == '-'
| 0 | ||||||||||||||||||||||||||||||||||||
724 | ++ never executed: arg;++arg; never executed: ++arg; | 0 | ||||||||||||||||||||||||||||||||||||
725 | if (strcmp(arg, "-platformpluginpath") == 0
| 0 | ||||||||||||||||||||||||||||||||||||
726 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
727 | platformPluginPath = QString::fromLocal8Bit(argv[i]); never executed: platformPluginPath = QString::fromLocal8Bit(argv[i]); | 0 | ||||||||||||||||||||||||||||||||||||
728 | } never executed: else if (strcmp(arg, "-platform") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
729 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
730 | platformName = argv[i]; never executed: platformName = argv[i]; | 0 | ||||||||||||||||||||||||||||||||||||
731 | } never executed: else if (strcmp(arg, "-platformtheme") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
732 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
733 | platformThemeName = QString::fromLocal8Bit(argv[i]); never executed: platformThemeName = QString::fromLocal8Bit(argv[i]); | 0 | ||||||||||||||||||||||||||||||||||||
734 | } never executed: else if (strcmp(arg, "-qwindowgeometry") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
735 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
736 | windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); never executed: windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); | 0 | ||||||||||||||||||||||||||||||||||||
737 | } never executed: else if (strcmp(arg, "-qwindowtitle") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
738 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
739 | firstWindowTitle = QString::fromLocal8Bit(argv[i]); never executed: firstWindowTitle = QString::fromLocal8Bit(argv[i]); | 0 | ||||||||||||||||||||||||||||||||||||
740 | } never executed: else if (strcmp(arg, "-qwindowicon") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
741 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
742 | icon = QString::fromLocal8Bit(argv[i]); | - | ||||||||||||||||||||||||||||||||||||
743 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
744 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
745 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
746 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
747 | } | - | ||||||||||||||||||||||||||||||||||||
748 | - | |||||||||||||||||||||||||||||||||||||
749 | if (j < argc
| 0 | ||||||||||||||||||||||||||||||||||||
750 | argv[j] = 0; | - | ||||||||||||||||||||||||||||||||||||
751 | argc = j; | - | ||||||||||||||||||||||||||||||||||||
752 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
753 | - | |||||||||||||||||||||||||||||||||||||
754 | init_platform(QLatin1String(platformName), platformPluginPath, platformThemeName, argc, argv); | - | ||||||||||||||||||||||||||||||||||||
755 | - | |||||||||||||||||||||||||||||||||||||
756 | if (!icon.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
757 | forcedWindowIcon = QDir::isAbsolutePath(icon)
never executed: forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon); | 0 | ||||||||||||||||||||||||||||||||||||
758 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||||||||||||||
760 | - | |||||||||||||||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||||||||||||||
762 | - | |||||||||||||||||||||||||||||||||||||
763 | - | |||||||||||||||||||||||||||||||||||||
764 | - | |||||||||||||||||||||||||||||||||||||
765 | - | |||||||||||||||||||||||||||||||||||||
766 | void QGuiApplicationPrivate::createEventDispatcher() | - | ||||||||||||||||||||||||||||||||||||
767 | { | - | ||||||||||||||||||||||||||||||||||||
768 | ((!(!eventDispatcher)) ? qt_assert("!eventDispatcher",__FILE__,1251) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
769 | - | |||||||||||||||||||||||||||||||||||||
770 | if (platform_integration == 0
| 0 | ||||||||||||||||||||||||||||||||||||
771 | createPlatformIntegration(); never executed: createPlatformIntegration(); | 0 | ||||||||||||||||||||||||||||||||||||
772 | - | |||||||||||||||||||||||||||||||||||||
773 | - | |||||||||||||||||||||||||||||||||||||
774 | ((!(!eventDispatcher)) ? qt_assert("!eventDispatcher",__FILE__,1257) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
775 | - | |||||||||||||||||||||||||||||||||||||
776 | eventDispatcher = platform_integration->createEventDispatcher(); | - | ||||||||||||||||||||||||||||||||||||
777 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
778 | - | |||||||||||||||||||||||||||||||||||||
779 | void QGuiApplicationPrivate::eventDispatcherReady() | - | ||||||||||||||||||||||||||||||||||||
780 | { | - | ||||||||||||||||||||||||||||||||||||
781 | if (platform_integration == 0
| 0 | ||||||||||||||||||||||||||||||||||||
782 | createPlatformIntegration(); never executed: createPlatformIntegration(); | 0 | ||||||||||||||||||||||||||||||||||||
783 | - | |||||||||||||||||||||||||||||||||||||
784 | platform_integration->initialize(); | - | ||||||||||||||||||||||||||||||||||||
785 | - | |||||||||||||||||||||||||||||||||||||
786 | - | |||||||||||||||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||||||||||||||
788 | if (!QGuiApplicationPrivate::highDpiScalingUpdated
| 0 | ||||||||||||||||||||||||||||||||||||
789 | QHighDpiScaling::updateHighDpiScaling(); never executed: QHighDpiScaling::updateHighDpiScaling(); | 0 | ||||||||||||||||||||||||||||||||||||
790 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
791 | - | |||||||||||||||||||||||||||||||||||||
792 | void QGuiApplicationPrivate::init() | - | ||||||||||||||||||||||||||||||||||||
793 | { | - | ||||||||||||||||||||||||||||||||||||
794 | QCoreApplicationPrivate::init(); | - | ||||||||||||||||||||||||||||||||||||
795 | - | |||||||||||||||||||||||||||||||||||||
796 | QCoreApplicationPrivate::is_app_running = false; | - | ||||||||||||||||||||||||||||||||||||
797 | - | |||||||||||||||||||||||||||||||||||||
798 | bool loadTestability = false; | - | ||||||||||||||||||||||||||||||||||||
799 | QList<QByteArray> pluginList; | - | ||||||||||||||||||||||||||||||||||||
800 | - | |||||||||||||||||||||||||||||||||||||
801 | - | |||||||||||||||||||||||||||||||||||||
802 | QString session_id; | - | ||||||||||||||||||||||||||||||||||||
803 | QString session_key; | - | ||||||||||||||||||||||||||||||||||||
804 | QString s; | - | ||||||||||||||||||||||||||||||||||||
805 | int j = argc
| 0 | ||||||||||||||||||||||||||||||||||||
806 | for (int i=1; i<argc
| 0 | ||||||||||||||||||||||||||||||||||||
807 | if (!argv[i]
| 0 | ||||||||||||||||||||||||||||||||||||
808 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
809 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
810 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
811 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
812 | } | - | ||||||||||||||||||||||||||||||||||||
813 | const char *arg = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
814 | if (arg[1] == '-'
| 0 | ||||||||||||||||||||||||||||||||||||
815 | ++ never executed: arg;++arg; never executed: ++arg; | 0 | ||||||||||||||||||||||||||||||||||||
816 | if (strcmp(arg, "-plugin") == 0
| 0 | ||||||||||||||||||||||||||||||||||||
817 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
818 | pluginList << argv[i]; never executed: pluginList << argv[i]; | 0 | ||||||||||||||||||||||||||||||||||||
819 | } never executed: else if (strcmp(arg, "-reverse") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
820 | force_reverse = true; | - | ||||||||||||||||||||||||||||||||||||
821 | } never executed: else if (strcmp(arg, "-session") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
822 | ++i; | - | ||||||||||||||||||||||||||||||||||||
823 | if (argv[i]
| 0 | ||||||||||||||||||||||||||||||||||||
824 | session_id = QString::fromLatin1(argv[i]); | - | ||||||||||||||||||||||||||||||||||||
825 | int p = session_id.indexOf(QLatin1Char('_')); | - | ||||||||||||||||||||||||||||||||||||
826 | if (p >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
827 | session_key = session_id.mid(p +1); | - | ||||||||||||||||||||||||||||||||||||
828 | session_id = session_id.left(p); | - | ||||||||||||||||||||||||||||||||||||
829 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
830 | is_session_restored = true; | - | ||||||||||||||||||||||||||||||||||||
831 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
832 | - | |||||||||||||||||||||||||||||||||||||
833 | } never executed: else if (strcmp(arg, "-testability") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
834 | loadTestability = true; | - | ||||||||||||||||||||||||||||||||||||
835 | } never executed: else if (strncmp(arg, "-style=", 7) == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
836 | s = QString::fromLocal8Bit(arg + 7).toLower(); | - | ||||||||||||||||||||||||||||||||||||
837 | } never executed: else if (strcmp(arg, "-style") == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
838 | s = QString::fromLocal8Bit(argv[++i]).toLower(); | - | ||||||||||||||||||||||||||||||||||||
839 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
840 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||||||||||||||
841 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
842 | - | |||||||||||||||||||||||||||||||||||||
843 | if (!s.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
844 | styleOverride = s; never executed: styleOverride = s; | 0 | ||||||||||||||||||||||||||||||||||||
845 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
846 | - | |||||||||||||||||||||||||||||||||||||
847 | if (j < argc
| 0 | ||||||||||||||||||||||||||||||||||||
848 | argv[j] = 0; | - | ||||||||||||||||||||||||||||||||||||
849 | argc = j; | - | ||||||||||||||||||||||||||||||||||||
850 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
851 | - | |||||||||||||||||||||||||||||||||||||
852 | - | |||||||||||||||||||||||||||||||||||||
853 | QByteArray envPlugins = qgetenv("QT_QPA_GENERIC_PLUGINS"); | - | ||||||||||||||||||||||||||||||||||||
854 | if (!envPlugins.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
855 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(envPlugins.split(','))>::type> _container_((envPlugins.split(','))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QByteArray &plugin = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
856 | pluginList << plugin; never executed: pluginList << plugin; | 0 | ||||||||||||||||||||||||||||||||||||
857 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
858 | - | |||||||||||||||||||||||||||||||||||||
859 | if (platform_integration == 0
| 0 | ||||||||||||||||||||||||||||||||||||
860 | createPlatformIntegration(); never executed: createPlatformIntegration(); | 0 | ||||||||||||||||||||||||||||||||||||
861 | - | |||||||||||||||||||||||||||||||||||||
862 | initPalette(); | - | ||||||||||||||||||||||||||||||||||||
863 | QFont::initialize(); | - | ||||||||||||||||||||||||||||||||||||
864 | - | |||||||||||||||||||||||||||||||||||||
865 | mouse_double_click_distance = platformTheme()->themeHint(QPlatformTheme::MouseDoubleClickDistance).toInt(); | - | ||||||||||||||||||||||||||||||||||||
866 | - | |||||||||||||||||||||||||||||||||||||
867 | - | |||||||||||||||||||||||||||||||||||||
868 | QCursorData::initialize(); | - | ||||||||||||||||||||||||||||||||||||
869 | - | |||||||||||||||||||||||||||||||||||||
870 | - | |||||||||||||||||||||||||||||||||||||
871 | - | |||||||||||||||||||||||||||||||||||||
872 | qRegisterGuiVariant(); | - | ||||||||||||||||||||||||||||||||||||
873 | - | |||||||||||||||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||||||||||||||
875 | - | |||||||||||||||||||||||||||||||||||||
876 | qRegisterGuiGetInterpolator(); | - | ||||||||||||||||||||||||||||||||||||
877 | - | |||||||||||||||||||||||||||||||||||||
878 | - | |||||||||||||||||||||||||||||||||||||
879 | - | |||||||||||||||||||||||||||||||||||||
880 | - | |||||||||||||||||||||||||||||||||||||
881 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
882 | QOpenGLContext *ctx = new QOpenGLContext; | - | ||||||||||||||||||||||||||||||||||||
883 | ctx->setFormat(QSurfaceFormat::defaultFormat()); | - | ||||||||||||||||||||||||||||||||||||
884 | ctx->create(); | - | ||||||||||||||||||||||||||||||||||||
885 | qt_gl_set_global_share_context(ctx); | - | ||||||||||||||||||||||||||||||||||||
886 | ownGlobalShareContext = true; | - | ||||||||||||||||||||||||||||||||||||
887 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
888 | - | |||||||||||||||||||||||||||||||||||||
889 | - | |||||||||||||||||||||||||||||||||||||
890 | QWindowSystemInterfacePrivate::eventTime.start(); | - | ||||||||||||||||||||||||||||||||||||
891 | - | |||||||||||||||||||||||||||||||||||||
892 | is_app_running = true; | - | ||||||||||||||||||||||||||||||||||||
893 | init_plugins(pluginList); | - | ||||||||||||||||||||||||||||||||||||
894 | QWindowSystemInterface::flushWindowSystemEvents(); | - | ||||||||||||||||||||||||||||||||||||
895 | - | |||||||||||||||||||||||||||||||||||||
896 | - | |||||||||||||||||||||||||||||||||||||
897 | QGuiApplication * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
898 | - | |||||||||||||||||||||||||||||||||||||
899 | - | |||||||||||||||||||||||||||||||||||||
900 | session_manager = new QSessionManager(q, session_id, session_key); | - | ||||||||||||||||||||||||||||||||||||
901 | - | |||||||||||||||||||||||||||||||||||||
902 | - | |||||||||||||||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||||||||||||||
904 | if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0
| 0 | ||||||||||||||||||||||||||||||||||||
905 | loadTestability = true; never executed: loadTestability = true; | 0 | ||||||||||||||||||||||||||||||||||||
906 | - | |||||||||||||||||||||||||||||||||||||
907 | if (loadTestability
| 0 | ||||||||||||||||||||||||||||||||||||
908 | QLibrary testLib(([]() -> QString { enum { Size = sizeof(u"" "qttestability")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qttestability" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()));return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
909 | if (testLib.load()
| 0 | ||||||||||||||||||||||||||||||||||||
910 | typedef void (*TasInitialize)(void); | - | ||||||||||||||||||||||||||||||||||||
911 | TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); | - | ||||||||||||||||||||||||||||||||||||
912 | if (initFunction
| 0 | ||||||||||||||||||||||||||||||||||||
913 | initFunction(); | - | ||||||||||||||||||||||||||||||||||||
914 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
915 | QMessageLogger(__FILE__, 1422, __PRETTY_FUNCTION__).critical() << "Library qttestability resolve failed!"; | - | ||||||||||||||||||||||||||||||||||||
916 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
917 | } else { | - | ||||||||||||||||||||||||||||||||||||
918 | QMessageLogger(__FILE__, 1425, __PRETTY_FUNCTION__).critical() << "Library qttestability load failed:" << testLib.errorString(); | - | ||||||||||||||||||||||||||||||||||||
919 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
920 | } | - | ||||||||||||||||||||||||||||||||||||
921 | - | |||||||||||||||||||||||||||||||||||||
922 | - | |||||||||||||||||||||||||||||||||||||
923 | - | |||||||||||||||||||||||||||||||||||||
924 | - | |||||||||||||||||||||||||||||||||||||
925 | if (layout_direction == Qt::LayoutDirectionAuto
| 0 | ||||||||||||||||||||||||||||||||||||
926 | QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight); never executed: QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight); | 0 | ||||||||||||||||||||||||||||||||||||
927 | - | |||||||||||||||||||||||||||||||||||||
928 | scrollNoPhaseAllowed = qEnvironmentVariableIsSet("QT_ENABLE_MOUSE_WHEEL_TRACKING"); | - | ||||||||||||||||||||||||||||||||||||
929 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
930 | - | |||||||||||||||||||||||||||||||||||||
931 | extern void qt_cleanupFontDatabase(); | - | ||||||||||||||||||||||||||||||||||||
932 | - | |||||||||||||||||||||||||||||||||||||
933 | QGuiApplicationPrivate::~QGuiApplicationPrivate() | - | ||||||||||||||||||||||||||||||||||||
934 | { | - | ||||||||||||||||||||||||||||||||||||
935 | is_app_closing = true; | - | ||||||||||||||||||||||||||||||||||||
936 | is_app_running = false; | - | ||||||||||||||||||||||||||||||||||||
937 | - | |||||||||||||||||||||||||||||||||||||
938 | for (int i = 0; i < generic_plugin_list.count()
| 0 | ||||||||||||||||||||||||||||||||||||
939 | delete generic_plugin_list.at(i); never executed: delete generic_plugin_list.at(i); | 0 | ||||||||||||||||||||||||||||||||||||
940 | generic_plugin_list.clear(); | - | ||||||||||||||||||||||||||||||||||||
941 | - | |||||||||||||||||||||||||||||||||||||
942 | clearFontUnlocked(); | - | ||||||||||||||||||||||||||||||||||||
943 | - | |||||||||||||||||||||||||||||||||||||
944 | QFont::cleanup(); | - | ||||||||||||||||||||||||||||||||||||
945 | - | |||||||||||||||||||||||||||||||||||||
946 | - | |||||||||||||||||||||||||||||||||||||
947 | QCursorData::cleanup(); | - | ||||||||||||||||||||||||||||||||||||
948 | - | |||||||||||||||||||||||||||||||||||||
949 | - | |||||||||||||||||||||||||||||||||||||
950 | layout_direction = Qt::LeftToRight; | - | ||||||||||||||||||||||||||||||||||||
951 | - | |||||||||||||||||||||||||||||||||||||
952 | cleanupThreadData(); | - | ||||||||||||||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||||||||||||||
954 | delete QGuiApplicationPrivate::styleHints; | - | ||||||||||||||||||||||||||||||||||||
955 | QGuiApplicationPrivate::styleHints = nullptr; | - | ||||||||||||||||||||||||||||||||||||
956 | delete inputMethod; | - | ||||||||||||||||||||||||||||||||||||
957 | - | |||||||||||||||||||||||||||||||||||||
958 | qt_cleanupFontDatabase(); | - | ||||||||||||||||||||||||||||||||||||
959 | - | |||||||||||||||||||||||||||||||||||||
960 | QPixmapCache::clear(); | - | ||||||||||||||||||||||||||||||||||||
961 | - | |||||||||||||||||||||||||||||||||||||
962 | - | |||||||||||||||||||||||||||||||||||||
963 | if (ownGlobalShareContext
| 0 | ||||||||||||||||||||||||||||||||||||
964 | delete qt_gl_global_share_context(); | - | ||||||||||||||||||||||||||||||||||||
965 | qt_gl_set_global_share_context(0); | - | ||||||||||||||||||||||||||||||||||||
966 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
967 | - | |||||||||||||||||||||||||||||||||||||
968 | - | |||||||||||||||||||||||||||||||||||||
969 | platform_integration->destroy(); | - | ||||||||||||||||||||||||||||||||||||
970 | - | |||||||||||||||||||||||||||||||||||||
971 | delete platform_theme; | - | ||||||||||||||||||||||||||||||||||||
972 | platform_theme = 0; | - | ||||||||||||||||||||||||||||||||||||
973 | delete platform_integration; | - | ||||||||||||||||||||||||||||||||||||
974 | platform_integration = 0; | - | ||||||||||||||||||||||||||||||||||||
975 | delete m_gammaTables.load(); | - | ||||||||||||||||||||||||||||||||||||
976 | - | |||||||||||||||||||||||||||||||||||||
977 | window_list.clear(); | - | ||||||||||||||||||||||||||||||||||||
978 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
979 | Qt::KeyboardModifiers QGuiApplication::keyboardModifiers() | - | ||||||||||||||||||||||||||||||||||||
980 | { | - | ||||||||||||||||||||||||||||||||||||
981 | return never executed: QGuiApplicationPrivate::modifier_buttons;return QGuiApplicationPrivate::modifier_buttons; never executed: return QGuiApplicationPrivate::modifier_buttons; | 0 | ||||||||||||||||||||||||||||||||||||
982 | } | - | ||||||||||||||||||||||||||||||||||||
983 | Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers() | - | ||||||||||||||||||||||||||||||||||||
984 | { | - | ||||||||||||||||||||||||||||||||||||
985 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 1542, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: Qt::KeyboardModifiers(0);return Qt::KeyboardModifiers(0); never executed: }return Qt::KeyboardModifiers(0); | 0 | ||||||||||||||||||||||||||||||||||||
986 | QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); | - | ||||||||||||||||||||||||||||||||||||
987 | return never executed: pi->queryKeyboardModifiers();return pi->queryKeyboardModifiers(); never executed: return pi->queryKeyboardModifiers(); | 0 | ||||||||||||||||||||||||||||||||||||
988 | } | - | ||||||||||||||||||||||||||||||||||||
989 | Qt::MouseButtons QGuiApplication::mouseButtons() | - | ||||||||||||||||||||||||||||||||||||
990 | { | - | ||||||||||||||||||||||||||||||||||||
991 | return never executed: QGuiApplicationPrivate::mouse_buttons;return QGuiApplicationPrivate::mouse_buttons; never executed: return QGuiApplicationPrivate::mouse_buttons; | 0 | ||||||||||||||||||||||||||||||||||||
992 | } | - | ||||||||||||||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||||||||||||||
994 | - | |||||||||||||||||||||||||||||||||||||
995 | - | |||||||||||||||||||||||||||||||||||||
996 | - | |||||||||||||||||||||||||||||||||||||
997 | - | |||||||||||||||||||||||||||||||||||||
998 | QPlatformNativeInterface *QGuiApplication::platformNativeInterface() | - | ||||||||||||||||||||||||||||||||||||
999 | { | - | ||||||||||||||||||||||||||||||||||||
1000 | QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); | - | ||||||||||||||||||||||||||||||||||||
1001 | return never executed: pireturn pi ? pi->nativeInterface() : 0;
never executed: return pi ? pi->nativeInterface() : 0; | 0 | ||||||||||||||||||||||||||||||||||||
1002 | } | - | ||||||||||||||||||||||||||||||||||||
1003 | - | |||||||||||||||||||||||||||||||||||||
1004 | - | |||||||||||||||||||||||||||||||||||||
1005 | - | |||||||||||||||||||||||||||||||||||||
1006 | - | |||||||||||||||||||||||||||||||||||||
1007 | QFunctionPointer QGuiApplication::platformFunction(const QByteArray &function) | - | ||||||||||||||||||||||||||||||||||||
1008 | { | - | ||||||||||||||||||||||||||||||||||||
1009 | QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); | - | ||||||||||||||||||||||||||||||||||||
1010 | if (!pi
| 0 | ||||||||||||||||||||||||||||||||||||
1011 | QMessageLogger(__FILE__, 1582, __PRETTY_FUNCTION__).warning() << "QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function"; | - | ||||||||||||||||||||||||||||||||||||
1012 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
1013 | } | - | ||||||||||||||||||||||||||||||||||||
1014 | - | |||||||||||||||||||||||||||||||||||||
1015 | return never executed: pi->nativeInterface()return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr;
never executed: return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
1016 | } | - | ||||||||||||||||||||||||||||||||||||
1017 | int QGuiApplication::exec() | - | ||||||||||||||||||||||||||||||||||||
1018 | { | - | ||||||||||||||||||||||||||||||||||||
1019 | - | |||||||||||||||||||||||||||||||||||||
1020 | QAccessible::setRootObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||||||||||||||
1021 | - | |||||||||||||||||||||||||||||||||||||
1022 | return never executed: QCoreApplication::exec();return QCoreApplication::exec(); never executed: return QCoreApplication::exec(); | 0 | ||||||||||||||||||||||||||||||||||||
1023 | } | - | ||||||||||||||||||||||||||||||||||||
1024 | - | |||||||||||||||||||||||||||||||||||||
1025 | - | |||||||||||||||||||||||||||||||||||||
1026 | - | |||||||||||||||||||||||||||||||||||||
1027 | bool QGuiApplication::notify(QObject *object, QEvent *event) | - | ||||||||||||||||||||||||||||||||||||
1028 | { | - | ||||||||||||||||||||||||||||||||||||
1029 | if (object->isWindowType()
| 0 | ||||||||||||||||||||||||||||||||||||
1030 | QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event); never executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event); | 0 | ||||||||||||||||||||||||||||||||||||
1031 | return never executed: QCoreApplication::notify(object, event);return QCoreApplication::notify(object, event); never executed: return QCoreApplication::notify(object, event); | 0 | ||||||||||||||||||||||||||||||||||||
1032 | } | - | ||||||||||||||||||||||||||||||||||||
1033 | - | |||||||||||||||||||||||||||||||||||||
1034 | - | |||||||||||||||||||||||||||||||||||||
1035 | - | |||||||||||||||||||||||||||||||||||||
1036 | bool QGuiApplication::event(QEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1037 | { | - | ||||||||||||||||||||||||||||||||||||
1038 | if(e->type() == QEvent::LanguageChange
| 0 | ||||||||||||||||||||||||||||||||||||
1039 | setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight); | - | ||||||||||||||||||||||||||||||||||||
1040 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1041 | return never executed: QCoreApplication::event(e);return QCoreApplication::event(e); never executed: return QCoreApplication::event(e); | 0 | ||||||||||||||||||||||||||||||||||||
1042 | } | - | ||||||||||||||||||||||||||||||||||||
1043 | - | |||||||||||||||||||||||||||||||||||||
1044 | - | |||||||||||||||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||||||||||||||
1046 | - | |||||||||||||||||||||||||||||||||||||
1047 | bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) | - | ||||||||||||||||||||||||||||||||||||
1048 | { | - | ||||||||||||||||||||||||||||||||||||
1049 | return never executed: QCoreApplication::compressEvent(event, receiver, postedEvents);return QCoreApplication::compressEvent(event, receiver, postedEvents); never executed: return QCoreApplication::compressEvent(event, receiver, postedEvents); | 0 | ||||||||||||||||||||||||||||||||||||
1050 | } | - | ||||||||||||||||||||||||||||||||||||
1051 | - | |||||||||||||||||||||||||||||||||||||
1052 | void QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event) | - | ||||||||||||||||||||||||||||||||||||
1053 | { | - | ||||||||||||||||||||||||||||||||||||
1054 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1055 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1056 | QPlatformWindow *platformWindow = window->handle(); | - | ||||||||||||||||||||||||||||||||||||
1057 | if (!platformWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1058 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1059 | - | |||||||||||||||||||||||||||||||||||||
1060 | if (event->spontaneous()
| 0 | ||||||||||||||||||||||||||||||||||||
1061 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1062 | - | |||||||||||||||||||||||||||||||||||||
1063 | platformWindow->windowEvent(event); | - | ||||||||||||||||||||||||||||||||||||
1064 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1065 | - | |||||||||||||||||||||||||||||||||||||
1066 | bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) | - | ||||||||||||||||||||||||||||||||||||
1067 | { | - | ||||||||||||||||||||||||||||||||||||
1068 | return never executed: window->nativeEvent(eventType, message, result);return window->nativeEvent(eventType, message, result); never executed: return window->nativeEvent(eventType, message, result); | 0 | ||||||||||||||||||||||||||||||||||||
1069 | } | - | ||||||||||||||||||||||||||||||||||||
1070 | - | |||||||||||||||||||||||||||||||||||||
1071 | void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1072 | { | - | ||||||||||||||||||||||||||||||||||||
1073 | switch(e->type) { | - | ||||||||||||||||||||||||||||||||||||
1074 | case never executed: QWindowSystemInterfacePrivate::FrameStrutMouse:case QWindowSystemInterfacePrivate::FrameStrutMouse: never executed: case QWindowSystemInterfacePrivate::FrameStrutMouse: | 0 | ||||||||||||||||||||||||||||||||||||
1075 | case never executed: QWindowSystemInterfacePrivate::Mouse:case QWindowSystemInterfacePrivate::Mouse: never executed: case QWindowSystemInterfacePrivate::Mouse: | 0 | ||||||||||||||||||||||||||||||||||||
1076 | QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1077 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1078 | case never executed: QWindowSystemInterfacePrivate::Wheel:case QWindowSystemInterfacePrivate::Wheel: never executed: case QWindowSystemInterfacePrivate::Wheel: | 0 | ||||||||||||||||||||||||||||||||||||
1079 | QGuiApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1080 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1081 | case never executed: QWindowSystemInterfacePrivate::Key:case QWindowSystemInterfacePrivate::Key: never executed: case QWindowSystemInterfacePrivate::Key: | 0 | ||||||||||||||||||||||||||||||||||||
1082 | QGuiApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1083 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1084 | case never executed: QWindowSystemInterfacePrivate::Touch:case QWindowSystemInterfacePrivate::Touch: never executed: case QWindowSystemInterfacePrivate::Touch: | 0 | ||||||||||||||||||||||||||||||||||||
1085 | QGuiApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1086 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1087 | case never executed: QWindowSystemInterfacePrivate::GeometryChange:case QWindowSystemInterfacePrivate::GeometryChange: never executed: case QWindowSystemInterfacePrivate::GeometryChange: | 0 | ||||||||||||||||||||||||||||||||||||
1088 | QGuiApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e)); | - | ||||||||||||||||||||||||||||||||||||
1089 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1090 | case never executed: QWindowSystemInterfacePrivate::Enter:case QWindowSystemInterfacePrivate::Enter: never executed: case QWindowSystemInterfacePrivate::Enter: | 0 | ||||||||||||||||||||||||||||||||||||
1091 | QGuiApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1092 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1093 | case never executed: QWindowSystemInterfacePrivate::Leave:case QWindowSystemInterfacePrivate::Leave: never executed: case QWindowSystemInterfacePrivate::Leave: | 0 | ||||||||||||||||||||||||||||||||||||
1094 | QGuiApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1095 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1096 | case never executed: QWindowSystemInterfacePrivate::ActivatedWindow:case QWindowSystemInterfacePrivate::ActivatedWindow: never executed: case QWindowSystemInterfacePrivate::ActivatedWindow: | 0 | ||||||||||||||||||||||||||||||||||||
1097 | QGuiApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1098 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1099 | case never executed: QWindowSystemInterfacePrivate::WindowStateChanged:case QWindowSystemInterfacePrivate::WindowStateChanged: never executed: case QWindowSystemInterfacePrivate::WindowStateChanged: | 0 | ||||||||||||||||||||||||||||||||||||
1100 | QGuiApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1101 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1102 | case never executed: QWindowSystemInterfacePrivate::WindowScreenChanged:case QWindowSystemInterfacePrivate::WindowScreenChanged: never executed: case QWindowSystemInterfacePrivate::WindowScreenChanged: | 0 | ||||||||||||||||||||||||||||||||||||
1103 | QGuiApplicationPrivate::processWindowScreenChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowScreenChangedEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1104 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1105 | case never executed: QWindowSystemInterfacePrivate::ApplicationStateChanged:case QWindowSystemInterfacePrivate::ApplicationStateChanged: never executed: {case QWindowSystemInterfacePrivate::ApplicationStateChanged: | 0 | ||||||||||||||||||||||||||||||||||||
1106 | QWindowSystemInterfacePrivate::ApplicationStateChangedEvent * changeEvent = static_cast<QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *>(e); | - | ||||||||||||||||||||||||||||||||||||
1107 | QGuiApplicationPrivate::setApplicationState(changeEvent->newState, changeEvent->forcePropagate); } | - | ||||||||||||||||||||||||||||||||||||
1108 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1109 | case never executed: QWindowSystemInterfacePrivate::FlushEvents:case QWindowSystemInterfacePrivate::FlushEvents: never executed: {case QWindowSystemInterfacePrivate::FlushEvents: | 0 | ||||||||||||||||||||||||||||||||||||
1110 | QWindowSystemInterfacePrivate::FlushEventsEvent *flushEventsEvent = static_cast<QWindowSystemInterfacePrivate::FlushEventsEvent *>(e); | - | ||||||||||||||||||||||||||||||||||||
1111 | QWindowSystemInterface::deferredFlushWindowSystemEvents(flushEventsEvent->flags); } | - | ||||||||||||||||||||||||||||||||||||
1112 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1113 | case never executed: QWindowSystemInterfacePrivate::Close:case QWindowSystemInterfacePrivate::Close: never executed: case QWindowSystemInterfacePrivate::Close: | 0 | ||||||||||||||||||||||||||||||||||||
1114 | QGuiApplicationPrivate::processCloseEvent( | - | ||||||||||||||||||||||||||||||||||||
1115 | static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1116 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1117 | case never executed: QWindowSystemInterfacePrivate::ScreenOrientation:case QWindowSystemInterfacePrivate::ScreenOrientation: never executed: case QWindowSystemInterfacePrivate::ScreenOrientation: | 0 | ||||||||||||||||||||||||||||||||||||
1118 | QGuiApplicationPrivate::reportScreenOrientationChange( | - | ||||||||||||||||||||||||||||||||||||
1119 | static_cast<QWindowSystemInterfacePrivate::ScreenOrientationEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1120 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1121 | case never executed: QWindowSystemInterfacePrivate::ScreenGeometry:case QWindowSystemInterfacePrivate::ScreenGeometry: never executed: case QWindowSystemInterfacePrivate::ScreenGeometry: | 0 | ||||||||||||||||||||||||||||||||||||
1122 | QGuiApplicationPrivate::reportGeometryChange( | - | ||||||||||||||||||||||||||||||||||||
1123 | static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1124 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1125 | case never executed: QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch:case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch: never executed: case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch: | 0 | ||||||||||||||||||||||||||||||||||||
1126 | QGuiApplicationPrivate::reportLogicalDotsPerInchChange( | - | ||||||||||||||||||||||||||||||||||||
1127 | static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1128 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1129 | case never executed: QWindowSystemInterfacePrivate::ScreenRefreshRate:case QWindowSystemInterfacePrivate::ScreenRefreshRate: never executed: case QWindowSystemInterfacePrivate::ScreenRefreshRate: | 0 | ||||||||||||||||||||||||||||||||||||
1130 | QGuiApplicationPrivate::reportRefreshRateChange( | - | ||||||||||||||||||||||||||||||||||||
1131 | static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1132 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1133 | case never executed: QWindowSystemInterfacePrivate::ThemeChange:case QWindowSystemInterfacePrivate::ThemeChange: never executed: case QWindowSystemInterfacePrivate::ThemeChange: | 0 | ||||||||||||||||||||||||||||||||||||
1134 | QGuiApplicationPrivate::processThemeChanged( | - | ||||||||||||||||||||||||||||||||||||
1135 | static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1136 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1137 | case never executed: QWindowSystemInterfacePrivate::Expose:case QWindowSystemInterfacePrivate::Expose: never executed: case QWindowSystemInterfacePrivate::Expose: | 0 | ||||||||||||||||||||||||||||||||||||
1138 | QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1139 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1140 | case never executed: QWindowSystemInterfacePrivate::Tablet:case QWindowSystemInterfacePrivate::Tablet: never executed: case QWindowSystemInterfacePrivate::Tablet: | 0 | ||||||||||||||||||||||||||||||||||||
1141 | QGuiApplicationPrivate::processTabletEvent( | - | ||||||||||||||||||||||||||||||||||||
1142 | static_cast<QWindowSystemInterfacePrivate::TabletEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1143 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1144 | case never executed: QWindowSystemInterfacePrivate::TabletEnterProximity:case QWindowSystemInterfacePrivate::TabletEnterProximity: never executed: case QWindowSystemInterfacePrivate::TabletEnterProximity: | 0 | ||||||||||||||||||||||||||||||||||||
1145 | QGuiApplicationPrivate::processTabletEnterProximityEvent( | - | ||||||||||||||||||||||||||||||||||||
1146 | static_cast<QWindowSystemInterfacePrivate::TabletEnterProximityEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1147 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1148 | case never executed: QWindowSystemInterfacePrivate::TabletLeaveProximity:case QWindowSystemInterfacePrivate::TabletLeaveProximity: never executed: case QWindowSystemInterfacePrivate::TabletLeaveProximity: | 0 | ||||||||||||||||||||||||||||||||||||
1149 | QGuiApplicationPrivate::processTabletLeaveProximityEvent( | - | ||||||||||||||||||||||||||||||||||||
1150 | static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1151 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1152 | - | |||||||||||||||||||||||||||||||||||||
1153 | case never executed: QWindowSystemInterfacePrivate::Gesture:case QWindowSystemInterfacePrivate::Gesture: never executed: case QWindowSystemInterfacePrivate::Gesture: | 0 | ||||||||||||||||||||||||||||||||||||
1154 | QGuiApplicationPrivate::processGestureEvent( | - | ||||||||||||||||||||||||||||||||||||
1155 | static_cast<QWindowSystemInterfacePrivate::GestureEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1156 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1157 | - | |||||||||||||||||||||||||||||||||||||
1158 | case never executed: QWindowSystemInterfacePrivate::PlatformPanel:case QWindowSystemInterfacePrivate::PlatformPanel: never executed: case QWindowSystemInterfacePrivate::PlatformPanel: | 0 | ||||||||||||||||||||||||||||||||||||
1159 | QGuiApplicationPrivate::processPlatformPanelEvent( | - | ||||||||||||||||||||||||||||||||||||
1160 | static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1161 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1162 | case never executed: QWindowSystemInterfacePrivate::FileOpen:case QWindowSystemInterfacePrivate::FileOpen: never executed: case QWindowSystemInterfacePrivate::FileOpen: | 0 | ||||||||||||||||||||||||||||||||||||
1163 | QGuiApplicationPrivate::processFileOpenEvent( | - | ||||||||||||||||||||||||||||||||||||
1164 | static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1165 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1166 | - | |||||||||||||||||||||||||||||||||||||
1167 | case never executed: QWindowSystemInterfacePrivate::ContextMenu:case QWindowSystemInterfacePrivate::ContextMenu: never executed: case QWindowSystemInterfacePrivate::ContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
1168 | QGuiApplicationPrivate::processContextMenuEvent( | - | ||||||||||||||||||||||||||||||||||||
1169 | static_cast<QWindowSystemInterfacePrivate::ContextMenuEvent *>(e)); | - | ||||||||||||||||||||||||||||||||||||
1170 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1171 | - | |||||||||||||||||||||||||||||||||||||
1172 | case never executed: QWindowSystemInterfacePrivate::EnterWhatsThisMode:case QWindowSystemInterfacePrivate::EnterWhatsThisMode: never executed: case QWindowSystemInterfacePrivate::EnterWhatsThisMode: | 0 | ||||||||||||||||||||||||||||||||||||
1173 | QGuiApplication::postEvent(QGuiApplication::instance(), new QEvent(QEvent::EnterWhatsThisMode)); | - | ||||||||||||||||||||||||||||||||||||
1174 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1175 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
1176 | QMessageLogger(__FILE__, 1771, __PRETTY_FUNCTION__).warning() << "Unknown user input event type:" << e->type; | - | ||||||||||||||||||||||||||||||||||||
1177 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1178 | } | - | ||||||||||||||||||||||||||||||||||||
1179 | } | - | ||||||||||||||||||||||||||||||||||||
1180 | - | |||||||||||||||||||||||||||||||||||||
1181 | void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1182 | { | - | ||||||||||||||||||||||||||||||||||||
1183 | QEvent::Type type; | - | ||||||||||||||||||||||||||||||||||||
1184 | Qt::MouseButtons stateChange = e->buttons ^ buttons; | - | ||||||||||||||||||||||||||||||||||||
1185 | if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition
| 0 | ||||||||||||||||||||||||||||||||||||
1186 | - | |||||||||||||||||||||||||||||||||||||
1187 | - | |||||||||||||||||||||||||||||||||||||
1188 | - | |||||||||||||||||||||||||||||||||||||
1189 | QWindowSystemInterfacePrivate::MouseEvent mouseButtonEvent( | - | ||||||||||||||||||||||||||||||||||||
1190 | e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers, e->source); | - | ||||||||||||||||||||||||||||||||||||
1191 | if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic
| 0 | ||||||||||||||||||||||||||||||||||||
1192 | mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; never executed: mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; | 0 | ||||||||||||||||||||||||||||||||||||
1193 | e->buttons = buttons; | - | ||||||||||||||||||||||||||||||||||||
1194 | processMouseEvent(e); | - | ||||||||||||||||||||||||||||||||||||
1195 | processMouseEvent(&mouseButtonEvent); | - | ||||||||||||||||||||||||||||||||||||
1196 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1197 | } | - | ||||||||||||||||||||||||||||||||||||
1198 | - | |||||||||||||||||||||||||||||||||||||
1199 | QWindow *window = e->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1200 | modifier_buttons = e->modifiers; | - | ||||||||||||||||||||||||||||||||||||
1201 | - | |||||||||||||||||||||||||||||||||||||
1202 | QPointF localPoint = e->localPos; | - | ||||||||||||||||||||||||||||||||||||
1203 | QPointF globalPoint = e->globalPos; | - | ||||||||||||||||||||||||||||||||||||
1204 | - | |||||||||||||||||||||||||||||||||||||
1205 | if (e->nullWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
1206 | window = QGuiApplication::topLevelAt(globalPoint.toPoint()); | - | ||||||||||||||||||||||||||||||||||||
1207 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
1208 | - | |||||||||||||||||||||||||||||||||||||
1209 | - | |||||||||||||||||||||||||||||||||||||
1210 | if (e->buttons != Qt::NoButton
| 0 | ||||||||||||||||||||||||||||||||||||
1211 | if (!currentMousePressWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1212 | currentMousePressWindow = window; never executed: currentMousePressWindow = window; | 0 | ||||||||||||||||||||||||||||||||||||
1213 | else | - | ||||||||||||||||||||||||||||||||||||
1214 | window = currentMousePressWindow; never executed: window = currentMousePressWindow; | 0 | ||||||||||||||||||||||||||||||||||||
1215 | } else if (currentMousePressWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1216 | window = currentMousePressWindow; | - | ||||||||||||||||||||||||||||||||||||
1217 | currentMousePressWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
1218 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1219 | QPointF delta = globalPoint - globalPoint.toPoint(); | - | ||||||||||||||||||||||||||||||||||||
1220 | localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta; | - | ||||||||||||||||||||||||||||||||||||
1221 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1222 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1223 | - | |||||||||||||||||||||||||||||||||||||
1224 | Qt::MouseButton button = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
1225 | bool doubleClick = false; | - | ||||||||||||||||||||||||||||||||||||
1226 | const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse; | - | ||||||||||||||||||||||||||||||||||||
1227 | - | |||||||||||||||||||||||||||||||||||||
1228 | if (QGuiApplicationPrivate::lastCursorPosition != globalPoint
| 0 | ||||||||||||||||||||||||||||||||||||
1229 | type = frameStrut
| 0 | ||||||||||||||||||||||||||||||||||||
1230 | QGuiApplicationPrivate::lastCursorPosition = globalPoint; | - | ||||||||||||||||||||||||||||||||||||
1231 | if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance
| 0 | ||||||||||||||||||||||||||||||||||||
1232 | qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance
| 0 | ||||||||||||||||||||||||||||||||||||
1233 | mousePressButton = Qt::NoButton; never executed: mousePressButton = Qt::NoButton; | 0 | ||||||||||||||||||||||||||||||||||||
1234 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
1235 | for (int check = Qt::LeftButton; | - | ||||||||||||||||||||||||||||||||||||
1236 | check <= int(Qt::MaxMouseButton)
| 0 | ||||||||||||||||||||||||||||||||||||
1237 | check = check << 1) { | - | ||||||||||||||||||||||||||||||||||||
1238 | if (check & stateChange
| 0 | ||||||||||||||||||||||||||||||||||||
1239 | button = Qt::MouseButton(check); | - | ||||||||||||||||||||||||||||||||||||
1240 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1241 | } | - | ||||||||||||||||||||||||||||||||||||
1242 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1243 | if (button == Qt::NoButton
| 0 | ||||||||||||||||||||||||||||||||||||
1244 | - | |||||||||||||||||||||||||||||||||||||
1245 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1246 | } | - | ||||||||||||||||||||||||||||||||||||
1247 | mouse_buttons = buttons = e->buttons; | - | ||||||||||||||||||||||||||||||||||||
1248 | if (button & e->buttons
| 0 | ||||||||||||||||||||||||||||||||||||
1249 | ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval()); | - | ||||||||||||||||||||||||||||||||||||
1250 | doubleClick = e->timestamp - mousePressTime < doubleClickInterval
| 0 | ||||||||||||||||||||||||||||||||||||
1251 | type = frameStrut
| 0 | ||||||||||||||||||||||||||||||||||||
1252 | mousePressTime = e->timestamp; | - | ||||||||||||||||||||||||||||||||||||
1253 | mousePressButton = button; | - | ||||||||||||||||||||||||||||||||||||
1254 | const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint(); | - | ||||||||||||||||||||||||||||||||||||
1255 | mousePressX = point.x(); | - | ||||||||||||||||||||||||||||||||||||
1256 | mousePressY = point.y(); | - | ||||||||||||||||||||||||||||||||||||
1257 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
1258 | type = frameStrut
| 0 | ||||||||||||||||||||||||||||||||||||
1259 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1260 | } | - | ||||||||||||||||||||||||||||||||||||
1261 | - | |||||||||||||||||||||||||||||||||||||
1262 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1263 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1264 | - | |||||||||||||||||||||||||||||||||||||
1265 | - | |||||||||||||||||||||||||||||||||||||
1266 | if (!e->synthetic()
| 0 | ||||||||||||||||||||||||||||||||||||
1267 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
1268 | if (QPlatformCursor *cursor = screen->handle()->cursor()
| 0 | ||||||||||||||||||||||||||||||||||||
1269 | const QPointF nativeLocalPoint = QHighDpi::toNativePixels(localPoint, screen); | - | ||||||||||||||||||||||||||||||||||||
1270 | const QPointF nativeGlobalPoint = QHighDpi::toNativePixels(globalPoint, screen); | - | ||||||||||||||||||||||||||||||||||||
1271 | QMouseEvent ev(type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint, | - | ||||||||||||||||||||||||||||||||||||
1272 | button, buttons, e->modifiers, e->source); | - | ||||||||||||||||||||||||||||||||||||
1273 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1274 | cursor->pointerEvent(ev); | - | ||||||||||||||||||||||||||||||||||||
1275 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1276 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1277 | - | |||||||||||||||||||||||||||||||||||||
1278 | - | |||||||||||||||||||||||||||||||||||||
1279 | QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source); | - | ||||||||||||||||||||||||||||||||||||
1280 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1281 | - | |||||||||||||||||||||||||||||||||||||
1282 | if (window->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1283 | - | |||||||||||||||||||||||||||||||||||||
1284 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1285 | } | - | ||||||||||||||||||||||||||||||||||||
1286 | - | |||||||||||||||||||||||||||||||||||||
1287 | if (doubleClick
| 0 | ||||||||||||||||||||||||||||||||||||
1288 | - | |||||||||||||||||||||||||||||||||||||
1289 | setMouseEventFlags(&ev, ev.flags() | Qt::MouseEventCreatedDoubleClick); | - | ||||||||||||||||||||||||||||||||||||
1290 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1291 | - | |||||||||||||||||||||||||||||||||||||
1292 | QGuiApplication::sendSpontaneousEvent(window, &ev); | - | ||||||||||||||||||||||||||||||||||||
1293 | e->eventAccepted = ev.isAccepted(); | - | ||||||||||||||||||||||||||||||||||||
1294 | if (!e->synthetic()
| 0 | ||||||||||||||||||||||||||||||||||||
1295 | && !frameStrut
| 0 | ||||||||||||||||||||||||||||||||||||
1296 | && (static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
1297 | if (!m_fakeTouchDevice
| 0 | ||||||||||||||||||||||||||||||||||||
1298 | m_fakeTouchDevice = new QTouchDevice; | - | ||||||||||||||||||||||||||||||||||||
1299 | QWindowSystemInterface::registerTouchDevice(m_fakeTouchDevice); | - | ||||||||||||||||||||||||||||||||||||
1300 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1301 | QList<QWindowSystemInterface::TouchPoint> points; | - | ||||||||||||||||||||||||||||||||||||
1302 | QWindowSystemInterface::TouchPoint point; | - | ||||||||||||||||||||||||||||||||||||
1303 | point.id = 1; | - | ||||||||||||||||||||||||||||||||||||
1304 | point.area = QRectF(globalPoint.x() - 2, globalPoint.y() - 2, 4, 4); | - | ||||||||||||||||||||||||||||||||||||
1305 | - | |||||||||||||||||||||||||||||||||||||
1306 | - | |||||||||||||||||||||||||||||||||||||
1307 | - | |||||||||||||||||||||||||||||||||||||
1308 | - | |||||||||||||||||||||||||||||||||||||
1309 | if (type == QEvent::MouseButtonPress
| 0 | ||||||||||||||||||||||||||||||||||||
1310 | point.state = Qt::TouchPointPressed; | - | ||||||||||||||||||||||||||||||||||||
1311 | } never executed: else if (type == QEvent::MouseButtonReleaseend of block
| 0 | ||||||||||||||||||||||||||||||||||||
1312 | point.state = Qt::TouchPointReleased; | - | ||||||||||||||||||||||||||||||||||||
1313 | } never executed: else if (type == QEvent::MouseMoveend of block
| 0 | ||||||||||||||||||||||||||||||||||||
1314 | point.state = Qt::TouchPointMoved; | - | ||||||||||||||||||||||||||||||||||||
1315 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
1316 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1317 | } | - | ||||||||||||||||||||||||||||||||||||
1318 | - | |||||||||||||||||||||||||||||||||||||
1319 | points << point; | - | ||||||||||||||||||||||||||||||||||||
1320 | - | |||||||||||||||||||||||||||||||||||||
1321 | QEvent::Type type; | - | ||||||||||||||||||||||||||||||||||||
1322 | QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::fromNativeTouchPoints(points, window, &type); | - | ||||||||||||||||||||||||||||||||||||
1323 | - | |||||||||||||||||||||||||||||||||||||
1324 | QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers); | - | ||||||||||||||||||||||||||||||||||||
1325 | fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; | - | ||||||||||||||||||||||||||||||||||||
1326 | processTouchEvent(&fake); | - | ||||||||||||||||||||||||||||||||||||
1327 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1328 | if (doubleClick
| 0 | ||||||||||||||||||||||||||||||||||||
1329 | mousePressButton = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
1330 | if (!e->window.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
1331 | const QEvent::Type doubleClickType = frameStrut
| 0 | ||||||||||||||||||||||||||||||||||||
1332 | QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint, | - | ||||||||||||||||||||||||||||||||||||
1333 | button, buttons, e->modifiers, e->source); | - | ||||||||||||||||||||||||||||||||||||
1334 | dblClickEvent.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1335 | QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent); | - | ||||||||||||||||||||||||||||||||||||
1336 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1337 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1338 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1339 | - | |||||||||||||||||||||||||||||||||||||
1340 | void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1341 | { | - | ||||||||||||||||||||||||||||||||||||
1342 | - | |||||||||||||||||||||||||||||||||||||
1343 | QWindow *window = e->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1344 | QPointF globalPoint = e->globalPos; | - | ||||||||||||||||||||||||||||||||||||
1345 | QPointF localPoint = e->localPos; | - | ||||||||||||||||||||||||||||||||||||
1346 | - | |||||||||||||||||||||||||||||||||||||
1347 | if (e->nullWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
1348 | window = QGuiApplication::topLevelAt(globalPoint.toPoint()); | - | ||||||||||||||||||||||||||||||||||||
1349 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
1350 | QPointF delta = globalPoint - globalPoint.toPoint(); | - | ||||||||||||||||||||||||||||||||||||
1351 | localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta; | - | ||||||||||||||||||||||||||||||||||||
1352 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1353 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1354 | - | |||||||||||||||||||||||||||||||||||||
1355 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1356 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1357 | - | |||||||||||||||||||||||||||||||||||||
1358 | QGuiApplicationPrivate::lastCursorPosition = globalPoint; | - | ||||||||||||||||||||||||||||||||||||
1359 | modifier_buttons = e->modifiers; | - | ||||||||||||||||||||||||||||||||||||
1360 | - | |||||||||||||||||||||||||||||||||||||
1361 | if (window->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1362 | - | |||||||||||||||||||||||||||||||||||||
1363 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1364 | } | - | ||||||||||||||||||||||||||||||||||||
1365 | - | |||||||||||||||||||||||||||||||||||||
1366 | QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers, e->phase, e->source); | - | ||||||||||||||||||||||||||||||||||||
1367 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1368 | QGuiApplication::sendSpontaneousEvent(window, &ev); | - | ||||||||||||||||||||||||||||||||||||
1369 | - | |||||||||||||||||||||||||||||||||||||
1370 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1371 | - | |||||||||||||||||||||||||||||||||||||
1372 | - | |||||||||||||||||||||||||||||||||||||
1373 | - | |||||||||||||||||||||||||||||||||||||
1374 | void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1375 | { | - | ||||||||||||||||||||||||||||||||||||
1376 | QWindow *window = e->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1377 | modifier_buttons = e->modifiers; | - | ||||||||||||||||||||||||||||||||||||
1378 | if (e->nullWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
1379 | - | |||||||||||||||||||||||||||||||||||||
1380 | - | |||||||||||||||||||||||||||||||||||||
1381 | - | |||||||||||||||||||||||||||||||||||||
1382 | ) { | - | ||||||||||||||||||||||||||||||||||||
1383 | window = QGuiApplication::focusWindow(); | - | ||||||||||||||||||||||||||||||||||||
1384 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1385 | - | |||||||||||||||||||||||||||||||||||||
1386 | - | |||||||||||||||||||||||||||||||||||||
1387 | - | |||||||||||||||||||||||||||||||||||||
1388 | - | |||||||||||||||||||||||||||||||||||||
1389 | if (e->keyType == QEvent::KeyPress
| 0 | ||||||||||||||||||||||||||||||||||||
1390 | if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
| 0 | ||||||||||||||||||||||||||||||||||||
1391 | e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)
| 0 | ||||||||||||||||||||||||||||||||||||
1392 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1393 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1394 | - | |||||||||||||||||||||||||||||||||||||
1395 | - | |||||||||||||||||||||||||||||||||||||
1396 | QKeyEvent ev(e->keyType, e->key, e->modifiers, | - | ||||||||||||||||||||||||||||||||||||
1397 | e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, | - | ||||||||||||||||||||||||||||||||||||
1398 | e->unicode, e->repeat, e->repeatCount); | - | ||||||||||||||||||||||||||||||||||||
1399 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1400 | - | |||||||||||||||||||||||||||||||||||||
1401 | - | |||||||||||||||||||||||||||||||||||||
1402 | - | |||||||||||||||||||||||||||||||||||||
1403 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
1404 | QGuiApplication::sendSpontaneousEvent(window, &ev); never executed: QGuiApplication::sendSpontaneousEvent(window, &ev); | 0 | ||||||||||||||||||||||||||||||||||||
1405 | e->eventAccepted = ev.isAccepted(); | - | ||||||||||||||||||||||||||||||||||||
1406 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1407 | - | |||||||||||||||||||||||||||||||||||||
1408 | void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1409 | { | - | ||||||||||||||||||||||||||||||||||||
1410 | if (!e->enter
| 0 | ||||||||||||||||||||||||||||||||||||
1411 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1412 | if (e->enter.data()->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1413 | - | |||||||||||||||||||||||||||||||||||||
1414 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1415 | } | - | ||||||||||||||||||||||||||||||||||||
1416 | - | |||||||||||||||||||||||||||||||||||||
1417 | currentMouseWindow = e->enter; | - | ||||||||||||||||||||||||||||||||||||
1418 | - | |||||||||||||||||||||||||||||||||||||
1419 | QEnterEvent event(e->localPos, e->localPos, e->globalPos); | - | ||||||||||||||||||||||||||||||||||||
1420 | QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event); | - | ||||||||||||||||||||||||||||||||||||
1421 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1422 | - | |||||||||||||||||||||||||||||||||||||
1423 | void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1424 | { | - | ||||||||||||||||||||||||||||||||||||
1425 | if (!e->leave
| 0 | ||||||||||||||||||||||||||||||||||||
1426 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1427 | if (e->leave.data()->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1428 | - | |||||||||||||||||||||||||||||||||||||
1429 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1430 | } | - | ||||||||||||||||||||||||||||||||||||
1431 | - | |||||||||||||||||||||||||||||||||||||
1432 | currentMouseWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
1433 | - | |||||||||||||||||||||||||||||||||||||
1434 | QEvent event(QEvent::Leave); | - | ||||||||||||||||||||||||||||||||||||
1435 | QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event); | - | ||||||||||||||||||||||||||||||||||||
1436 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1437 | - | |||||||||||||||||||||||||||||||||||||
1438 | void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1439 | { | - | ||||||||||||||||||||||||||||||||||||
1440 | QWindow *previous = QGuiApplicationPrivate::focus_window; | - | ||||||||||||||||||||||||||||||||||||
1441 | QWindow *newFocus = e->activated.data(); | - | ||||||||||||||||||||||||||||||||||||
1442 | - | |||||||||||||||||||||||||||||||||||||
1443 | if (previous == newFocus
| 0 | ||||||||||||||||||||||||||||||||||||
1444 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1445 | - | |||||||||||||||||||||||||||||||||||||
1446 | if (newFocus
| 0 | ||||||||||||||||||||||||||||||||||||
1447 | if (QPlatformWindow *platformWindow = newFocus->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
1448 | if (platformWindow->isAlertState()
| 0 | ||||||||||||||||||||||||||||||||||||
1449 | platformWindow->setAlertState(false); never executed: platformWindow->setAlertState(false); | 0 | ||||||||||||||||||||||||||||||||||||
1450 | - | |||||||||||||||||||||||||||||||||||||
1451 | QObject *previousFocusObject = previous
| 0 | ||||||||||||||||||||||||||||||||||||
1452 | - | |||||||||||||||||||||||||||||||||||||
1453 | if (previous
| 0 | ||||||||||||||||||||||||||||||||||||
1454 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
1455 | QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
1456 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1457 | - | |||||||||||||||||||||||||||||||||||||
1458 | QGuiApplicationPrivate::focus_window = newFocus; | - | ||||||||||||||||||||||||||||||||||||
1459 | if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))
| 0 | ||||||||||||||||||||||||||||||||||||
1460 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1461 | - | |||||||||||||||||||||||||||||||||||||
1462 | if (previous
| 0 | ||||||||||||||||||||||||||||||||||||
1463 | Qt::FocusReason r = e->reason; | - | ||||||||||||||||||||||||||||||||||||
1464 | if ((r == Qt::OtherFocusReason
| 0 | ||||||||||||||||||||||||||||||||||||
1465 | newFocus
| 0 | ||||||||||||||||||||||||||||||||||||
1466 | r = Qt::PopupFocusReason; never executed: r = Qt::PopupFocusReason; | 0 | ||||||||||||||||||||||||||||||||||||
1467 | QFocusEvent focusOut(QEvent::FocusOut, r); | - | ||||||||||||||||||||||||||||||||||||
1468 | QCoreApplication::sendSpontaneousEvent(previous, &focusOut); | - | ||||||||||||||||||||||||||||||||||||
1469 | QObject::disconnect(previous, qFlagLocation("2""focusObjectChanged(QObject*)" "\0" __FILE__ ":" "2082"), | - | ||||||||||||||||||||||||||||||||||||
1470 | (static_cast<QGuiApplication *>(QCoreApplication::instance())), qFlagLocation("1""_q_updateFocusObject(QObject*)" "\0" __FILE__ ":" "2083")); | - | ||||||||||||||||||||||||||||||||||||
1471 | } never executed: else if (!platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
1472 | setApplicationState(Qt::ApplicationActive); | - | ||||||||||||||||||||||||||||||||||||
1473 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1474 | - | |||||||||||||||||||||||||||||||||||||
1475 | if (QGuiApplicationPrivate::focus_window
| 0 | ||||||||||||||||||||||||||||||||||||
1476 | Qt::FocusReason r = e->reason; | - | ||||||||||||||||||||||||||||||||||||
1477 | if ((r == Qt::OtherFocusReason
| 0 | ||||||||||||||||||||||||||||||||||||
1478 | previous
| 0 | ||||||||||||||||||||||||||||||||||||
1479 | r = Qt::PopupFocusReason; never executed: r = Qt::PopupFocusReason; | 0 | ||||||||||||||||||||||||||||||||||||
1480 | QFocusEvent focusIn(QEvent::FocusIn, r); | - | ||||||||||||||||||||||||||||||||||||
1481 | QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn); | - | ||||||||||||||||||||||||||||||||||||
1482 | QObject::connect(QGuiApplicationPrivate::focus_window, qFlagLocation("2""focusObjectChanged(QObject*)" "\0" __FILE__ ":" "2095"), | - | ||||||||||||||||||||||||||||||||||||
1483 | (static_cast<QGuiApplication *>(QCoreApplication::instance())), qFlagLocation("1""_q_updateFocusObject(QObject*)" "\0" __FILE__ ":" "2096")); | - | ||||||||||||||||||||||||||||||||||||
1484 | } never executed: else if (!platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
1485 | setApplicationState(Qt::ApplicationInactive); | - | ||||||||||||||||||||||||||||||||||||
1486 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1487 | - | |||||||||||||||||||||||||||||||||||||
1488 | if (self
| 0 | ||||||||||||||||||||||||||||||||||||
1489 | self->notifyActiveWindowChange(previous); | - | ||||||||||||||||||||||||||||||||||||
1490 | - | |||||||||||||||||||||||||||||||||||||
1491 | if (previousFocusObject != (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()
| 0 | ||||||||||||||||||||||||||||||||||||
1492 | self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()); never executed: self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()); | 0 | ||||||||||||||||||||||||||||||||||||
1493 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1494 | - | |||||||||||||||||||||||||||||||||||||
1495 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusWindowChanged(newFocus); | - | ||||||||||||||||||||||||||||||||||||
1496 | if (previous
| 0 | ||||||||||||||||||||||||||||||||||||
1497 | previous->activeChanged(); never executed: previous->activeChanged(); | 0 | ||||||||||||||||||||||||||||||||||||
1498 | if (newFocus
| 0 | ||||||||||||||||||||||||||||||||||||
1499 | newFocus->activeChanged(); never executed: newFocus->activeChanged(); | 0 | ||||||||||||||||||||||||||||||||||||
1500 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1501 | - | |||||||||||||||||||||||||||||||||||||
1502 | void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse) | - | ||||||||||||||||||||||||||||||||||||
1503 | { | - | ||||||||||||||||||||||||||||||||||||
1504 | if (QWindow *window = wse->window.data()
| 0 | ||||||||||||||||||||||||||||||||||||
1505 | QWindowStateChangeEvent e(window->windowState()); | - | ||||||||||||||||||||||||||||||||||||
1506 | window->d_func()->windowState = wse->newState; | - | ||||||||||||||||||||||||||||||||||||
1507 | QGuiApplication::sendSpontaneousEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
1508 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1510 | - | |||||||||||||||||||||||||||||||||||||
1511 | void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse) | - | ||||||||||||||||||||||||||||||||||||
1512 | { | - | ||||||||||||||||||||||||||||||||||||
1513 | if (QWindow *window = wse->window.data()
| 0 | ||||||||||||||||||||||||||||||||||||
1514 | if (window->isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
1515 | if (QScreen *screen = wse->screen.data()
| 0 | ||||||||||||||||||||||||||||||||||||
1516 | window->d_func()->setTopLevelScreen(screen, false ); never executed: window->d_func()->setTopLevelScreen(screen, false ); | 0 | ||||||||||||||||||||||||||||||||||||
1517 | else | - | ||||||||||||||||||||||||||||||||||||
1518 | window->setScreen(0); never executed: window->setScreen(0); | 0 | ||||||||||||||||||||||||||||||||||||
1519 | } | - | ||||||||||||||||||||||||||||||||||||
1520 | - | |||||||||||||||||||||||||||||||||||||
1521 | if (window->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
1522 | QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect()); | - | ||||||||||||||||||||||||||||||||||||
1523 | processGeometryChangeEvent(&gce); | - | ||||||||||||||||||||||||||||||||||||
1524 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1525 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1526 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1527 | - | |||||||||||||||||||||||||||||||||||||
1528 | void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) | - | ||||||||||||||||||||||||||||||||||||
1529 | { | - | ||||||||||||||||||||||||||||||||||||
1530 | if (self
| 0 | ||||||||||||||||||||||||||||||||||||
1531 | self->notifyThemeChanged(); never executed: self->notifyThemeChanged(); | 0 | ||||||||||||||||||||||||||||||||||||
1532 | if (QWindow *window = tce->window.data()
| 0 | ||||||||||||||||||||||||||||||||||||
1533 | QEvent e(QEvent::ThemeChange); | - | ||||||||||||||||||||||||||||||||||||
1534 | QGuiApplication::sendSpontaneousEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
1535 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1536 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1537 | - | |||||||||||||||||||||||||||||||||||||
1538 | void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1539 | { | - | ||||||||||||||||||||||||||||||||||||
1540 | if (e->tlw.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
1541 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1542 | - | |||||||||||||||||||||||||||||||||||||
1543 | QWindow *window = e->tlw.data(); | - | ||||||||||||||||||||||||||||||||||||
1544 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1545 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1546 | - | |||||||||||||||||||||||||||||||||||||
1547 | QRect newRect = e->newGeometry; | - | ||||||||||||||||||||||||||||||||||||
1548 | QRect oldRect = e->oldGeometry.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
1549 | - | |||||||||||||||||||||||||||||||||||||
1550 | bool isResize = oldRect.size() != newRect.size(); | - | ||||||||||||||||||||||||||||||||||||
1551 | bool isMove = oldRect.topLeft() != newRect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
1552 | - | |||||||||||||||||||||||||||||||||||||
1553 | window->d_func()->geometry = newRect; | - | ||||||||||||||||||||||||||||||||||||
1554 | - | |||||||||||||||||||||||||||||||||||||
1555 | if (isResize
| 0 | ||||||||||||||||||||||||||||||||||||
1556 | QResizeEvent e(newRect.size(), oldRect.size()); | - | ||||||||||||||||||||||||||||||||||||
1557 | QGuiApplication::sendSpontaneousEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
1558 | - | |||||||||||||||||||||||||||||||||||||
1559 | window->d_func()->resizeEventPending = false; | - | ||||||||||||||||||||||||||||||||||||
1560 | - | |||||||||||||||||||||||||||||||||||||
1561 | if (oldRect.width() != newRect.width()
| 0 | ||||||||||||||||||||||||||||||||||||
1562 | window->widthChanged(newRect.width()); never executed: window->widthChanged(newRect.width()); | 0 | ||||||||||||||||||||||||||||||||||||
1563 | if (oldRect.height() != newRect.height()
| 0 | ||||||||||||||||||||||||||||||||||||
1564 | window->heightChanged(newRect.height()); never executed: window->heightChanged(newRect.height()); | 0 | ||||||||||||||||||||||||||||||||||||
1565 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1566 | - | |||||||||||||||||||||||||||||||||||||
1567 | if (isMove
| 0 | ||||||||||||||||||||||||||||||||||||
1568 | - | |||||||||||||||||||||||||||||||||||||
1569 | QMoveEvent e(newRect.topLeft(), oldRect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
1570 | QGuiApplication::sendSpontaneousEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
1571 | - | |||||||||||||||||||||||||||||||||||||
1572 | if (oldRect.x() != newRect.x()
| 0 | ||||||||||||||||||||||||||||||||||||
1573 | window->xChanged(newRect.x()); never executed: window->xChanged(newRect.x()); | 0 | ||||||||||||||||||||||||||||||||||||
1574 | if (oldRect.y() != newRect.y()
| 0 | ||||||||||||||||||||||||||||||||||||
1575 | window->yChanged(newRect.y()); never executed: window->yChanged(newRect.y()); | 0 | ||||||||||||||||||||||||||||||||||||
1576 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1577 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1578 | - | |||||||||||||||||||||||||||||||||||||
1579 | void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1580 | { | - | ||||||||||||||||||||||||||||||||||||
1581 | if (e->window.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
1582 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1583 | if (e->window.data()->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1584 | - | |||||||||||||||||||||||||||||||||||||
1585 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1586 | } | - | ||||||||||||||||||||||||||||||||||||
1587 | - | |||||||||||||||||||||||||||||||||||||
1588 | QCloseEvent event; | - | ||||||||||||||||||||||||||||||||||||
1589 | QGuiApplication::sendSpontaneousEvent(e->window.data(), &event); | - | ||||||||||||||||||||||||||||||||||||
1590 | if (e->accepted
| 0 | ||||||||||||||||||||||||||||||||||||
1591 | *(e->accepted) = event.isAccepted(); | - | ||||||||||||||||||||||||||||||||||||
1592 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1593 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1594 | - | |||||||||||||||||||||||||||||||||||||
1595 | void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1596 | { | - | ||||||||||||||||||||||||||||||||||||
1597 | if (e->url.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
1598 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1599 | - | |||||||||||||||||||||||||||||||||||||
1600 | QFileOpenEvent event(e->url); | - | ||||||||||||||||||||||||||||||||||||
1601 | QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event); | - | ||||||||||||||||||||||||||||||||||||
1602 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1603 | - | |||||||||||||||||||||||||||||||||||||
1604 | void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1605 | { | - | ||||||||||||||||||||||||||||||||||||
1606 | - | |||||||||||||||||||||||||||||||||||||
1607 | QEvent::Type type = QEvent::TabletMove; | - | ||||||||||||||||||||||||||||||||||||
1608 | if (e->buttons != tabletState
| 0 | ||||||||||||||||||||||||||||||||||||
1609 | type = (
never executed: type = (e->buttons > tabletState) ? QEvent::TabletPress : QEvent::TabletRelease; | 0 | ||||||||||||||||||||||||||||||||||||
1610 | - | |||||||||||||||||||||||||||||||||||||
1611 | QWindow *window = e->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1612 | modifier_buttons = e->modifiers; | - | ||||||||||||||||||||||||||||||||||||
1613 | - | |||||||||||||||||||||||||||||||||||||
1614 | bool localValid = true; | - | ||||||||||||||||||||||||||||||||||||
1615 | - | |||||||||||||||||||||||||||||||||||||
1616 | - | |||||||||||||||||||||||||||||||||||||
1617 | - | |||||||||||||||||||||||||||||||||||||
1618 | if (type == QEvent::TabletPress
| 0 | ||||||||||||||||||||||||||||||||||||
1619 | if (e->nullWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
1620 | window = QGuiApplication::topLevelAt(e->global.toPoint()); | - | ||||||||||||||||||||||||||||||||||||
1621 | localValid = false; | - | ||||||||||||||||||||||||||||||||||||
1622 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1623 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1624 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1625 | tabletPressTarget = window; | - | ||||||||||||||||||||||||||||||||||||
1626 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
1627 | if (e->nullWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
1628 | window = tabletPressTarget; | - | ||||||||||||||||||||||||||||||||||||
1629 | localValid = false; | - | ||||||||||||||||||||||||||||||||||||
1630 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1631 | if (type == QEvent::TabletRelease
| 0 | ||||||||||||||||||||||||||||||||||||
1632 | tabletPressTarget = 0; never executed: tabletPressTarget = 0; | 0 | ||||||||||||||||||||||||||||||||||||
1633 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1634 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1635 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1636 | QPointF local = e->local; | - | ||||||||||||||||||||||||||||||||||||
1637 | if (!localValid
| 0 | ||||||||||||||||||||||||||||||||||||
1638 | QPointF delta = e->global - e->global.toPoint(); | - | ||||||||||||||||||||||||||||||||||||
1639 | local = window->mapFromGlobal(e->global.toPoint()) + delta; | - | ||||||||||||||||||||||||||||||||||||
1640 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1641 | Qt::MouseButtons stateChange = e->buttons ^ tabletState; | - | ||||||||||||||||||||||||||||||||||||
1642 | Qt::MouseButton button = Qt::NoButton; | - | ||||||||||||||||||||||||||||||||||||
1643 | for (int check = Qt::LeftButton; check <= int(Qt::MaxMouseButton)
| 0 | ||||||||||||||||||||||||||||||||||||
1644 | if (check & stateChange
| 0 | ||||||||||||||||||||||||||||||||||||
1645 | button = Qt::MouseButton(check); | - | ||||||||||||||||||||||||||||||||||||
1646 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1647 | } | - | ||||||||||||||||||||||||||||||||||||
1648 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1649 | QTabletEvent ev(type, local, e->global, | - | ||||||||||||||||||||||||||||||||||||
1650 | e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt, | - | ||||||||||||||||||||||||||||||||||||
1651 | e->tangentialPressure, e->rotation, e->z, | - | ||||||||||||||||||||||||||||||||||||
1652 | e->modifiers, e->uid, button, e->buttons); | - | ||||||||||||||||||||||||||||||||||||
1653 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1654 | QGuiApplication::sendSpontaneousEvent(window, &ev); | - | ||||||||||||||||||||||||||||||||||||
1655 | tabletState = e->buttons; | - | ||||||||||||||||||||||||||||||||||||
1656 | - | |||||||||||||||||||||||||||||||||||||
1657 | - | |||||||||||||||||||||||||||||||||||||
1658 | - | |||||||||||||||||||||||||||||||||||||
1659 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1660 | - | |||||||||||||||||||||||||||||||||||||
1661 | void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1662 | { | - | ||||||||||||||||||||||||||||||||||||
1663 | - | |||||||||||||||||||||||||||||||||||||
1664 | QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(), | - | ||||||||||||||||||||||||||||||||||||
1665 | e->device, e->pointerType, 0, 0, 0, | - | ||||||||||||||||||||||||||||||||||||
1666 | 0, 0, 0, | - | ||||||||||||||||||||||||||||||||||||
1667 | Qt::NoModifier, e->uid, Qt::NoButton, tabletState); | - | ||||||||||||||||||||||||||||||||||||
1668 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1669 | QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev); | - | ||||||||||||||||||||||||||||||||||||
1670 | - | |||||||||||||||||||||||||||||||||||||
1671 | - | |||||||||||||||||||||||||||||||||||||
1672 | - | |||||||||||||||||||||||||||||||||||||
1673 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1674 | - | |||||||||||||||||||||||||||||||||||||
1675 | void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1676 | { | - | ||||||||||||||||||||||||||||||||||||
1677 | - | |||||||||||||||||||||||||||||||||||||
1678 | QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(), | - | ||||||||||||||||||||||||||||||||||||
1679 | e->device, e->pointerType, 0, 0, 0, | - | ||||||||||||||||||||||||||||||||||||
1680 | 0, 0, 0, | - | ||||||||||||||||||||||||||||||||||||
1681 | Qt::NoModifier, e->uid, Qt::NoButton, tabletState); | - | ||||||||||||||||||||||||||||||||||||
1682 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1683 | QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev); | - | ||||||||||||||||||||||||||||||||||||
1684 | - | |||||||||||||||||||||||||||||||||||||
1685 | - | |||||||||||||||||||||||||||||||||||||
1686 | - | |||||||||||||||||||||||||||||||||||||
1687 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1688 | - | |||||||||||||||||||||||||||||||||||||
1689 | - | |||||||||||||||||||||||||||||||||||||
1690 | void QGuiApplicationPrivate::processGestureEvent(QWindowSystemInterfacePrivate::GestureEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1691 | { | - | ||||||||||||||||||||||||||||||||||||
1692 | if (e->window.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
1693 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1694 | - | |||||||||||||||||||||||||||||||||||||
1695 | QNativeGestureEvent ev(e->type, e->pos, e->pos, e->globalPos, e->realValue, e->sequenceId, e->intValue); | - | ||||||||||||||||||||||||||||||||||||
1696 | ev.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1697 | QGuiApplication::sendSpontaneousEvent(e->window, &ev); | - | ||||||||||||||||||||||||||||||||||||
1698 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1699 | - | |||||||||||||||||||||||||||||||||||||
1700 | - | |||||||||||||||||||||||||||||||||||||
1701 | void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1702 | { | - | ||||||||||||||||||||||||||||||||||||
1703 | if (!e->window
| 0 | ||||||||||||||||||||||||||||||||||||
1704 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1705 | - | |||||||||||||||||||||||||||||||||||||
1706 | if (e->window->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1707 | - | |||||||||||||||||||||||||||||||||||||
1708 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1709 | } | - | ||||||||||||||||||||||||||||||||||||
1710 | - | |||||||||||||||||||||||||||||||||||||
1711 | QEvent ev(QEvent::PlatformPanel); | - | ||||||||||||||||||||||||||||||||||||
1712 | QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev); | - | ||||||||||||||||||||||||||||||||||||
1713 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1714 | - | |||||||||||||||||||||||||||||||||||||
1715 | - | |||||||||||||||||||||||||||||||||||||
1716 | void QGuiApplicationPrivate::processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1717 | { | - | ||||||||||||||||||||||||||||||||||||
1718 | - | |||||||||||||||||||||||||||||||||||||
1719 | - | |||||||||||||||||||||||||||||||||||||
1720 | if (!e->window
| 0 | ||||||||||||||||||||||||||||||||||||
1721 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1722 | - | |||||||||||||||||||||||||||||||||||||
1723 | QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers); | - | ||||||||||||||||||||||||||||||||||||
1724 | QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev); | - | ||||||||||||||||||||||||||||||||||||
1725 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1726 | - | |||||||||||||||||||||||||||||||||||||
1727 | - | |||||||||||||||||||||||||||||||||||||
1728 | __attribute__((visibility("default"))) uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k) | - | ||||||||||||||||||||||||||||||||||||
1729 | { | - | ||||||||||||||||||||||||||||||||||||
1730 | return never executed: qHash(k.device) + k.touchPointId;return qHash(k.device) + k.touchPointId; never executed: return qHash(k.device) + k.touchPointId; | 0 | ||||||||||||||||||||||||||||||||||||
1731 | } | - | ||||||||||||||||||||||||||||||||||||
1732 | - | |||||||||||||||||||||||||||||||||||||
1733 | __attribute__((visibility("default"))) bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey &a, | - | ||||||||||||||||||||||||||||||||||||
1734 | const QGuiApplicationPrivate::ActiveTouchPointsKey &b) | - | ||||||||||||||||||||||||||||||||||||
1735 | { | - | ||||||||||||||||||||||||||||||||||||
1736 | return never executed: a.device == b.devicereturn a.device == b.device && a.touchPointId == b.touchPointId;
never executed: return a.device == b.device && a.touchPointId == b.touchPointId; | 0 | ||||||||||||||||||||||||||||||||||||
1737 | && a.touchPointId == b.touchPointId
never executed: return a.device == b.device && a.touchPointId == b.touchPointId; | 0 | ||||||||||||||||||||||||||||||||||||
1738 | } | - | ||||||||||||||||||||||||||||||||||||
1739 | - | |||||||||||||||||||||||||||||||||||||
1740 | void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1741 | { | - | ||||||||||||||||||||||||||||||||||||
1742 | QGuiApplicationPrivate *d = self; | - | ||||||||||||||||||||||||||||||||||||
1743 | modifier_buttons = e->modifiers; | - | ||||||||||||||||||||||||||||||||||||
1744 | - | |||||||||||||||||||||||||||||||||||||
1745 | if (e->touchType == QEvent::TouchCancel
| 0 | ||||||||||||||||||||||||||||||||||||
1746 | - | |||||||||||||||||||||||||||||||||||||
1747 | - | |||||||||||||||||||||||||||||||||||||
1748 | QTouchEvent touchEvent(QEvent::TouchCancel, e->device, e->modifiers); | - | ||||||||||||||||||||||||||||||||||||
1749 | touchEvent.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1750 | QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it | - | ||||||||||||||||||||||||||||||||||||
1751 | = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd(); | - | ||||||||||||||||||||||||||||||||||||
1752 | QSet<QWindow *> windowsNeedingCancel; | - | ||||||||||||||||||||||||||||||||||||
1753 | while (it != ite
| 0 | ||||||||||||||||||||||||||||||||||||
1754 | QWindow *w = it->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1755 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
1756 | windowsNeedingCancel.insert(w); never executed: windowsNeedingCancel.insert(w); | 0 | ||||||||||||||||||||||||||||||||||||
1757 | ++it; | - | ||||||||||||||||||||||||||||||||||||
1758 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1759 | for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(), | - | ||||||||||||||||||||||||||||||||||||
1760 | winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd
| 0 | ||||||||||||||||||||||||||||||||||||
1761 | touchEvent.setWindow(*winIt); | - | ||||||||||||||||||||||||||||||||||||
1762 | QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent); | - | ||||||||||||||||||||||||||||||||||||
1763 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1764 | if (!self->synthesizedMousePoints.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
1765 | for (QHash<QWindow *, SynthesizedMouseData>::const_iterator synthIt = self->synthesizedMousePoints.constBegin(), | - | ||||||||||||||||||||||||||||||||||||
1766 | synthItEnd = self->synthesizedMousePoints.constEnd(); synthIt != synthItEnd
| 0 | ||||||||||||||||||||||||||||||||||||
1767 | if (!synthIt->window
| 0 | ||||||||||||||||||||||||||||||||||||
1768 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1769 | QWindowSystemInterfacePrivate::MouseEvent fake(synthIt->window.data(), | - | ||||||||||||||||||||||||||||||||||||
1770 | e->timestamp, | - | ||||||||||||||||||||||||||||||||||||
1771 | synthIt->pos, | - | ||||||||||||||||||||||||||||||||||||
1772 | synthIt->screenPos, | - | ||||||||||||||||||||||||||||||||||||
1773 | buttons & ~Qt::LeftButton, | - | ||||||||||||||||||||||||||||||||||||
1774 | e->modifiers, | - | ||||||||||||||||||||||||||||||||||||
1775 | Qt::MouseEventSynthesizedByQt); | - | ||||||||||||||||||||||||||||||||||||
1776 | fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; | - | ||||||||||||||||||||||||||||||||||||
1777 | processMouseEvent(&fake); | - | ||||||||||||||||||||||||||||||||||||
1778 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1779 | self->synthesizedMousePoints.clear(); | - | ||||||||||||||||||||||||||||||||||||
1780 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1781 | self->activeTouchPoints.clear(); | - | ||||||||||||||||||||||||||||||||||||
1782 | self->lastTouchType = e->touchType; | - | ||||||||||||||||||||||||||||||||||||
1783 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1784 | } | - | ||||||||||||||||||||||||||||||||||||
1785 | - | |||||||||||||||||||||||||||||||||||||
1786 | - | |||||||||||||||||||||||||||||||||||||
1787 | if (self->lastTouchType == QEvent::TouchCancel
| 0 | ||||||||||||||||||||||||||||||||||||
1788 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1789 | - | |||||||||||||||||||||||||||||||||||||
1790 | self->lastTouchType = e->touchType; | - | ||||||||||||||||||||||||||||||||||||
1791 | - | |||||||||||||||||||||||||||||||||||||
1792 | QWindow *window = e->window.data(); | - | ||||||||||||||||||||||||||||||||||||
1793 | typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; | - | ||||||||||||||||||||||||||||||||||||
1794 | QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; | - | ||||||||||||||||||||||||||||||||||||
1795 | - | |||||||||||||||||||||||||||||||||||||
1796 | for (int i = 0; i < e->points.count()
| 0 | ||||||||||||||||||||||||||||||||||||
1797 | QTouchEvent::TouchPoint touchPoint = e->points.at(i); | - | ||||||||||||||||||||||||||||||||||||
1798 | - | |||||||||||||||||||||||||||||||||||||
1799 | - | |||||||||||||||||||||||||||||||||||||
1800 | - | |||||||||||||||||||||||||||||||||||||
1801 | touchPoint.d = touchPoint.d->detach(); | - | ||||||||||||||||||||||||||||||||||||
1802 | - | |||||||||||||||||||||||||||||||||||||
1803 | - | |||||||||||||||||||||||||||||||||||||
1804 | QPointer<QWindow> w; | - | ||||||||||||||||||||||||||||||||||||
1805 | QTouchEvent::TouchPoint previousTouchPoint; | - | ||||||||||||||||||||||||||||||||||||
1806 | ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id()); | - | ||||||||||||||||||||||||||||||||||||
1807 | ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey]; | - | ||||||||||||||||||||||||||||||||||||
1808 | switch (touchPoint.state()) { | - | ||||||||||||||||||||||||||||||||||||
1809 | case never executed: Qt::TouchPointPressed:case Qt::TouchPointPressed: never executed: case Qt::TouchPointPressed: | 0 | ||||||||||||||||||||||||||||||||||||
1810 | if (e->device->type() == QTouchDevice::TouchPad
| 0 | ||||||||||||||||||||||||||||||||||||
1811 | - | |||||||||||||||||||||||||||||||||||||
1812 | w = d->activeTouchPoints.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
1813 | ? QPointer<QWindow>() | - | ||||||||||||||||||||||||||||||||||||
1814 | : d->activeTouchPoints.constBegin().value().window; | - | ||||||||||||||||||||||||||||||||||||
1815 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1816 | - | |||||||||||||||||||||||||||||||||||||
1817 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
1818 | - | |||||||||||||||||||||||||||||||||||||
1819 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1820 | window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint()); never executed: window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint()); | 0 | ||||||||||||||||||||||||||||||||||||
1821 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
1822 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1823 | w = window; | - | ||||||||||||||||||||||||||||||||||||
1824 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1825 | - | |||||||||||||||||||||||||||||||||||||
1826 | touchInfo.window = w; | - | ||||||||||||||||||||||||||||||||||||
1827 | touchPoint.d->startScreenPos = touchPoint.screenPos(); | - | ||||||||||||||||||||||||||||||||||||
1828 | touchPoint.d->lastScreenPos = touchPoint.screenPos(); | - | ||||||||||||||||||||||||||||||||||||
1829 | touchPoint.d->startNormalizedPos = touchPoint.normalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1830 | touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1831 | if (touchPoint.pressure() < qreal(0.)
| 0 | ||||||||||||||||||||||||||||||||||||
1832 | touchPoint.d->pressure = qreal(1.); never executed: touchPoint.d->pressure = qreal(1.); | 0 | ||||||||||||||||||||||||||||||||||||
1833 | - | |||||||||||||||||||||||||||||||||||||
1834 | touchInfo.touchPoint = touchPoint; | - | ||||||||||||||||||||||||||||||||||||
1835 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1836 | - | |||||||||||||||||||||||||||||||||||||
1837 | case never executed: Qt::TouchPointReleased:case Qt::TouchPointReleased: never executed: case Qt::TouchPointReleased: | 0 | ||||||||||||||||||||||||||||||||||||
1838 | w = touchInfo.window; | - | ||||||||||||||||||||||||||||||||||||
1839 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
1840 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1841 | - | |||||||||||||||||||||||||||||||||||||
1842 | previousTouchPoint = touchInfo.touchPoint; | - | ||||||||||||||||||||||||||||||||||||
1843 | touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); | - | ||||||||||||||||||||||||||||||||||||
1844 | touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); | - | ||||||||||||||||||||||||||||||||||||
1845 | touchPoint.d->startPos = previousTouchPoint.startPos(); | - | ||||||||||||||||||||||||||||||||||||
1846 | touchPoint.d->lastPos = previousTouchPoint.pos(); | - | ||||||||||||||||||||||||||||||||||||
1847 | touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1848 | touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1849 | if (touchPoint.pressure() < qreal(0.)
| 0 | ||||||||||||||||||||||||||||||||||||
1850 | touchPoint.d->pressure = qreal(0.); never executed: touchPoint.d->pressure = qreal(0.); | 0 | ||||||||||||||||||||||||||||||||||||
1851 | - | |||||||||||||||||||||||||||||||||||||
1852 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1853 | - | |||||||||||||||||||||||||||||||||||||
1854 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
1855 | w = touchInfo.window; | - | ||||||||||||||||||||||||||||||||||||
1856 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
1857 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1858 | - | |||||||||||||||||||||||||||||||||||||
1859 | previousTouchPoint = touchInfo.touchPoint; | - | ||||||||||||||||||||||||||||||||||||
1860 | touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); | - | ||||||||||||||||||||||||||||||||||||
1861 | touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); | - | ||||||||||||||||||||||||||||||||||||
1862 | touchPoint.d->startPos = previousTouchPoint.startPos(); | - | ||||||||||||||||||||||||||||||||||||
1863 | touchPoint.d->lastPos = previousTouchPoint.pos(); | - | ||||||||||||||||||||||||||||||||||||
1864 | touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1865 | touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); | - | ||||||||||||||||||||||||||||||||||||
1866 | if (touchPoint.pressure() < qreal(0.)
| 0 | ||||||||||||||||||||||||||||||||||||
1867 | touchPoint.d->pressure = qreal(1.); never executed: touchPoint.d->pressure = qreal(1.); | 0 | ||||||||||||||||||||||||||||||||||||
1868 | - | |||||||||||||||||||||||||||||||||||||
1869 | - | |||||||||||||||||||||||||||||||||||||
1870 | - | |||||||||||||||||||||||||||||||||||||
1871 | if (touchPoint.state() != Qt::TouchPointStationary
| 0 | ||||||||||||||||||||||||||||||||||||
1872 | touchInfo.touchPoint = touchPoint; never executed: touchInfo.touchPoint = touchPoint; | 0 | ||||||||||||||||||||||||||||||||||||
1873 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1874 | } | - | ||||||||||||||||||||||||||||||||||||
1875 | - | |||||||||||||||||||||||||||||||||||||
1876 | ((!(w.data() != 0)) ? qt_assert("w.data() != 0",__FILE__,2489) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
1877 | - | |||||||||||||||||||||||||||||||||||||
1878 | - | |||||||||||||||||||||||||||||||||||||
1879 | touchPoint.d->sceneRect = touchPoint.screenRect(); | - | ||||||||||||||||||||||||||||||||||||
1880 | touchPoint.d->startScenePos = touchPoint.startScreenPos(); | - | ||||||||||||||||||||||||||||||||||||
1881 | touchPoint.d->lastScenePos = touchPoint.lastScreenPos(); | - | ||||||||||||||||||||||||||||||||||||
1882 | - | |||||||||||||||||||||||||||||||||||||
1883 | StatesAndTouchPoints &maskAndPoints = windowsNeedingEvents[w.data()]; | - | ||||||||||||||||||||||||||||||||||||
1884 | maskAndPoints.first |= touchPoint.state(); | - | ||||||||||||||||||||||||||||||||||||
1885 | maskAndPoints.second.append(touchPoint); | - | ||||||||||||||||||||||||||||||||||||
1886 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1887 | - | |||||||||||||||||||||||||||||||||||||
1888 | if (windowsNeedingEvents.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
1889 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
1890 | - | |||||||||||||||||||||||||||||||||||||
1891 | QHash<QWindow *, StatesAndTouchPoints>::ConstIterator it = windowsNeedingEvents.constBegin(); | - | ||||||||||||||||||||||||||||||||||||
1892 | const QHash<QWindow *, StatesAndTouchPoints>::ConstIterator end = windowsNeedingEvents.constEnd(); | - | ||||||||||||||||||||||||||||||||||||
1893 | for (; it != end
| 0 | ||||||||||||||||||||||||||||||||||||
1894 | QWindow *w = it.key(); | - | ||||||||||||||||||||||||||||||||||||
1895 | - | |||||||||||||||||||||||||||||||||||||
1896 | QEvent::Type eventType; | - | ||||||||||||||||||||||||||||||||||||
1897 | switch (it.value().first) { | - | ||||||||||||||||||||||||||||||||||||
1898 | case never executed: Qt::TouchPointPressed:case Qt::TouchPointPressed: never executed: case Qt::TouchPointPressed: | 0 | ||||||||||||||||||||||||||||||||||||
1899 | eventType = QEvent::TouchBegin; | - | ||||||||||||||||||||||||||||||||||||
1900 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1901 | case never executed: Qt::TouchPointReleased:case Qt::TouchPointReleased: never executed: case Qt::TouchPointReleased: | 0 | ||||||||||||||||||||||||||||||||||||
1902 | eventType = QEvent::TouchEnd; | - | ||||||||||||||||||||||||||||||||||||
1903 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1904 | case never executed: Qt::TouchPointStationary:case Qt::TouchPointStationary: never executed: case Qt::TouchPointStationary: | 0 | ||||||||||||||||||||||||||||||||||||
1905 | - | |||||||||||||||||||||||||||||||||||||
1906 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1907 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
1908 | eventType = QEvent::TouchUpdate; | - | ||||||||||||||||||||||||||||||||||||
1909 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1910 | } | - | ||||||||||||||||||||||||||||||||||||
1911 | - | |||||||||||||||||||||||||||||||||||||
1912 | if (w->d_func()->blockedByModalWindow
| 0 | ||||||||||||||||||||||||||||||||||||
1913 | - | |||||||||||||||||||||||||||||||||||||
1914 | - | |||||||||||||||||||||||||||||||||||||
1915 | - | |||||||||||||||||||||||||||||||||||||
1916 | if (eventType == QEvent::TouchEnd
| 0 | ||||||||||||||||||||||||||||||||||||
1917 | - | |||||||||||||||||||||||||||||||||||||
1918 | - | |||||||||||||||||||||||||||||||||||||
1919 | QTouchEvent touchEvent(QEvent::TouchCancel, | - | ||||||||||||||||||||||||||||||||||||
1920 | e->device, | - | ||||||||||||||||||||||||||||||||||||
1921 | e->modifiers); | - | ||||||||||||||||||||||||||||||||||||
1922 | touchEvent.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1923 | touchEvent.setWindow(w); | - | ||||||||||||||||||||||||||||||||||||
1924 | QGuiApplication::sendSpontaneousEvent(w, &touchEvent); | - | ||||||||||||||||||||||||||||||||||||
1925 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1926 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
1927 | } | - | ||||||||||||||||||||||||||||||||||||
1928 | - | |||||||||||||||||||||||||||||||||||||
1929 | QTouchEvent touchEvent(eventType, | - | ||||||||||||||||||||||||||||||||||||
1930 | e->device, | - | ||||||||||||||||||||||||||||||||||||
1931 | e->modifiers, | - | ||||||||||||||||||||||||||||||||||||
1932 | it.value().first, | - | ||||||||||||||||||||||||||||||||||||
1933 | it.value().second); | - | ||||||||||||||||||||||||||||||||||||
1934 | touchEvent.setTimestamp(e->timestamp); | - | ||||||||||||||||||||||||||||||||||||
1935 | touchEvent.setWindow(w); | - | ||||||||||||||||||||||||||||||||||||
1936 | - | |||||||||||||||||||||||||||||||||||||
1937 | const int pointCount = touchEvent.touchPoints().count(); | - | ||||||||||||||||||||||||||||||||||||
1938 | for (int i = 0; i < pointCount
| 0 | ||||||||||||||||||||||||||||||||||||
1939 | QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i]; | - | ||||||||||||||||||||||||||||||||||||
1940 | - | |||||||||||||||||||||||||||||||||||||
1941 | - | |||||||||||||||||||||||||||||||||||||
1942 | QRectF rect = touchPoint.screenRect(); | - | ||||||||||||||||||||||||||||||||||||
1943 | const QPointF screenPos = rect.center(); | - | ||||||||||||||||||||||||||||||||||||
1944 | const QPointF delta = screenPos - screenPos.toPoint(); | - | ||||||||||||||||||||||||||||||||||||
1945 | - | |||||||||||||||||||||||||||||||||||||
1946 | rect.moveCenter(w->mapFromGlobal(screenPos.toPoint()) + delta); | - | ||||||||||||||||||||||||||||||||||||
1947 | touchPoint.d->rect = rect; | - | ||||||||||||||||||||||||||||||||||||
1948 | if (touchPoint.state() == Qt::TouchPointPressed
| 0 | ||||||||||||||||||||||||||||||||||||
1949 | touchPoint.d->startPos = w->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; | - | ||||||||||||||||||||||||||||||||||||
1950 | touchPoint.d->lastPos = w->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; | - | ||||||||||||||||||||||||||||||||||||
1951 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1952 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1953 | - | |||||||||||||||||||||||||||||||||||||
1954 | QGuiApplication::sendSpontaneousEvent(w, &touchEvent); | - | ||||||||||||||||||||||||||||||||||||
1955 | if (!e->synthetic()
| 0 | ||||||||||||||||||||||||||||||||||||
1956 | - | |||||||||||||||||||||||||||||||||||||
1957 | if (!(touchEvent.device()->capabilities() & QTouchDevice::MouseEmulation)
| 0 | ||||||||||||||||||||||||||||||||||||
1958 | Qt::MouseButtons b = eventType == QEvent::TouchEnd
| 0 | ||||||||||||||||||||||||||||||||||||
1959 | if (b == Qt::NoButton
| 0 | ||||||||||||||||||||||||||||||||||||
1960 | self->synthesizedMousePoints.clear(); never executed: self->synthesizedMousePoints.clear(); | 0 | ||||||||||||||||||||||||||||||||||||
1961 | - | |||||||||||||||||||||||||||||||||||||
1962 | QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints(); | - | ||||||||||||||||||||||||||||||||||||
1963 | if (eventType == QEvent::TouchBegin
| 0 | ||||||||||||||||||||||||||||||||||||
1964 | m_fakeMouseSourcePointId = touchPoints.first().id(); never executed: m_fakeMouseSourcePointId = touchPoints.first().id(); | 0 | ||||||||||||||||||||||||||||||||||||
1965 | - | |||||||||||||||||||||||||||||||||||||
1966 | for (int i = 0; i < touchPoints.count()
| 0 | ||||||||||||||||||||||||||||||||||||
1967 | const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i); | - | ||||||||||||||||||||||||||||||||||||
1968 | if (touchPoint.id() == m_fakeMouseSourcePointId
| 0 | ||||||||||||||||||||||||||||||||||||
1969 | if (b != Qt::NoButton
| 0 | ||||||||||||||||||||||||||||||||||||
1970 | self->synthesizedMousePoints.insert(w, SynthesizedMouseData( never executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w)); | 0 | ||||||||||||||||||||||||||||||||||||
1971 | touchPoint.pos(), touchPoint.screenPos(), w)); never executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w)); | 0 | ||||||||||||||||||||||||||||||||||||
1972 | QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp, | - | ||||||||||||||||||||||||||||||||||||
1973 | touchPoint.pos(), | - | ||||||||||||||||||||||||||||||||||||
1974 | touchPoint.screenPos(), | - | ||||||||||||||||||||||||||||||||||||
1975 | b | (buttons & ~Qt::LeftButton), | - | ||||||||||||||||||||||||||||||||||||
1976 | e->modifiers, | - | ||||||||||||||||||||||||||||||||||||
1977 | Qt::MouseEventSynthesizedByQt); | - | ||||||||||||||||||||||||||||||||||||
1978 | fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; | - | ||||||||||||||||||||||||||||||||||||
1979 | processMouseEvent(&fake); | - | ||||||||||||||||||||||||||||||||||||
1980 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
1981 | } | - | ||||||||||||||||||||||||||||||||||||
1982 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1983 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1984 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1985 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1986 | - | |||||||||||||||||||||||||||||||||||||
1987 | - | |||||||||||||||||||||||||||||||||||||
1988 | - | |||||||||||||||||||||||||||||||||||||
1989 | - | |||||||||||||||||||||||||||||||||||||
1990 | - | |||||||||||||||||||||||||||||||||||||
1991 | for (int i = 0; i < e->points.count()
| 0 | ||||||||||||||||||||||||||||||||||||
1992 | QTouchEvent::TouchPoint touchPoint = e->points.at(i); | - | ||||||||||||||||||||||||||||||||||||
1993 | if (touchPoint.state() == Qt::TouchPointReleased
| 0 | ||||||||||||||||||||||||||||||||||||
1994 | d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id())); never executed: d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id())); | 0 | ||||||||||||||||||||||||||||||||||||
1995 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1996 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
1997 | - | |||||||||||||||||||||||||||||||||||||
1998 | void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e) | - | ||||||||||||||||||||||||||||||||||||
1999 | { | - | ||||||||||||||||||||||||||||||||||||
2000 | - | |||||||||||||||||||||||||||||||||||||
2001 | if (QCoreApplication::startingUp()
| 0 | ||||||||||||||||||||||||||||||||||||
2002 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2003 | - | |||||||||||||||||||||||||||||||||||||
2004 | if (!e->screen
| 0 | ||||||||||||||||||||||||||||||||||||
2005 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2006 | - | |||||||||||||||||||||||||||||||||||||
2007 | QScreen *s = e->screen.data(); | - | ||||||||||||||||||||||||||||||||||||
2008 | s->d_func()->orientation = e->orientation; | - | ||||||||||||||||||||||||||||||||||||
2009 | - | |||||||||||||||||||||||||||||||||||||
2010 | updateFilteredScreenOrientation(s); | - | ||||||||||||||||||||||||||||||||||||
2011 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2012 | - | |||||||||||||||||||||||||||||||||||||
2013 | void QGuiApplicationPrivate::updateFilteredScreenOrientation(QScreen *s) | - | ||||||||||||||||||||||||||||||||||||
2014 | { | - | ||||||||||||||||||||||||||||||||||||
2015 | Qt::ScreenOrientation o = s->d_func()->orientation; | - | ||||||||||||||||||||||||||||||||||||
2016 | if (o == Qt::PrimaryOrientation
| 0 | ||||||||||||||||||||||||||||||||||||
2017 | o = s->primaryOrientation(); never executed: o = s->primaryOrientation(); | 0 | ||||||||||||||||||||||||||||||||||||
2018 | o = Qt::ScreenOrientation(o & s->orientationUpdateMask()); | - | ||||||||||||||||||||||||||||||||||||
2019 | if (o == Qt::PrimaryOrientation
| 0 | ||||||||||||||||||||||||||||||||||||
2020 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2021 | if (o == s->d_func()->filteredOrientation
| 0 | ||||||||||||||||||||||||||||||||||||
2022 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2023 | s->d_func()->filteredOrientation = o; | - | ||||||||||||||||||||||||||||||||||||
2024 | reportScreenOrientationChange(s); | - | ||||||||||||||||||||||||||||||||||||
2025 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2026 | - | |||||||||||||||||||||||||||||||||||||
2027 | void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s) | - | ||||||||||||||||||||||||||||||||||||
2028 | { | - | ||||||||||||||||||||||||||||||||||||
2029 | s->orientationChanged(s->orientation()); | - | ||||||||||||||||||||||||||||||||||||
2030 | - | |||||||||||||||||||||||||||||||||||||
2031 | QScreenOrientationChangeEvent event(s, s->orientation()); | - | ||||||||||||||||||||||||||||||||||||
2032 | QCoreApplication::sendEvent(QCoreApplication::instance(), &event); | - | ||||||||||||||||||||||||||||||||||||
2033 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2034 | - | |||||||||||||||||||||||||||||||||||||
2035 | void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e) | - | ||||||||||||||||||||||||||||||||||||
2036 | { | - | ||||||||||||||||||||||||||||||||||||
2037 | - | |||||||||||||||||||||||||||||||||||||
2038 | if (QCoreApplication::startingUp()
| 0 | ||||||||||||||||||||||||||||||||||||
2039 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2040 | - | |||||||||||||||||||||||||||||||||||||
2041 | if (!e->screen
| 0 | ||||||||||||||||||||||||||||||||||||
2042 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2043 | - | |||||||||||||||||||||||||||||||||||||
2044 | QScreen *s = e->screen.data(); | - | ||||||||||||||||||||||||||||||||||||
2045 | - | |||||||||||||||||||||||||||||||||||||
2046 | bool geometryChanged = e->geometry != s->d_func()->geometry; | - | ||||||||||||||||||||||||||||||||||||
2047 | s->d_func()->geometry = e->geometry; | - | ||||||||||||||||||||||||||||||||||||
2048 | - | |||||||||||||||||||||||||||||||||||||
2049 | bool availableGeometryChanged = e->availableGeometry != s->d_func()->availableGeometry; | - | ||||||||||||||||||||||||||||||||||||
2050 | s->d_func()->availableGeometry = e->availableGeometry; | - | ||||||||||||||||||||||||||||||||||||
2051 | - | |||||||||||||||||||||||||||||||||||||
2052 | if (geometryChanged
| 0 | ||||||||||||||||||||||||||||||||||||
2053 | Qt::ScreenOrientation primaryOrientation = s->primaryOrientation(); | - | ||||||||||||||||||||||||||||||||||||
2054 | s->d_func()->updatePrimaryOrientation(); | - | ||||||||||||||||||||||||||||||||||||
2055 | - | |||||||||||||||||||||||||||||||||||||
2056 | s->geometryChanged(s->geometry()); | - | ||||||||||||||||||||||||||||||||||||
2057 | s->physicalSizeChanged(s->physicalSize()); | - | ||||||||||||||||||||||||||||||||||||
2058 | s->physicalDotsPerInchChanged(s->physicalDotsPerInch()); | - | ||||||||||||||||||||||||||||||||||||
2059 | s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); | - | ||||||||||||||||||||||||||||||||||||
2060 | - | |||||||||||||||||||||||||||||||||||||
2061 | if (s->primaryOrientation() != primaryOrientation
| 0 | ||||||||||||||||||||||||||||||||||||
2062 | s->primaryOrientationChanged(s->primaryOrientation()); never executed: s->primaryOrientationChanged(s->primaryOrientation()); | 0 | ||||||||||||||||||||||||||||||||||||
2063 | - | |||||||||||||||||||||||||||||||||||||
2064 | if (s->d_func()->orientation == Qt::PrimaryOrientation
| 0 | ||||||||||||||||||||||||||||||||||||
2065 | updateFilteredScreenOrientation(s); never executed: updateFilteredScreenOrientation(s); | 0 | ||||||||||||||||||||||||||||||||||||
2066 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2067 | - | |||||||||||||||||||||||||||||||||||||
2068 | if (availableGeometryChanged
| 0 | ||||||||||||||||||||||||||||||||||||
2069 | s->availableGeometryChanged(s->availableGeometry()); never executed: s->availableGeometryChanged(s->availableGeometry()); | 0 | ||||||||||||||||||||||||||||||||||||
2070 | - | |||||||||||||||||||||||||||||||||||||
2071 | if (geometryChanged
| 0 | ||||||||||||||||||||||||||||||||||||
2072 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(s->virtualSiblings())>::type> _container_((s->virtualSiblings())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QScreen* sibling = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
2073 | sibling->virtualGeometryChanged(sibling->virtualGeometry()); never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry()); | 0 | ||||||||||||||||||||||||||||||||||||
2074 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2075 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2076 | - | |||||||||||||||||||||||||||||||||||||
2077 | void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e) | - | ||||||||||||||||||||||||||||||||||||
2078 | { | - | ||||||||||||||||||||||||||||||||||||
2079 | - | |||||||||||||||||||||||||||||||||||||
2080 | if (QCoreApplication::startingUp()
| 0 | ||||||||||||||||||||||||||||||||||||
2081 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2082 | - | |||||||||||||||||||||||||||||||||||||
2083 | if (!e->screen
| 0 | ||||||||||||||||||||||||||||||||||||
2084 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2085 | - | |||||||||||||||||||||||||||||||||||||
2086 | QScreen *s = e->screen.data(); | - | ||||||||||||||||||||||||||||||||||||
2087 | s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY); | - | ||||||||||||||||||||||||||||||||||||
2088 | - | |||||||||||||||||||||||||||||||||||||
2089 | s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); | - | ||||||||||||||||||||||||||||||||||||
2090 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2091 | - | |||||||||||||||||||||||||||||||||||||
2092 | void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e) | - | ||||||||||||||||||||||||||||||||||||
2093 | { | - | ||||||||||||||||||||||||||||||||||||
2094 | - | |||||||||||||||||||||||||||||||||||||
2095 | if (QCoreApplication::startingUp()
| 0 | ||||||||||||||||||||||||||||||||||||
2096 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2097 | - | |||||||||||||||||||||||||||||||||||||
2098 | if (!e->screen
| 0 | ||||||||||||||||||||||||||||||||||||
2099 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2100 | - | |||||||||||||||||||||||||||||||||||||
2101 | QScreen *s = e->screen.data(); | - | ||||||||||||||||||||||||||||||||||||
2102 | qreal rate = e->rate; | - | ||||||||||||||||||||||||||||||||||||
2103 | - | |||||||||||||||||||||||||||||||||||||
2104 | if (rate < 1.0
| 0 | ||||||||||||||||||||||||||||||||||||
2105 | rate = 60.0; never executed: rate = 60.0; | 0 | ||||||||||||||||||||||||||||||||||||
2106 | if (!qFuzzyCompare(s->d_func()->refreshRate, rate)
| 0 | ||||||||||||||||||||||||||||||||||||
2107 | s->d_func()->refreshRate = rate; | - | ||||||||||||||||||||||||||||||||||||
2108 | s->refreshRateChanged(s->refreshRate()); | - | ||||||||||||||||||||||||||||||||||||
2109 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2110 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2111 | - | |||||||||||||||||||||||||||||||||||||
2112 | void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e) | - | ||||||||||||||||||||||||||||||||||||
2113 | { | - | ||||||||||||||||||||||||||||||||||||
2114 | if (!e->exposed
| 0 | ||||||||||||||||||||||||||||||||||||
2115 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2116 | - | |||||||||||||||||||||||||||||||||||||
2117 | QWindow *window = e->exposed.data(); | - | ||||||||||||||||||||||||||||||||||||
2118 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
2119 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2120 | QWindowPrivate *p = qt_window_private(window); | - | ||||||||||||||||||||||||||||||||||||
2121 | - | |||||||||||||||||||||||||||||||||||||
2122 | if (!p->receivedExpose
| 0 | ||||||||||||||||||||||||||||||||||||
2123 | if (p->resizeEventPending
| 0 | ||||||||||||||||||||||||||||||||||||
2124 | - | |||||||||||||||||||||||||||||||||||||
2125 | - | |||||||||||||||||||||||||||||||||||||
2126 | QResizeEvent e(window->geometry().size(), p->geometry.size()); | - | ||||||||||||||||||||||||||||||||||||
2127 | QGuiApplication::sendSpontaneousEvent(window, &e); | - | ||||||||||||||||||||||||||||||||||||
2128 | - | |||||||||||||||||||||||||||||||||||||
2129 | p->resizeEventPending = false; | - | ||||||||||||||||||||||||||||||||||||
2130 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2131 | - | |||||||||||||||||||||||||||||||||||||
2132 | p->receivedExpose = true; | - | ||||||||||||||||||||||||||||||||||||
2133 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2134 | - | |||||||||||||||||||||||||||||||||||||
2135 | p->exposed = e->isExposed
| 0 | ||||||||||||||||||||||||||||||||||||
2136 | - | |||||||||||||||||||||||||||||||||||||
2137 | QExposeEvent exposeEvent(e->region); | - | ||||||||||||||||||||||||||||||||||||
2138 | QCoreApplication::sendSpontaneousEvent(window, &exposeEvent); | - | ||||||||||||||||||||||||||||||||||||
2139 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2140 | - | |||||||||||||||||||||||||||||||||||||
2141 | - | |||||||||||||||||||||||||||||||||||||
2142 | - | |||||||||||||||||||||||||||||||||||||
2143 | QPlatformDragQtResponse QGuiApplicationPrivate::processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) | - | ||||||||||||||||||||||||||||||||||||
2144 | { | - | ||||||||||||||||||||||||||||||||||||
2145 | static QPointer<QWindow> currentDragWindow; | - | ||||||||||||||||||||||||||||||||||||
2146 | static Qt::DropAction lastAcceptedDropAction = Qt::IgnoreAction; | - | ||||||||||||||||||||||||||||||||||||
2147 | QPlatformDrag *platformDrag = platformIntegration()->drag(); | - | ||||||||||||||||||||||||||||||||||||
2148 | if (!platformDrag
| 0 | ||||||||||||||||||||||||||||||||||||
2149 | lastAcceptedDropAction = Qt::IgnoreAction; | - | ||||||||||||||||||||||||||||||||||||
2150 | return never executed: QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect()); never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect()); | 0 | ||||||||||||||||||||||||||||||||||||
2151 | } | - | ||||||||||||||||||||||||||||||||||||
2152 | - | |||||||||||||||||||||||||||||||||||||
2153 | if (!dropData
| 0 | ||||||||||||||||||||||||||||||||||||
2154 | if (currentDragWindow.data() == w
| 0 | ||||||||||||||||||||||||||||||||||||
2155 | currentDragWindow = 0; never executed: currentDragWindow = 0; | 0 | ||||||||||||||||||||||||||||||||||||
2156 | QDragLeaveEvent e; | - | ||||||||||||||||||||||||||||||||||||
2157 | QGuiApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||||||||||||||
2158 | lastAcceptedDropAction = Qt::IgnoreAction; | - | ||||||||||||||||||||||||||||||||||||
2159 | return never executed: QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect()); never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect()); | 0 | ||||||||||||||||||||||||||||||||||||
2160 | } | - | ||||||||||||||||||||||||||||||||||||
2161 | QDragMoveEvent me(p, supportedActions, dropData, | - | ||||||||||||||||||||||||||||||||||||
2162 | QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||||||||||||||
2163 | - | |||||||||||||||||||||||||||||||||||||
2164 | if (w != currentDragWindow
| 0 | ||||||||||||||||||||||||||||||||||||
2165 | lastAcceptedDropAction = Qt::IgnoreAction; | - | ||||||||||||||||||||||||||||||||||||
2166 | if (currentDragWindow
| 0 | ||||||||||||||||||||||||||||||||||||
2167 | QDragLeaveEvent e; | - | ||||||||||||||||||||||||||||||||||||
2168 | QGuiApplication::sendEvent(currentDragWindow, &e); | - | ||||||||||||||||||||||||||||||||||||
2169 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2170 | currentDragWindow = w; | - | ||||||||||||||||||||||||||||||||||||
2171 | QDragEnterEvent e(p, supportedActions, dropData, | - | ||||||||||||||||||||||||||||||||||||
2172 | QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||||||||||||||
2173 | QGuiApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||||||||||||||
2174 | if (e.isAccepted()
| 0 | ||||||||||||||||||||||||||||||||||||
2175 | lastAcceptedDropAction = e.dropAction(); never executed: lastAcceptedDropAction = e.dropAction(); | 0 | ||||||||||||||||||||||||||||||||||||
2176 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2177 | - | |||||||||||||||||||||||||||||||||||||
2178 | - | |||||||||||||||||||||||||||||||||||||
2179 | if (lastAcceptedDropAction != Qt::IgnoreAction
| 0 | ||||||||||||||||||||||||||||||||||||
2180 | && (
| 0 | ||||||||||||||||||||||||||||||||||||
2181 | me.setDropAction(lastAcceptedDropAction); | - | ||||||||||||||||||||||||||||||||||||
2182 | me.accept(); | - | ||||||||||||||||||||||||||||||||||||
2183 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2184 | QGuiApplication::sendEvent(w, &me); | - | ||||||||||||||||||||||||||||||||||||
2185 | lastAcceptedDropAction = me.isAccepted()
| 0 | ||||||||||||||||||||||||||||||||||||
2186 | me.dropAction() : Qt::IgnoreAction; | - | ||||||||||||||||||||||||||||||||||||
2187 | return never executed: QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect()); never executed: return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect()); | 0 | ||||||||||||||||||||||||||||||||||||
2188 | } | - | ||||||||||||||||||||||||||||||||||||
2189 | - | |||||||||||||||||||||||||||||||||||||
2190 | QPlatformDropQtResponse QGuiApplicationPrivate::processDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) | - | ||||||||||||||||||||||||||||||||||||
2191 | { | - | ||||||||||||||||||||||||||||||||||||
2192 | QDropEvent de(p, supportedActions, dropData, | - | ||||||||||||||||||||||||||||||||||||
2193 | QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||||||||||||||
2194 | QGuiApplication::sendEvent(w, &de); | - | ||||||||||||||||||||||||||||||||||||
2195 | - | |||||||||||||||||||||||||||||||||||||
2196 | Qt::DropAction acceptedAction = de.isAccepted()
| 0 | ||||||||||||||||||||||||||||||||||||
2197 | QPlatformDropQtResponse response(de.isAccepted(),acceptedAction); | - | ||||||||||||||||||||||||||||||||||||
2198 | return never executed: response;return response; never executed: return response; | 0 | ||||||||||||||||||||||||||||||||||||
2199 | } | - | ||||||||||||||||||||||||||||||||||||
2200 | - | |||||||||||||||||||||||||||||||||||||
2201 | - | |||||||||||||||||||||||||||||||||||||
2202 | - | |||||||||||||||||||||||||||||||||||||
2203 | - | |||||||||||||||||||||||||||||||||||||
2204 | - | |||||||||||||||||||||||||||||||||||||
2205 | - | |||||||||||||||||||||||||||||||||||||
2206 | - | |||||||||||||||||||||||||||||||||||||
2207 | QClipboard * QGuiApplication::clipboard() | - | ||||||||||||||||||||||||||||||||||||
2208 | { | - | ||||||||||||||||||||||||||||||||||||
2209 | if (QGuiApplicationPrivate::qt_clipboard == 0
| 0 | ||||||||||||||||||||||||||||||||||||
2210 | if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))
| 0 | ||||||||||||||||||||||||||||||||||||
2211 | QMessageLogger(__FILE__, 2824, __PRETTY_FUNCTION__).warning("QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard"); | - | ||||||||||||||||||||||||||||||||||||
2212 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
2213 | } | - | ||||||||||||||||||||||||||||||||||||
2214 | QGuiApplicationPrivate::qt_clipboard = new QClipboard(0); | - | ||||||||||||||||||||||||||||||||||||
2215 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2216 | return never executed: QGuiApplicationPrivate::qt_clipboard;return QGuiApplicationPrivate::qt_clipboard; never executed: return QGuiApplicationPrivate::qt_clipboard; | 0 | ||||||||||||||||||||||||||||||||||||
2217 | } | - | ||||||||||||||||||||||||||||||||||||
2218 | QPalette QGuiApplication::palette() | - | ||||||||||||||||||||||||||||||||||||
2219 | { | - | ||||||||||||||||||||||||||||||||||||
2220 | initPalette(); | - | ||||||||||||||||||||||||||||||||||||
2221 | return never executed: *QGuiApplicationPrivate::app_pal;return *QGuiApplicationPrivate::app_pal; never executed: return *QGuiApplicationPrivate::app_pal; | 0 | ||||||||||||||||||||||||||||||||||||
2222 | } | - | ||||||||||||||||||||||||||||||||||||
2223 | - | |||||||||||||||||||||||||||||||||||||
2224 | - | |||||||||||||||||||||||||||||||||||||
2225 | - | |||||||||||||||||||||||||||||||||||||
2226 | - | |||||||||||||||||||||||||||||||||||||
2227 | - | |||||||||||||||||||||||||||||||||||||
2228 | - | |||||||||||||||||||||||||||||||||||||
2229 | void QGuiApplication::setPalette(const QPalette &pal) | - | ||||||||||||||||||||||||||||||||||||
2230 | { | - | ||||||||||||||||||||||||||||||||||||
2231 | if (QGuiApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||||||||||||||
2232 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2233 | if (!QGuiApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||||||||||||||
2234 | QGuiApplicationPrivate::app_pal = new QPalette(pal); never executed: QGuiApplicationPrivate::app_pal = new QPalette(pal); | 0 | ||||||||||||||||||||||||||||||||||||
2235 | else | - | ||||||||||||||||||||||||||||||||||||
2236 | * never executed: QGuiApplicationPrivate::app_pal = pal;*QGuiApplicationPrivate::app_pal = pal; never executed: *QGuiApplicationPrivate::app_pal = pal; | 0 | ||||||||||||||||||||||||||||||||||||
2237 | applicationResourceFlags |= ApplicationPaletteExplicitlySet; | - | ||||||||||||||||||||||||||||||||||||
2238 | QCoreApplication::setAttribute(Qt::AA_SetPalette); | - | ||||||||||||||||||||||||||||||||||||
2239 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->paletteChanged(*QGuiApplicationPrivate::app_pal); | - | ||||||||||||||||||||||||||||||||||||
2240 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2241 | - | |||||||||||||||||||||||||||||||||||||
2242 | void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window) | - | ||||||||||||||||||||||||||||||||||||
2243 | { | - | ||||||||||||||||||||||||||||||||||||
2244 | windowGeometrySpecification.applyTo(window); | - | ||||||||||||||||||||||||||||||||||||
2245 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2246 | - | |||||||||||||||||||||||||||||||||||||
2247 | - | |||||||||||||||||||||||||||||||||||||
2248 | - | |||||||||||||||||||||||||||||||||||||
2249 | - | |||||||||||||||||||||||||||||||||||||
2250 | - | |||||||||||||||||||||||||||||||||||||
2251 | - | |||||||||||||||||||||||||||||||||||||
2252 | QFont QGuiApplication::font() | - | ||||||||||||||||||||||||||||||||||||
2253 | { | - | ||||||||||||||||||||||||||||||||||||
2254 | ((!(QGuiApplicationPrivate::self)) ? qt_assert_x("QGuiApplication::font()", "no QGuiApplication instance",__FILE__,2884) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
2255 | QMutexLocker locker(&applicationFontMutex); | - | ||||||||||||||||||||||||||||||||||||
2256 | initFontUnlocked(); | - | ||||||||||||||||||||||||||||||||||||
2257 | return never executed: *QGuiApplicationPrivate::app_font;return *QGuiApplicationPrivate::app_font; never executed: return *QGuiApplicationPrivate::app_font; | 0 | ||||||||||||||||||||||||||||||||||||
2258 | } | - | ||||||||||||||||||||||||||||||||||||
2259 | - | |||||||||||||||||||||||||||||||||||||
2260 | - | |||||||||||||||||||||||||||||||||||||
2261 | - | |||||||||||||||||||||||||||||||||||||
2262 | - | |||||||||||||||||||||||||||||||||||||
2263 | - | |||||||||||||||||||||||||||||||||||||
2264 | - | |||||||||||||||||||||||||||||||||||||
2265 | void QGuiApplication::setFont(const QFont &font) | - | ||||||||||||||||||||||||||||||||||||
2266 | { | - | ||||||||||||||||||||||||||||||||||||
2267 | QMutexLocker locker(&applicationFontMutex); | - | ||||||||||||||||||||||||||||||||||||
2268 | if (!QGuiApplicationPrivate::app_font
| 0 | ||||||||||||||||||||||||||||||||||||
2269 | QGuiApplicationPrivate::app_font = new QFont(font); never executed: QGuiApplicationPrivate::app_font = new QFont(font); | 0 | ||||||||||||||||||||||||||||||||||||
2270 | else | - | ||||||||||||||||||||||||||||||||||||
2271 | * never executed: QGuiApplicationPrivate::app_font = font;*QGuiApplicationPrivate::app_font = font; never executed: *QGuiApplicationPrivate::app_font = font; | 0 | ||||||||||||||||||||||||||||||||||||
2272 | applicationResourceFlags |= ApplicationFontExplicitlySet; | - | ||||||||||||||||||||||||||||||||||||
2273 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2274 | void QGuiApplicationPrivate::notifyLayoutDirectionChange() | - | ||||||||||||||||||||||||||||||||||||
2275 | { | - | ||||||||||||||||||||||||||||||||||||
2276 | const QWindowList list = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
2277 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2278 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - | ||||||||||||||||||||||||||||||||||||
2279 | QCoreApplication::sendEvent(list.at(i), &ev); | - | ||||||||||||||||||||||||||||||||||||
2280 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2281 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2282 | - | |||||||||||||||||||||||||||||||||||||
2283 | void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) | - | ||||||||||||||||||||||||||||||||||||
2284 | { | - | ||||||||||||||||||||||||||||||||||||
2285 | } | - | ||||||||||||||||||||||||||||||||||||
2286 | - | |||||||||||||||||||||||||||||||||||||
2287 | - | |||||||||||||||||||||||||||||||||||||
2288 | - | |||||||||||||||||||||||||||||||||||||
2289 | - | |||||||||||||||||||||||||||||||||||||
2290 | - | |||||||||||||||||||||||||||||||||||||
2291 | - | |||||||||||||||||||||||||||||||||||||
2292 | - | |||||||||||||||||||||||||||||||||||||
2293 | QIcon QGuiApplication::windowIcon() | - | ||||||||||||||||||||||||||||||||||||
2294 | { | - | ||||||||||||||||||||||||||||||||||||
2295 | return never executed: QGuiApplicationPrivate::app_iconreturn QGuiApplicationPrivate::app_icon ? *QGuiApplicationPrivate::app_icon : QIcon();
never executed: return QGuiApplicationPrivate::app_icon ? *QGuiApplicationPrivate::app_icon : QIcon(); | 0 | ||||||||||||||||||||||||||||||||||||
2296 | } | - | ||||||||||||||||||||||||||||||||||||
2297 | - | |||||||||||||||||||||||||||||||||||||
2298 | void QGuiApplication::setWindowIcon(const QIcon &icon) | - | ||||||||||||||||||||||||||||||||||||
2299 | { | - | ||||||||||||||||||||||||||||||||||||
2300 | if (!QGuiApplicationPrivate::app_icon
| 0 | ||||||||||||||||||||||||||||||||||||
2301 | QGuiApplicationPrivate::app_icon = new QIcon(); never executed: QGuiApplicationPrivate::app_icon = new QIcon(); | 0 | ||||||||||||||||||||||||||||||||||||
2302 | *QGuiApplicationPrivate::app_icon = icon; | - | ||||||||||||||||||||||||||||||||||||
2303 | if (QGuiApplicationPrivate::platform_integration
| 0 | ||||||||||||||||||||||||||||||||||||
2304 | && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ApplicationIcon)
| 0 | ||||||||||||||||||||||||||||||||||||
2305 | QGuiApplicationPrivate::platform_integration->setApplicationIcon(icon); never executed: QGuiApplicationPrivate::platform_integration->setApplicationIcon(icon); | 0 | ||||||||||||||||||||||||||||||||||||
2306 | if (QGuiApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||||||||||||||
2307 | QGuiApplicationPrivate::self->notifyWindowIconChanged(); never executed: QGuiApplicationPrivate::self->notifyWindowIconChanged(); | 0 | ||||||||||||||||||||||||||||||||||||
2308 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2309 | - | |||||||||||||||||||||||||||||||||||||
2310 | void QGuiApplicationPrivate::notifyWindowIconChanged() | - | ||||||||||||||||||||||||||||||||||||
2311 | { | - | ||||||||||||||||||||||||||||||||||||
2312 | QEvent ev(QEvent::ApplicationWindowIconChange); | - | ||||||||||||||||||||||||||||||||||||
2313 | const QWindowList list = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
2314 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2315 | QCoreApplication::sendEvent(list.at(i), &ev); never executed: QCoreApplication::sendEvent(list.at(i), &ev); | 0 | ||||||||||||||||||||||||||||||||||||
2316 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2317 | void QGuiApplication::setQuitOnLastWindowClosed(bool quit) | - | ||||||||||||||||||||||||||||||||||||
2318 | { | - | ||||||||||||||||||||||||||||||||||||
2319 | QCoreApplication::setQuitLockEnabled(quit); | - | ||||||||||||||||||||||||||||||||||||
2320 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2321 | - | |||||||||||||||||||||||||||||||||||||
2322 | - | |||||||||||||||||||||||||||||||||||||
2323 | - | |||||||||||||||||||||||||||||||||||||
2324 | bool QGuiApplication::quitOnLastWindowClosed() | - | ||||||||||||||||||||||||||||||||||||
2325 | { | - | ||||||||||||||||||||||||||||||||||||
2326 | return never executed: QCoreApplication::isQuitLockEnabled();return QCoreApplication::isQuitLockEnabled(); never executed: return QCoreApplication::isQuitLockEnabled(); | 0 | ||||||||||||||||||||||||||||||||||||
2327 | } | - | ||||||||||||||||||||||||||||||||||||
2328 | void QGuiApplicationPrivate::emitLastWindowClosed() | - | ||||||||||||||||||||||||||||||||||||
2329 | { | - | ||||||||||||||||||||||||||||||||||||
2330 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
2331 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->lastWindowClosed(); | - | ||||||||||||||||||||||||||||||||||||
2332 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2333 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2334 | - | |||||||||||||||||||||||||||||||||||||
2335 | bool QGuiApplicationPrivate::shouldQuit() | - | ||||||||||||||||||||||||||||||||||||
2336 | { | - | ||||||||||||||||||||||||||||||||||||
2337 | const QWindowList processedWindows; | - | ||||||||||||||||||||||||||||||||||||
2338 | return never executed: shouldQuitInternal(processedWindows);return shouldQuitInternal(processedWindows); never executed: return shouldQuitInternal(processedWindows); | 0 | ||||||||||||||||||||||||||||||||||||
2339 | } | - | ||||||||||||||||||||||||||||||||||||
2340 | - | |||||||||||||||||||||||||||||||||||||
2341 | bool QGuiApplicationPrivate::shouldQuitInternal(const QWindowList &processedWindows) | - | ||||||||||||||||||||||||||||||||||||
2342 | { | - | ||||||||||||||||||||||||||||||||||||
2343 | - | |||||||||||||||||||||||||||||||||||||
2344 | QWindowList list = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
2345 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2346 | QWindow *w = list.at(i); | - | ||||||||||||||||||||||||||||||||||||
2347 | if (processedWindows.contains(w)
| 0 | ||||||||||||||||||||||||||||||||||||
2348 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
2349 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
2350 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
2351 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2352 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
2353 | } | - | ||||||||||||||||||||||||||||||||||||
2354 | - | |||||||||||||||||||||||||||||||||||||
2355 | bool QGuiApplicationPrivate::tryCloseAllWindows() | - | ||||||||||||||||||||||||||||||||||||
2356 | { | - | ||||||||||||||||||||||||||||||||||||
2357 | return never executed: tryCloseRemainingWindows(QWindowList());return tryCloseRemainingWindows(QWindowList()); never executed: return tryCloseRemainingWindows(QWindowList()); | 0 | ||||||||||||||||||||||||||||||||||||
2358 | } | - | ||||||||||||||||||||||||||||||||||||
2359 | - | |||||||||||||||||||||||||||||||||||||
2360 | bool QGuiApplicationPrivate::tryCloseRemainingWindows(QWindowList processedWindows) | - | ||||||||||||||||||||||||||||||||||||
2361 | { | - | ||||||||||||||||||||||||||||||||||||
2362 | QWindowList list = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
2363 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2364 | QWindow *w = list.at(i); | - | ||||||||||||||||||||||||||||||||||||
2365 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
2366 | if (!w->close()
| 0 | ||||||||||||||||||||||||||||||||||||
2367 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
2368 | processedWindows.append(w); | - | ||||||||||||||||||||||||||||||||||||
2369 | list = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||||||||||||||
2370 | i = -1; | - | ||||||||||||||||||||||||||||||||||||
2371 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2372 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2373 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
2374 | } | - | ||||||||||||||||||||||||||||||||||||
2375 | Qt::ApplicationState QGuiApplication::applicationState() | - | ||||||||||||||||||||||||||||||||||||
2376 | { | - | ||||||||||||||||||||||||||||||||||||
2377 | return never executed: QGuiApplicationPrivate::applicationState;return QGuiApplicationPrivate::applicationState; never executed: return QGuiApplicationPrivate::applicationState; | 0 | ||||||||||||||||||||||||||||||||||||
2378 | } | - | ||||||||||||||||||||||||||||||||||||
2379 | void QGuiApplicationPrivate::setApplicationState(Qt::ApplicationState state, bool forcePropagate) | - | ||||||||||||||||||||||||||||||||||||
2380 | { | - | ||||||||||||||||||||||||||||||||||||
2381 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
2382 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2383 | - | |||||||||||||||||||||||||||||||||||||
2384 | applicationState = state; | - | ||||||||||||||||||||||||||||||||||||
2385 | - | |||||||||||||||||||||||||||||||||||||
2386 | switch (state) { | - | ||||||||||||||||||||||||||||||||||||
2387 | case never executed: Qt::ApplicationActive:case Qt::ApplicationActive: never executed: {case Qt::ApplicationActive: | 0 | ||||||||||||||||||||||||||||||||||||
2388 | QEvent appActivate(QEvent::ApplicationActivate); | - | ||||||||||||||||||||||||||||||||||||
2389 | QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate); | - | ||||||||||||||||||||||||||||||||||||
2390 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
2391 | case never executed: Qt::ApplicationInactive:case Qt::ApplicationInactive: never executed: {case Qt::ApplicationInactive: | 0 | ||||||||||||||||||||||||||||||||||||
2392 | QEvent appDeactivate(QEvent::ApplicationDeactivate); | - | ||||||||||||||||||||||||||||||||||||
2393 | QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appDeactivate); | - | ||||||||||||||||||||||||||||||||||||
2394 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
2395 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
2396 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
2397 | } | - | ||||||||||||||||||||||||||||||||||||
2398 | - | |||||||||||||||||||||||||||||||||||||
2399 | QApplicationStateChangeEvent event(applicationState); | - | ||||||||||||||||||||||||||||||||||||
2400 | QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event); | - | ||||||||||||||||||||||||||||||||||||
2401 | - | |||||||||||||||||||||||||||||||||||||
2402 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->applicationStateChanged(applicationState); | - | ||||||||||||||||||||||||||||||||||||
2403 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2404 | bool QGuiApplication::isFallbackSessionManagementEnabled() | - | ||||||||||||||||||||||||||||||||||||
2405 | { | - | ||||||||||||||||||||||||||||||||||||
2406 | return never executed: QGuiApplicationPrivate::is_fallback_session_management_enabled;return QGuiApplicationPrivate::is_fallback_session_management_enabled; never executed: return QGuiApplicationPrivate::is_fallback_session_management_enabled; | 0 | ||||||||||||||||||||||||||||||||||||
2407 | } | - | ||||||||||||||||||||||||||||||||||||
2408 | void QGuiApplication::setFallbackSessionManagementEnabled(bool enabled) | - | ||||||||||||||||||||||||||||||||||||
2409 | { | - | ||||||||||||||||||||||||||||||||||||
2410 | QGuiApplicationPrivate::is_fallback_session_management_enabled = enabled; | - | ||||||||||||||||||||||||||||||||||||
2411 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2412 | bool QGuiApplication::isSessionRestored() const | - | ||||||||||||||||||||||||||||||||||||
2413 | { | - | ||||||||||||||||||||||||||||||||||||
2414 | const QGuiApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
2415 | return never executed: d->is_session_restored;return d->is_session_restored; never executed: return d->is_session_restored; | 0 | ||||||||||||||||||||||||||||||||||||
2416 | } | - | ||||||||||||||||||||||||||||||||||||
2417 | - | |||||||||||||||||||||||||||||||||||||
2418 | QString QGuiApplication::sessionId() const | - | ||||||||||||||||||||||||||||||||||||
2419 | { | - | ||||||||||||||||||||||||||||||||||||
2420 | const QGuiApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
2421 | return never executed: d->session_manager->sessionId();return d->session_manager->sessionId(); never executed: return d->session_manager->sessionId(); | 0 | ||||||||||||||||||||||||||||||||||||
2422 | } | - | ||||||||||||||||||||||||||||||||||||
2423 | - | |||||||||||||||||||||||||||||||||||||
2424 | QString QGuiApplication::sessionKey() const | - | ||||||||||||||||||||||||||||||||||||
2425 | { | - | ||||||||||||||||||||||||||||||||||||
2426 | const QGuiApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
2427 | return never executed: d->session_manager->sessionKey();return d->session_manager->sessionKey(); never executed: return d->session_manager->sessionKey(); | 0 | ||||||||||||||||||||||||||||||||||||
2428 | } | - | ||||||||||||||||||||||||||||||||||||
2429 | - | |||||||||||||||||||||||||||||||||||||
2430 | bool QGuiApplication::isSavingSession() const | - | ||||||||||||||||||||||||||||||||||||
2431 | { | - | ||||||||||||||||||||||||||||||||||||
2432 | const QGuiApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
2433 | return never executed: d->is_saving_session;return d->is_saving_session; never executed: return d->is_saving_session; | 0 | ||||||||||||||||||||||||||||||||||||
2434 | } | - | ||||||||||||||||||||||||||||||||||||
2435 | - | |||||||||||||||||||||||||||||||||||||
2436 | void QGuiApplicationPrivate::commitData() | - | ||||||||||||||||||||||||||||||||||||
2437 | { | - | ||||||||||||||||||||||||||||||||||||
2438 | QGuiApplication * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
2439 | is_saving_session = true; | - | ||||||||||||||||||||||||||||||||||||
2440 | - | |||||||||||||||||||||||||||||||||||||
2441 | q->commitDataRequest(*session_manager); | - | ||||||||||||||||||||||||||||||||||||
2442 | if (is_fallback_session_management_enabled
| 0 | ||||||||||||||||||||||||||||||||||||
2443 | && !tryCloseAllWindows()
| 0 | ||||||||||||||||||||||||||||||||||||
2444 | session_manager->cancel(); | - | ||||||||||||||||||||||||||||||||||||
2445 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2446 | - | |||||||||||||||||||||||||||||||||||||
2447 | is_saving_session = false; | - | ||||||||||||||||||||||||||||||||||||
2448 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2449 | - | |||||||||||||||||||||||||||||||||||||
2450 | - | |||||||||||||||||||||||||||||||||||||
2451 | void QGuiApplicationPrivate::saveState() | - | ||||||||||||||||||||||||||||||||||||
2452 | { | - | ||||||||||||||||||||||||||||||||||||
2453 | QGuiApplication * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
2454 | is_saving_session = true; | - | ||||||||||||||||||||||||||||||||||||
2455 | q->saveStateRequest(*session_manager); | - | ||||||||||||||||||||||||||||||||||||
2456 | is_saving_session = false; | - | ||||||||||||||||||||||||||||||||||||
2457 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2458 | void QGuiApplication::sync() | - | ||||||||||||||||||||||||||||||||||||
2459 | { | - | ||||||||||||||||||||||||||||||||||||
2460 | QCoreApplication::processEvents(); | - | ||||||||||||||||||||||||||||||||||||
2461 | if (QGuiApplicationPrivate::platform_integration
| 0 | ||||||||||||||||||||||||||||||||||||
2462 | && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)
| 0 | ||||||||||||||||||||||||||||||||||||
2463 | QGuiApplicationPrivate::platform_integration->sync(); | - | ||||||||||||||||||||||||||||||||||||
2464 | QCoreApplication::processEvents(); | - | ||||||||||||||||||||||||||||||||||||
2465 | QWindowSystemInterface::flushWindowSystemEvents(); | - | ||||||||||||||||||||||||||||||||||||
2466 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2467 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2468 | void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction) | - | ||||||||||||||||||||||||||||||||||||
2469 | { | - | ||||||||||||||||||||||||||||||||||||
2470 | if (layout_direction == direction
| 0 | ||||||||||||||||||||||||||||||||||||
2471 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2472 | - | |||||||||||||||||||||||||||||||||||||
2473 | layout_direction = direction; | - | ||||||||||||||||||||||||||||||||||||
2474 | - | |||||||||||||||||||||||||||||||||||||
2475 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
2476 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->layoutDirectionChanged(direction); | - | ||||||||||||||||||||||||||||||||||||
2477 | QGuiApplicationPrivate::self->notifyLayoutDirectionChange(); | - | ||||||||||||||||||||||||||||||||||||
2478 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2479 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2480 | - | |||||||||||||||||||||||||||||||||||||
2481 | Qt::LayoutDirection QGuiApplication::layoutDirection() | - | ||||||||||||||||||||||||||||||||||||
2482 | { | - | ||||||||||||||||||||||||||||||||||||
2483 | - | |||||||||||||||||||||||||||||||||||||
2484 | - | |||||||||||||||||||||||||||||||||||||
2485 | - | |||||||||||||||||||||||||||||||||||||
2486 | return never executed: layout_direction == Qt::LayoutDirectionAutoreturn layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
never executed: return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction; | 0 | ||||||||||||||||||||||||||||||||||||
2487 | } | - | ||||||||||||||||||||||||||||||||||||
2488 | QCursor *QGuiApplication::overrideCursor() | - | ||||||||||||||||||||||||||||||||||||
2489 | { | - | ||||||||||||||||||||||||||||||||||||
2490 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 3380, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: nullptr;return nullptr; never executed: }return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
2491 | return never executed: (static_cast<return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first();
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first(); | 0 | ||||||||||||||||||||||||||||||||||||
2492 | } | - | ||||||||||||||||||||||||||||||||||||
2493 | void QGuiApplication::changeOverrideCursor(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||||||||
2494 | { | - | ||||||||||||||||||||||||||||||||||||
2495 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 3394, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: ;return ; never executed: }return ; | 0 | ||||||||||||||||||||||||||||||||||||
2496 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
2497 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2498 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst(); | - | ||||||||||||||||||||||||||||||||||||
2499 | setOverrideCursor(cursor); | - | ||||||||||||||||||||||||||||||||||||
2500 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2501 | - | |||||||||||||||||||||||||||||||||||||
2502 | - | |||||||||||||||||||||||||||||||||||||
2503 | - | |||||||||||||||||||||||||||||||||||||
2504 | - | |||||||||||||||||||||||||||||||||||||
2505 | static inline void applyCursor(QWindow *w, QCursor c) | - | ||||||||||||||||||||||||||||||||||||
2506 | { | - | ||||||||||||||||||||||||||||||||||||
2507 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
2508 | if (QPlatformCursor *cursor = screen->handle()->cursor()
| 0 | ||||||||||||||||||||||||||||||||||||
2509 | cursor->changeCursor(&c, w); never executed: cursor->changeCursor(&c, w); | 0 | ||||||||||||||||||||||||||||||||||||
2510 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2511 | - | |||||||||||||||||||||||||||||||||||||
2512 | static inline void unsetCursor(QWindow *w) | - | ||||||||||||||||||||||||||||||||||||
2513 | { | - | ||||||||||||||||||||||||||||||||||||
2514 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
2515 | if (QPlatformCursor *cursor = screen->handle()->cursor()
| 0 | ||||||||||||||||||||||||||||||||||||
2516 | cursor->changeCursor(0, w); never executed: cursor->changeCursor(0, w); | 0 | ||||||||||||||||||||||||||||||||||||
2517 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2518 | - | |||||||||||||||||||||||||||||||||||||
2519 | static inline void applyCursor(const QList<QWindow *> &l, const QCursor &c) | - | ||||||||||||||||||||||||||||||||||||
2520 | { | - | ||||||||||||||||||||||||||||||||||||
2521 | for (int i = 0; i < l.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2522 | QWindow *w = l.at(i); | - | ||||||||||||||||||||||||||||||||||||
2523 | if (w->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
2524 | applyCursor(w, c); never executed: applyCursor(w, c); | 0 | ||||||||||||||||||||||||||||||||||||
2525 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2526 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2527 | - | |||||||||||||||||||||||||||||||||||||
2528 | static inline void applyWindowCursor(const QList<QWindow *> &l) | - | ||||||||||||||||||||||||||||||||||||
2529 | { | - | ||||||||||||||||||||||||||||||||||||
2530 | for (int i = 0; i < l.size()
| 0 | ||||||||||||||||||||||||||||||||||||
2531 | QWindow *w = l.at(i); | - | ||||||||||||||||||||||||||||||||||||
2532 | if (w->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
2533 | if (qt_window_private(w)->hasCursor
| 0 | ||||||||||||||||||||||||||||||||||||
2534 | applyCursor(w, w->cursor()); | - | ||||||||||||||||||||||||||||||||||||
2535 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
2536 | unsetCursor(w); | - | ||||||||||||||||||||||||||||||||||||
2537 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2538 | } | - | ||||||||||||||||||||||||||||||||||||
2539 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2540 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2541 | void QGuiApplication::setOverrideCursor(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||||||||
2542 | { | - | ||||||||||||||||||||||||||||||||||||
2543 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 3469, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: ;return ; never executed: }return ; | 0 | ||||||||||||||||||||||||||||||||||||
2544 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.prepend(cursor); | - | ||||||||||||||||||||||||||||||||||||
2545 | applyCursor(QGuiApplicationPrivate::window_list, cursor); | - | ||||||||||||||||||||||||||||||||||||
2546 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2547 | void QGuiApplication::restoreOverrideCursor() | - | ||||||||||||||||||||||||||||||||||||
2548 | { | - | ||||||||||||||||||||||||||||||||||||
2549 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 3487, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: ;return ; never executed: }return ; | 0 | ||||||||||||||||||||||||||||||||||||
2550 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
2551 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
2552 | (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst(); | - | ||||||||||||||||||||||||||||||||||||
2553 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
2554 | QCursor c((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.value(0)); | - | ||||||||||||||||||||||||||||||||||||
2555 | applyCursor(QGuiApplicationPrivate::window_list, c); | - | ||||||||||||||||||||||||||||||||||||
2556 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
2557 | applyWindowCursor(QGuiApplicationPrivate::window_list); | - | ||||||||||||||||||||||||||||||||||||
2558 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2559 | } | - | ||||||||||||||||||||||||||||||||||||
2560 | QStyleHints *QGuiApplication::styleHints() | - | ||||||||||||||||||||||||||||||||||||
2561 | { | - | ||||||||||||||||||||||||||||||||||||
2562 | if (!QGuiApplicationPrivate::styleHints
| 0 | ||||||||||||||||||||||||||||||||||||
2563 | QGuiApplicationPrivate::styleHints = new QStyleHints(); never executed: QGuiApplicationPrivate::styleHints = new QStyleHints(); | 0 | ||||||||||||||||||||||||||||||||||||
2564 | return never executed: QGuiApplicationPrivate::styleHints;return QGuiApplicationPrivate::styleHints; never executed: return QGuiApplicationPrivate::styleHints; | 0 | ||||||||||||||||||||||||||||||||||||
2565 | } | - | ||||||||||||||||||||||||||||||||||||
2566 | void QGuiApplication::setDesktopSettingsAware(bool on) | - | ||||||||||||||||||||||||||||||||||||
2567 | { | - | ||||||||||||||||||||||||||||||||||||
2568 | QGuiApplicationPrivate::obey_desktop_settings = on; | - | ||||||||||||||||||||||||||||||||||||
2569 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2570 | - | |||||||||||||||||||||||||||||||||||||
2571 | - | |||||||||||||||||||||||||||||||||||||
2572 | - | |||||||||||||||||||||||||||||||||||||
2573 | - | |||||||||||||||||||||||||||||||||||||
2574 | - | |||||||||||||||||||||||||||||||||||||
2575 | - | |||||||||||||||||||||||||||||||||||||
2576 | - | |||||||||||||||||||||||||||||||||||||
2577 | bool QGuiApplication::desktopSettingsAware() | - | ||||||||||||||||||||||||||||||||||||
2578 | { | - | ||||||||||||||||||||||||||||||||||||
2579 | return never executed: QGuiApplicationPrivate::obey_desktop_settings;return QGuiApplicationPrivate::obey_desktop_settings; never executed: return QGuiApplicationPrivate::obey_desktop_settings; | 0 | ||||||||||||||||||||||||||||||||||||
2580 | } | - | ||||||||||||||||||||||||||||||||||||
2581 | QInputMethod *QGuiApplication::inputMethod() | - | ||||||||||||||||||||||||||||||||||||
2582 | { | - | ||||||||||||||||||||||||||||||||||||
2583 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 3555, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); returnend of block never executed: nullptr;return nullptr; never executed: }return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
2584 | if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod
| 0 | ||||||||||||||||||||||||||||||||||||
2585 | (static_cast< never executed: QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod(); never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod(); | 0 | ||||||||||||||||||||||||||||||||||||
2586 | return never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod; never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod; | 0 | ||||||||||||||||||||||||||||||||||||
2587 | } | - | ||||||||||||||||||||||||||||||||||||
2588 | QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) | - | ||||||||||||||||||||||||||||||||||||
2589 | { | - | ||||||||||||||||||||||||||||||||||||
2590 | (void)cshape;; | - | ||||||||||||||||||||||||||||||||||||
2591 | return never executed: QPixmap();return QPixmap(); never executed: return QPixmap(); | 0 | ||||||||||||||||||||||||||||||||||||
2592 | } | - | ||||||||||||||||||||||||||||||||||||
2593 | - | |||||||||||||||||||||||||||||||||||||
2594 | void QGuiApplicationPrivate::notifyThemeChanged() | - | ||||||||||||||||||||||||||||||||||||
2595 | { | - | ||||||||||||||||||||||||||||||||||||
2596 | if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)
| 0 | ||||||||||||||||||||||||||||||||||||
2597 | !QCoreApplication::testAttribute(Qt::AA_SetPalette)
| 0 | ||||||||||||||||||||||||||||||||||||
2598 | clearPalette(); | - | ||||||||||||||||||||||||||||||||||||
2599 | initPalette(); | - | ||||||||||||||||||||||||||||||||||||
2600 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2601 | if (!(applicationResourceFlags & ApplicationFontExplicitlySet)
| 0 | ||||||||||||||||||||||||||||||||||||
2602 | QMutexLocker locker(&applicationFontMutex); | - | ||||||||||||||||||||||||||||||||||||
2603 | clearFontUnlocked(); | - | ||||||||||||||||||||||||||||||||||||
2604 | initFontUnlocked(); | - | ||||||||||||||||||||||||||||||||||||
2605 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2606 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2607 | - | |||||||||||||||||||||||||||||||||||||
2608 | - | |||||||||||||||||||||||||||||||||||||
2609 | void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) | - | ||||||||||||||||||||||||||||||||||||
2610 | { | - | ||||||||||||||||||||||||||||||||||||
2611 | (void)drag; | - | ||||||||||||||||||||||||||||||||||||
2612 | - | |||||||||||||||||||||||||||||||||||||
2613 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2614 | - | |||||||||||||||||||||||||||||||||||||
2615 | - | |||||||||||||||||||||||||||||||||||||
2616 | const QDrawHelperGammaTables *QGuiApplicationPrivate::gammaTables() | - | ||||||||||||||||||||||||||||||||||||
2617 | { | - | ||||||||||||||||||||||||||||||||||||
2618 | QDrawHelperGammaTables *result = m_gammaTables.load(); | - | ||||||||||||||||||||||||||||||||||||
2619 | if (!result
| 0 | ||||||||||||||||||||||||||||||||||||
2620 | QDrawHelperGammaTables *tables = new QDrawHelperGammaTables(fontSmoothingGamma); | - | ||||||||||||||||||||||||||||||||||||
2621 | if (!m_gammaTables.testAndSetRelease(0, tables)
| 0 | ||||||||||||||||||||||||||||||||||||
2622 | delete tables; never executed: delete tables; | 0 | ||||||||||||||||||||||||||||||||||||
2623 | result = m_gammaTables.load(); | - | ||||||||||||||||||||||||||||||||||||
2624 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2625 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||
2626 | } | - | ||||||||||||||||||||||||||||||||||||
2627 | - | |||||||||||||||||||||||||||||||||||||
2628 | void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object) | - | ||||||||||||||||||||||||||||||||||||
2629 | { | - | ||||||||||||||||||||||||||||||||||||
2630 | QGuiApplication * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
2631 | - | |||||||||||||||||||||||||||||||||||||
2632 | QPlatformInputContext *inputContext = platformIntegration()->inputContext(); | - | ||||||||||||||||||||||||||||||||||||
2633 | bool enabled = false; | - | ||||||||||||||||||||||||||||||||||||
2634 | if (object
| 0 | ||||||||||||||||||||||||||||||||||||
2635 | QInputMethodQueryEvent query(Qt::ImEnabled | Qt::ImHints); | - | ||||||||||||||||||||||||||||||||||||
2636 | QGuiApplication::sendEvent(object, &query); | - | ||||||||||||||||||||||||||||||||||||
2637 | enabled = query.value(Qt::ImEnabled).toBool(); | - | ||||||||||||||||||||||||||||||||||||
2638 | if (enabled
| 0 | ||||||||||||||||||||||||||||||||||||
2639 | static const bool supportsHiddenText = inputContext->hasCapability(QPlatformInputContext::HiddenTextCapability); | - | ||||||||||||||||||||||||||||||||||||
2640 | const Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(query.value(Qt::ImHints).toInt()); | - | ||||||||||||||||||||||||||||||||||||
2641 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
2642 | enabled = false; never executed: enabled = false; | 0 | ||||||||||||||||||||||||||||||||||||
2643 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2644 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2645 | - | |||||||||||||||||||||||||||||||||||||
2646 | QPlatformInputContextPrivate::setInputMethodAccepted(enabled); | - | ||||||||||||||||||||||||||||||||||||
2647 | if (inputContext
| 0 | ||||||||||||||||||||||||||||||||||||
2648 | inputContext->setFocusObject(object); never executed: inputContext->setFocusObject(object); | 0 | ||||||||||||||||||||||||||||||||||||
2649 | q->focusObjectChanged(object); | - | ||||||||||||||||||||||||||||||||||||
2650 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2651 | - | |||||||||||||||||||||||||||||||||||||
2652 | enum { | - | ||||||||||||||||||||||||||||||||||||
2653 | MouseCapsMask = 0xFF, | - | ||||||||||||||||||||||||||||||||||||
2654 | MouseSourceMaskDst = 0xFF00, | - | ||||||||||||||||||||||||||||||||||||
2655 | MouseSourceMaskSrc = MouseCapsMask, | - | ||||||||||||||||||||||||||||||||||||
2656 | MouseSourceShift = 8, | - | ||||||||||||||||||||||||||||||||||||
2657 | MouseFlagsCapsMask = 0xFF0000, | - | ||||||||||||||||||||||||||||||||||||
2658 | MouseFlagsShift = 16 | - | ||||||||||||||||||||||||||||||||||||
2659 | }; | - | ||||||||||||||||||||||||||||||||||||
2660 | - | |||||||||||||||||||||||||||||||||||||
2661 | int QGuiApplicationPrivate::mouseEventCaps(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
2662 | { | - | ||||||||||||||||||||||||||||||||||||
2663 | return never executed: event->caps & MouseCapsMask;return event->caps & MouseCapsMask; never executed: return event->caps & MouseCapsMask; | 0 | ||||||||||||||||||||||||||||||||||||
2664 | } | - | ||||||||||||||||||||||||||||||||||||
2665 | - | |||||||||||||||||||||||||||||||||||||
2666 | QVector2D QGuiApplicationPrivate::mouseEventVelocity(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
2667 | { | - | ||||||||||||||||||||||||||||||||||||
2668 | return never executed: event->velocity;return event->velocity; never executed: return event->velocity; | 0 | ||||||||||||||||||||||||||||||||||||
2669 | } | - | ||||||||||||||||||||||||||||||||||||
2670 | - | |||||||||||||||||||||||||||||||||||||
2671 | void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, int caps, const QVector2D &velocity) | - | ||||||||||||||||||||||||||||||||||||
2672 | { | - | ||||||||||||||||||||||||||||||||||||
2673 | ((!(caps <= MouseCapsMask)) ? qt_assert("caps <= MouseCapsMask",__FILE__,3657) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
2674 | event->caps &= ~MouseCapsMask; | - | ||||||||||||||||||||||||||||||||||||
2675 | event->caps |= caps & MouseCapsMask; | - | ||||||||||||||||||||||||||||||||||||
2676 | event->velocity = velocity; | - | ||||||||||||||||||||||||||||||||||||
2677 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2678 | - | |||||||||||||||||||||||||||||||||||||
2679 | Qt::MouseEventSource QGuiApplicationPrivate::mouseEventSource(const QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
2680 | { | - | ||||||||||||||||||||||||||||||||||||
2681 | return never executed: Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift);return Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift); never executed: return Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift); | 0 | ||||||||||||||||||||||||||||||||||||
2682 | } | - | ||||||||||||||||||||||||||||||||||||
2683 | - | |||||||||||||||||||||||||||||||||||||
2684 | void QGuiApplicationPrivate::setMouseEventSource(QMouseEvent *event, Qt::MouseEventSource source) | - | ||||||||||||||||||||||||||||||||||||
2685 | { | - | ||||||||||||||||||||||||||||||||||||
2686 | - | |||||||||||||||||||||||||||||||||||||
2687 | - | |||||||||||||||||||||||||||||||||||||
2688 | int value = source; | - | ||||||||||||||||||||||||||||||||||||
2689 | ((!(value <= MouseSourceMaskSrc)) ? qt_assert("value <= MouseSourceMaskSrc",__FILE__,3673) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
2690 | event->caps &= ~MouseSourceMaskDst; | - | ||||||||||||||||||||||||||||||||||||
2691 | event->caps |= (value & MouseSourceMaskSrc) << MouseSourceShift; | - | ||||||||||||||||||||||||||||||||||||
2692 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2693 | - | |||||||||||||||||||||||||||||||||||||
2694 | Qt::MouseEventFlags QGuiApplicationPrivate::mouseEventFlags(const QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
2695 | { | - | ||||||||||||||||||||||||||||||||||||
2696 | return never executed: Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift);return Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift); never executed: return Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift); | 0 | ||||||||||||||||||||||||||||||||||||
2697 | } | - | ||||||||||||||||||||||||||||||||||||
2698 | - | |||||||||||||||||||||||||||||||||||||
2699 | void QGuiApplicationPrivate::setMouseEventFlags(QMouseEvent *event, Qt::MouseEventFlags flags) | - | ||||||||||||||||||||||||||||||||||||
2700 | { | - | ||||||||||||||||||||||||||||||||||||
2701 | - | |||||||||||||||||||||||||||||||||||||
2702 | unsigned int value = flags; | - | ||||||||||||||||||||||||||||||||||||
2703 | ((!(value <= Qt::MouseEventFlagMask)) ? qt_assert("value <= Qt::MouseEventFlagMask",__FILE__,3687) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
2704 | event->caps &= ~MouseFlagsCapsMask; | - | ||||||||||||||||||||||||||||||||||||
2705 | event->caps |= (value & Qt::MouseEventFlagMask) << MouseFlagsShift; | - | ||||||||||||||||||||||||||||||||||||
2706 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
2707 | - | |||||||||||||||||||||||||||||||||||||
2708 | QInputDeviceManager *QGuiApplicationPrivate::inputDeviceManager() | - | ||||||||||||||||||||||||||||||||||||
2709 | { | - | ||||||||||||||||||||||||||||||||||||
2710 | ((!(QGuiApplication::instance())) ? qt_assert("QGuiApplication::instance()",__FILE__,3694) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
2711 | - | |||||||||||||||||||||||||||||||||||||
2712 | if (!m_inputDeviceManager
| 0 | ||||||||||||||||||||||||||||||||||||
2713 | m_inputDeviceManager = new QInputDeviceManager(QGuiApplication::instance()); never executed: m_inputDeviceManager = new QInputDeviceManager(QGuiApplication::instance()); | 0 | ||||||||||||||||||||||||||||||||||||
2714 | - | |||||||||||||||||||||||||||||||||||||
2715 | return never executed: m_inputDeviceManager;return m_inputDeviceManager; never executed: return m_inputDeviceManager; | 0 | ||||||||||||||||||||||||||||||||||||
2716 | } | - | ||||||||||||||||||||||||||||||||||||
2717 | - | |||||||||||||||||||||||||||||||||||||
2718 | - | |||||||||||||||||||||||||||||||||||||
2719 | - | |||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |