qguiapplication.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qguiapplication.cpp
Switch to Source codePreprocessed file
LineSourceCount
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-
20Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton;-
21Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;-
22-
23QPointF QGuiApplicationPrivate::lastCursorPosition(qInf(), qInf());-
24-
25QWindow *QGuiApplicationPrivate::currentMouseWindow = 0;-
26-
27QString QGuiApplicationPrivate::styleOverride;-
28-
29Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive;-
30-
31bool QGuiApplicationPrivate::highDpiScalingUpdated = false;-
32-
33QVector<QGuiApplicationPrivate::TabletPointData> QGuiApplicationPrivate::tabletDevicePoints;-
34-
35QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0;-
36QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0;-
37-
38QList<QObject *> QGuiApplicationPrivate::generic_plugin_list;-
39-
40-
41bool QGuiApplicationPrivate::is_fallback_session_management_enabled = true;-
42-
43-
44enum ApplicationResourceFlags-
45{-
46 ApplicationPaletteExplicitlySet = 0x1,-
47 ApplicationFontExplicitlySet = 0x2-
48};-
49-
50static unsigned applicationResourceFlags = 0;-
51-
52QIcon *QGuiApplicationPrivate::app_icon = 0;-
53-
54QString *QGuiApplicationPrivate::platform_name = 0;-
55QString *QGuiApplicationPrivate::displayName = 0;-
56QString *QGuiApplicationPrivate::desktopFileName = 0;-
57-
58QPalette *QGuiApplicationPrivate::app_pal = 0;-
59-
60Qt::MouseButtons QGuiApplicationPrivate::buttons = Qt::NoButton;-
61-
62ulong QGuiApplicationPrivate::mousePressTime = 0;-
63Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton;-
64int QGuiApplicationPrivate::mousePressX = 0;-
65int QGuiApplicationPrivate::mousePressY = 0;-
66int QGuiApplicationPrivate::mouse_double_click_distance = -1;-
67-
68QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0;-
69-
70static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto;-
71static bool force_reverse = false;-
72-
73QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0;-
74QTouchDevice *QGuiApplicationPrivate::m_fakeTouchDevice = 0;-
75int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0;-
76-
77-
78QClipboard *QGuiApplicationPrivate::qt_clipboard = 0;-
79-
80-
81QList<QScreen *> QGuiApplicationPrivate::screen_list;-
82-
83QWindowList QGuiApplicationPrivate::window_list;-
84QWindow *QGuiApplicationPrivate::focus_window = 0;-
85-
86static QBasicMutex applicationFontMutex;-
87QFont *QGuiApplicationPrivate::app_font = 0;-
88QStyleHints *QGuiApplicationPrivate::styleHints = nullptr;-
89bool QGuiApplicationPrivate::obey_desktop_settings = true;-
90-
91QInputDeviceManager *QGuiApplicationPrivate::m_inputDeviceManager = 0;-
92-
93static qreal fontSmoothingGamma = 1.7;-
94-
95extern void qRegisterGuiVariant();-
96-
97extern void qRegisterGuiGetInterpolator();-
98-
99-
100static bool qt_detectRTLLanguage()-
101{-
102 return
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"));
force_reverse ^
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
103 (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
104 "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
105 " 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
106 " 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
107}-
108-
109static void initPalette()-
110{-
111 if (!QGuiApplicationPrivate::app_pal
!QGuiApplicati...ivate::app_palDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
112 if (const
const QPalette...e()->palette()Description
TRUEnever evaluated
FALSEnever evaluated
QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()
const QPalette...e()->palette()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
113 QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
0
114 if (!QGuiApplicationPrivate::app_pal
!QGuiApplicati...ivate::app_palDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
115 QGuiApplicationPrivate::app_pal = new QPalette(Qt::gray);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(Qt::gray);
0
116}
never executed: end of block
0
117-
118static inline void clearPalette()-
119{-
120 delete QGuiApplicationPrivate::app_pal;-
121 QGuiApplicationPrivate::app_pal = 0;-
122}
never executed: end of block
0
123-
124static void initFontUnlocked()-
125{-
126 if (!QGuiApplicationPrivate::app_font
!QGuiApplicati...vate::app_fontDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
127 if (const
const QPlatfor...latformTheme()Description
TRUEnever evaluated
FALSEnever evaluated
QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()
const QPlatfor...latformTheme()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
128 if (const
const QFont *f...e::SystemFont)Description
TRUEnever evaluated
FALSEnever evaluated
QFont *font = theme->font(QPlatformTheme::SystemFont)
const QFont *f...e::SystemFont)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
129 QGuiApplicationPrivate::app_font = new QFont(*font);
never executed: QGuiApplicationPrivate::app_font = new QFont(*font);
0
130 }
never executed: end of block
0
131 if (!QGuiApplicationPrivate::app_font
!QGuiApplicati...vate::app_fontDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
132 QGuiApplicationPrivate::app_font =
never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
0
133 new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
0
134}
never executed: end of block
0
135-
136static inline void clearFontUnlocked()-
137{-
138 delete QGuiApplicationPrivate::app_font;-
139 QGuiApplicationPrivate::app_font = 0;-
140}
never executed: end of block
0
141-
142-
143-
144-
145-
146-
147struct QWindowGeometrySpecification-
148{-
149 static QWindowGeometrySpecification fromArgument(const QByteArray &a);-
150 void applyTo(QWindow *window) const;-
151-
152 Qt::Corner corner;-
153 int xOffset;-
154 int yOffset;-
155 int width;-
156 int height;-
157};-
158-
159-
160static inline int nextGeometryToken(const QByteArray &a, int &pos, char *op)-
161{-
162 *op = 0;-
163 const int size = a.size();-
164 if (pos >= size
pos >= sizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
165 return
never executed: return -1;
-1;
never executed: return -1;
0
166-
167 *op = a.at(pos);-
168 if (*
*op == '+'Description
TRUEnever evaluated
FALSEnever evaluated
op == '+'
*op == '+'Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*op == '-'Description
TRUEnever evaluated
FALSEnever evaluated
op == '-'
*op == '-'Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*op == 'x'Description
TRUEnever evaluated
FALSEnever evaluated
op == 'x'
*op == 'x'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
169 pos++;
never executed: pos++;
0
170 else if (isdigit(*op)
isdigit(*op)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
171 *
never executed: *op = 'x';
op = 'x';
never executed: *op = 'x';
0
172 else-
173 return
never executed: return -1;
-1;
never executed: return -1;
0
174-
175 const int numberPos = pos;-
176 for ( ; pos < size
pos < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
&& isdigit(a.at(pos))
isdigit(a.at(pos))Description
TRUEnever evaluated
FALSEnever evaluated
; ++pos) ;
never executed: ;
0
177-
178 bool ok;-
179 const int result = a.mid(numberPos, pos - numberPos).toInt(&ok);-
180 return
never executed: return ok ? result : -1;
ok ? result : -1;
never executed: return ok ? result : -1;
0
181}-
182-
183QWindowGeometrySpecification QWindowGeometrySpecification::fromArgument(const QByteArray &a)-
184{-
185 QWindowGeometrySpecification result = { Qt::TopLeftCorner, -1, -1, -1, -1 };-
186 int pos = 0;-
187 for (int i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
188 char op;-
189 const int value = nextGeometryToken(a, pos, &op);-
190 if (value < 0
value < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
191 break;
never executed: break;
0
192 switch (op) {-
193 case
never executed: case 'x':
'x':
never executed: case 'x':
0
194 (result.width >= 0 ? result.height : result.width) = value;-
195 break;
never executed: break;
0
196 case
never executed: case '+':
'+':
never executed: case '+':
0
197 case
never executed: case '-':
'-':
never executed: case '-':
0
198 if (result.xOffset >= 0
result.xOffset >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
199 result.yOffset = value;-
200 if (op == '-'
op == '-'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
201 result.corner = result.corner == Qt::TopRightCorner
result.corner ...TopRightCornerDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::BottomRightCorner : Qt::BottomLeftCorner;
never executed: result.corner = result.corner == Qt::TopRightCorner ? Qt::BottomRightCorner : Qt::BottomLeftCorner;
0
202 }
never executed: end of block
else {
0
203 result.xOffset = value;-
204 if (op == '-'
op == '-'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
205 result.corner = Qt::TopRightCorner;
never executed: result.corner = Qt::TopRightCorner;
0
206 }
never executed: end of block
0
207 }-
208 }
never executed: end of block
0
209 return
never executed: return result;
result;
never executed: return result;
0
210}-
211-
212void QWindowGeometrySpecification::applyTo(QWindow *window) const-
213{-
214 QRect windowGeometry = window->frameGeometry();-
215 QSize size = windowGeometry.size();-
216 if (width >= 0
width >= 0Description
TRUEnever evaluated
FALSEnever evaluated
|| height >= 0
height >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
217 const QSize windowMinimumSize = window->minimumSize();-
218 const QSize windowMaximumSize = window->maximumSize();-
219 if (width >= 0
width >= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
220 size.setWidth(qBound(windowMinimumSize.width(), width, windowMaximumSize.width()));
never executed: size.setWidth(qBound(windowMinimumSize.width(), width, windowMaximumSize.width()));
0
221 if (height >= 0
height >= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
222 size.setHeight(qBound(windowMinimumSize.height(), height, windowMaximumSize.height()));
never executed: size.setHeight(qBound(windowMinimumSize.height(), height, windowMaximumSize.height()));
0
223 window->resize(size);-
224 }
never executed: end of block
0
225 if (xOffset >= 0
xOffset >= 0Description
TRUEnever evaluated
FALSEnever evaluated
|| yOffset >= 0
yOffset >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
226 const QRect availableGeometry = window->screen()->virtualGeometry();-
227 QPoint topLeft = windowGeometry.topLeft();-
228 if (xOffset >= 0
xOffset >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
229 topLeft.setX(corner == Qt::TopLeftCorner || corner == Qt::BottomLeftCorner ?-
230 xOffset :-
231 qMax(availableGeometry.right() - size.width() - xOffset, availableGeometry.left()));-
232 }
never executed: end of block
0
233 if (yOffset >= 0
yOffset >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
234 topLeft.setY(corner == Qt::TopLeftCorner || corner == Qt::TopRightCorner ?-
235 yOffset :-
236 qMax(availableGeometry.bottom() - size.height() - yOffset, availableGeometry.top()));-
237 }
never executed: end of block
0
238 window->setFramePosition(topLeft);-
239 }
never executed: end of block
0
240}
never executed: end of block
0
241-
242static QWindowGeometrySpecification windowGeometrySpecification = { Qt::TopLeftCorner, -1, -1, -1, -1 };-
243QGuiApplication::QGuiApplication(int &argc, char **argv, int flags)-
244-
245 : QCoreApplication(*new QGuiApplicationPrivate(argc, argv, flags))-
246{-
247 d_func()->init();-
248-
249 QCoreApplicationPrivate::eventDispatcher->startingUp();-
250}
never executed: end of block
0
251-
252-
253-
254-
255QGuiApplication::QGuiApplication(QGuiApplicationPrivate &p)-
256 : QCoreApplication(p)-
257{-
258}
never executed: end of block
0
259-
260-
261-
262-
263QGuiApplication::~QGuiApplication()-
264{-
265 QGuiApplicationPrivate * const d = d_func();-
266-
267 d->eventDispatcher->closingDown();-
268 d->eventDispatcher = 0;-
269-
270-
271 delete QGuiApplicationPrivate::qt_clipboard;-
272 QGuiApplicationPrivate::qt_clipboard = 0;-
273-
274-
275-
276 delete d->session_manager;-
277 d->session_manager = 0;-
278-
279-
280 clearPalette();-
281 QFontDatabase::removeAllApplicationFonts();-
282-
283-
284 d->cursor_list.clear();-
285-
286-
287 delete QGuiApplicationPrivate::app_icon;-
288 QGuiApplicationPrivate::app_icon = 0;-
289 delete QGuiApplicationPrivate::platform_name;-
290 QGuiApplicationPrivate::platform_name = 0;-
291 delete QGuiApplicationPrivate::displayName;-
292 QGuiApplicationPrivate::displayName = 0;-
293 delete QGuiApplicationPrivate::m_inputDeviceManager;-
294 QGuiApplicationPrivate::m_inputDeviceManager = 0;-
295 delete QGuiApplicationPrivate::desktopFileName;-
296 QGuiApplicationPrivate::desktopFileName = 0;-
297}
never executed: end of block
0
298-
299QGuiApplicationPrivate::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
312void QGuiApplication::setApplicationDisplayName(const QString &name)-
313{-
314 if (!QGuiApplicationPrivate::displayName
!QGuiApplicati...e::displayNameDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
319QString QGuiApplication::applicationDisplayName()-
320{-
321 return
never executed: return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
never executed: return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
0
322}-
323void QGuiApplication::setDesktopFileName(const QString &name)-
324{-
325 if (!QGuiApplicationPrivate::desktopFileName
!QGuiApplicati...esktopFileNameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
326 QGuiApplicationPrivate::desktopFileName = new QString;
never executed: QGuiApplicationPrivate::desktopFileName = new QString;
0
327 *QGuiApplicationPrivate::desktopFileName = name;-
328}
never executed: end of block
0
329-
330QString QGuiApplication::desktopFileName()-
331{-
332 return
never executed: return QGuiApplicationPrivate::desktopFileName ? *QGuiApplicationPrivate::desktopFileName : QString();
QGuiApplicationPrivate::desktopFileName ? *QGuiApplicationPrivate::desktopFileName : QString();
never executed: return QGuiApplicationPrivate::desktopFileName ? *QGuiApplicationPrivate::desktopFileName : QString();
0
333}-
334QWindow *QGuiApplication::modalWindow()-
335{-
336 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 723, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
}
0
337 if (QGuiApplicationPrivate::self->modalWindowList.isEmpty()
QGuiApplicatio...List.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
338 return
never executed: return 0;
0;
never executed: return 0;
0
339 return
never executed: return QGuiApplicationPrivate::self->modalWindowList.first();
QGuiApplicationPrivate::self->modalWindowList.first();
never executed: return QGuiApplicationPrivate::self->modalWindowList.first();
0
340}-
341-
342static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked)-
343{-
344 QWindowPrivate *p = qt_window_private(window);-
345 if (p->blockedByModalWindow != shouldBeBlocked
p->blockedByMo...houldBeBlockedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
346 p->blockedByModalWindow = shouldBeBlocked;-
347 QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked);-
348 QGuiApplication::sendEvent(window, &e);-
349 for (QObject *c : window->children()) {-
350 if (c->isWindowType()
c->isWindowType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
351 updateBlockedStatusRecursion(static_cast<QWindow *>(c), shouldBeBlocked);
never executed: updateBlockedStatusRecursion(static_cast<QWindow *>(c), shouldBeBlocked);
0
352 }
never executed: end of block
0
353 }
never executed: end of block
0
354}
never executed: end of block
0
355-
356void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window)-
357{-
358 bool shouldBeBlocked = false;-
359 if (!QWindowPrivate::get(window)->isPopup()
!QWindowPrivat...ow)->isPopup()Description
TRUEnever evaluated
FALSEnever evaluated
&& !self->modalWindowList.isEmpty()
!self->modalWi...List.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
360 shouldBeBlocked = self->isWindowBlocked(window);
never executed: shouldBeBlocked = self->isWindowBlocked(window);
0
361 updateBlockedStatusRecursion(window, shouldBeBlocked);-
362}
never executed: end of block
0
363-
364void QGuiApplicationPrivate::showModalWindow(QWindow *modal)-
365{-
366 self->modalWindowList.prepend(modal);-
367-
368-
369 if (currentMouseWindow
currentMouseWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& !QWindowPrivate::get(currentMouseWindow)->isPopup()
!QWindowPrivat...ow)->isPopup()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
370 bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow);-
371 if (shouldBeBlocked
shouldBeBlockedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
372-
373 self->modalWindowList.removeFirst();-
374 QEvent e(QEvent::Leave);-
375 QGuiApplication::sendEvent(currentMouseWindow, &e);-
376 currentMouseWindow = 0;-
377 self->modalWindowList.prepend(modal);-
378 }
never executed: end of block
0
379 }
never executed: end of block
0
380-
381 QWindowList windows = QGuiApplication::topLevelWindows();-
382 for (int i = 0; i < windows.count()
i < windows.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
383 QWindow *window = windows.at(i);-
384 if (!window->d_func()->blockedByModalWindow
!window->d_fun...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
385 updateBlockedStatus(window);
never executed: updateBlockedStatus(window);
0
386 }
never executed: end of block
0
387-
388 updateBlockedStatus(modal);-
389}
never executed: end of block
0
390-
391void QGuiApplicationPrivate::hideModalWindow(QWindow *window)-
392{-
393 self->modalWindowList.removeAll(window);-
394-
395 QWindowList windows = QGuiApplication::topLevelWindows();-
396 for (int i = 0; i < windows.count()
i < windows.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
397 QWindow *window = windows.at(i);-
398 if (window->d_func()->blockedByModalWindow
window->d_func...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
399 updateBlockedStatus(window);
never executed: updateBlockedStatus(window);
0
400 }
never executed: end of block
0
401}
never executed: end of block
0
402-
403-
404-
405-
406-
407-
408bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const-
409{-
410 QWindow *unused = 0;-
411 if (!blockingWindow
!blockingWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
412 blockingWindow = &unused;
never executed: blockingWindow = &unused;
0
413-
414 if (modalWindowList.isEmpty()
modalWindowList.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
415 *blockingWindow = 0;-
416 return
never executed: return false;
false;
never executed: return false;
0
417 }-
418-
419 for (int i = 0; i < modalWindowList.count()
i < modalWindowList.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
420 QWindow *modalWindow = modalWindowList.at(i);-
421-
422 {-
423-
424 QWindow *w = window;-
425 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
426 if (w == modalWindow
w == modalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
427 *blockingWindow = 0;-
428 return
never executed: return false;
false;
never executed: return false;
0
429 }-
430 QWindow *p = w->parent();-
431 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
432 p = w->transientParent();
never executed: p = w->transientParent();
0
433 w = p;-
434 }
never executed: end of block
0
435 }-
436-
437 Qt::WindowModality windowModality = modalWindow->modality();-
438 switch (windowModality) {-
439 case
never executed: case Qt::ApplicationModal:
Qt::ApplicationModal:
never executed: case Qt::ApplicationModal:
0
440 {-
441 if (modalWindow != window
modalWindow != windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
442 *blockingWindow = modalWindow;-
443 return
never executed: return true;
true;
never executed: return true;
0
444 }-
445 break;
never executed: break;
0
446 }-
447 case
never executed: case Qt::WindowModal:
Qt::WindowModal:
never executed: case Qt::WindowModal:
0
448 {-
449 QWindow *w = window;-
450 do {-
451 QWindow *m = modalWindow;-
452 do {-
453 if (m == w
m == wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
454 *blockingWindow = m;-
455 return
never executed: return true;
true;
never executed: return true;
0
456 }-
457 QWindow *p = m->parent();-
458 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
459 p = m->transientParent();
never executed: p = m->transientParent();
0
460 m = p;-
461 }
never executed: end of block
while (m
mDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
462 QWindow *p = w->parent();-
463 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
464 p = w->transientParent();
never executed: p = w->transientParent();
0
465 w = p;-
466 }
never executed: end of block
while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
467 break;
never executed: break;
0
468 }-
469 default
never executed: default:
:
never executed: default:
0
470 ((!(false)) ? qt_assert_x("QGuiApplication", "internal error, a modal widget cannot be modeless",__FILE__,857) : qt_noop());-
471 break;
never executed: break;
0
472 }-
473 }-
474 *blockingWindow = 0;-
475 return
never executed: return false;
false;
never executed: return false;
0
476}-
477-
478-
479-
480-
481-
482QWindow *QGuiApplication::focusWindow()-
483{-
484 return
never executed: return QGuiApplicationPrivate::focus_window;
QGuiApplicationPrivate::focus_window;
never executed: return QGuiApplicationPrivate::focus_window;
0
485}-
486QObject *QGuiApplication::focusObject()-
487{-
488 if (focusWindow()
focusWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
489 return
never executed: return focusWindow()->focusObject();
focusWindow()->focusObject();
never executed: return focusWindow()->focusObject();
0
490 return
never executed: return 0;
0;
never executed: return 0;
0
491}-
492QWindowList QGuiApplication::allWindows()-
493{-
494 return
never executed: return QGuiApplicationPrivate::window_list;
QGuiApplicationPrivate::window_list;
never executed: return QGuiApplicationPrivate::window_list;
0
495}-
496QWindowList QGuiApplication::topLevelWindows()-
497{-
498 const QWindowList &list = QGuiApplicationPrivate::window_list;-
499 QWindowList topLevelWindows;-
500 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
501 if (!list.at(i)->parent()
!list.at(i)->parent()Description
TRUEnever evaluated
FALSEnever evaluated
&& list.at(i)->type() != Qt::Desktop
list.at(i)->ty...!= Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
502-
503-
504 const bool embedded = list.at(i)->handle()
list.at(i)->handle()Description
TRUEnever evaluated
FALSEnever evaluated
&& list.at(i)->handle()->isEmbedded()
list.at(i)->ha...->isEmbedded()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
505 if (!embedded
!embeddedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
506 topLevelWindows.prepend(list.at(i));
never executed: topLevelWindows.prepend(list.at(i));
0
507 }
never executed: end of block
0
508 }
never executed: end of block
0
509 return
never executed: return topLevelWindows;
topLevelWindows;
never executed: return topLevelWindows;
0
510}-
511-
512QScreen *QGuiApplication::primaryScreen()-
513{-
514 if (QGuiApplicationPrivate::screen_list.isEmpty()
QGuiApplicatio...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
515 return
never executed: return 0;
0;
never executed: return 0;
0
516 return
never executed: return QGuiApplicationPrivate::screen_list.at(0);
QGuiApplicationPrivate::screen_list.at(0);
never executed: return QGuiApplicationPrivate::screen_list.at(0);
0
517}-
518-
519-
520-
521-
522-
523QList<QScreen *> QGuiApplication::screens()-
524{-
525 return
never executed: return QGuiApplicationPrivate::screen_list;
QGuiApplicationPrivate::screen_list;
never executed: return QGuiApplicationPrivate::screen_list;
0
526}-
527qreal QGuiApplication::devicePixelRatio() const-
528{-
529-
530 static qreal topDevicePixelRatio = 0.0;-
531 if (!qFuzzyIsNull(topDevicePixelRatio)
!qFuzzyIsNull(...icePixelRatio)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
532 return
never executed: return topDevicePixelRatio;
topDevicePixelRatio;
never executed: return topDevicePixelRatio;
0
533 }-
534-
535 topDevicePixelRatio = 1.0;-
536 for (QScreen *screen : qAsConst(QGuiApplicationPrivate::screen_list))-
537 topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio());
never executed: topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio());
0
538-
539 return
never executed: return topDevicePixelRatio;
topDevicePixelRatio;
never executed: return topDevicePixelRatio;
0
540}-
541-
542-
543-
544-
545QWindow *QGuiApplication::topLevelAt(const QPoint &pos)-
546{-
547 const QList<QScreen *> screens = QGuiApplication::screens();-
548 if (!screens.isEmpty()
!screens.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
549 const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings();-
550 QScreen *windowScreen = nullptr;-
551-
552-
553 for (QScreen *screen : primaryScreens) {-
554 if (screen->geometry().contains(pos)
screen->geomet....contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
555 windowScreen = screen;-
556 break;
never executed: break;
0
557 }-
558 }
never executed: end of block
0
559-
560-
561-
562-
563 if (!windowScreen
!windowScreenDescription
TRUEnever evaluated
FALSEnever evaluated
&& screens.count() != primaryScreens.count()
screens.count(...creens.count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
564 for (int i = 1; i < screens.size()
i < screens.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
565 QScreen *screen = screens.at(i);-
566 if (screen->geometry().contains(pos)
screen->geomet....contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
567 windowScreen = screen;-
568 break;
never executed: break;
0
569 }-
570 }
never executed: end of block
0
571 }
never executed: end of block
0
572-
573 if (windowScreen
windowScreenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
574 const QPoint devicePosition = QHighDpi::toNativePixels(pos, windowScreen);-
575 return
never executed: return windowScreen->handle()->topLevelAt(devicePosition);
windowScreen->handle()->topLevelAt(devicePosition);
never executed: return windowScreen->handle()->topLevelAt(devicePosition);
0
576 }-
577 }
never executed: end of block
0
578 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
579}-
580QString QGuiApplication::platformName()-
581{-
582 return
never executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
QGuiApplicationPrivate::platform_name ?
never executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
0
583 *QGuiApplicationPrivate::platform_name : QString();
never executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
0
584}-
585-
586static void init_platform(const QString &pluginArgument, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)-
587{-
588-
589 QStringList arguments = pluginArgument.split(QLatin1Char(':'));-
590 const QString name = arguments.takeFirst().toLower();-
591 QString argumentsKey = name;-
592 argumentsKey[0] = argumentsKey.at(0).toUpper();-
593 arguments.append(QLibraryInfo::platformPluginArguments(argumentsKey));-
594-
595-
596 QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, argc, argv, platformPluginPath);-
597 if (__builtin_expect(!!(!QGuiApplicationPrivate::platform_integration), false)
__builtin_expe...ation), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
598 QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);-
599-
600 QString fatalMessage-
601 = ([]() -> 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: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()).arg(name, QDir::toNativeSeparators(platformPluginPath));
0
602 if (!keys.isEmpty()
!keys.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
603 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: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()).arg(
0
604 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: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}())));
0
605 }
never executed: end of block
0
606 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: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
607-
608-
609-
610-
611-
612-
613 QMessageLogger(__FILE__, 1121, __PRETTY_FUNCTION__).fatal("%s", QString(fatalMessage).toLocal8Bit().constData());-
614 return;
never executed: return;
0
615 }-
616-
617 QGuiApplicationPrivate::platform_name = new QString(name);-
618-
619-
620-
621 if (QGuiApplication::primaryScreen()
QGuiApplicatio...rimaryScreen()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
622 QGuiApplicationPrivate::highDpiScalingUpdated = true;-
623 QHighDpiScaling::updateHighDpiScaling();-
624 }
never executed: end of block
0
625-
626-
627-
628-
629 QStringList themeNames;-
630 if (!platformThemeName.isEmpty()
!platformThemeName.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
631 themeNames.append(platformThemeName);
never executed: themeNames.append(platformThemeName);
0
632-
633-
634 themeNames += QGuiApplicationPrivate::platform_integration->themeNames();-
635-
636 for (const QString &themeName : qAsConst(themeNames)) {-
637 QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath);-
638 if (QGuiApplicationPrivate::platform_theme
QGuiApplicatio...platform_themeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
639 break;
never executed: break;
0
640 }
never executed: end of block
0
641-
642-
643-
644 if (!QGuiApplicationPrivate::platform_theme
!QGuiApplicati...platform_themeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
645 for (const QString &themeName : qAsConst(themeNames)) {-
646 QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName);-
647 if (QGuiApplicationPrivate::platform_theme
QGuiApplicatio...platform_themeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
648 break;
never executed: break;
0
649 }
never executed: end of block
0
650-
651 }
never executed: end of block
0
652-
653-
654 if (!QGuiApplicationPrivate::platform_theme
!QGuiApplicati...platform_themeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
655 QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
never executed: QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
0
656-
657-
658-
659-
660 if (!arguments.isEmpty()
!arguments.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
661 if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()
QObject *nativ...iveInterface()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
662 for (const QString &argument : qAsConst(arguments)) {-
663 const int equalsPos = argument.indexOf(QLatin1Char('='));-
664 const QByteArray name =-
665 equalsPos != -1
equalsPos != -1Description
TRUEnever evaluated
FALSEnever evaluated
? argument.left(equalsPos).toUtf8() : argument.toUtf8();
0
666 const QVariant value =-
667 equalsPos != -1
equalsPos != -1Description
TRUEnever evaluated
FALSEnever evaluated
? QVariant(argument.mid(equalsPos + 1)) : QVariant(true);
0
668 nativeInterface->setProperty(name.constData(), value);-
669 }
never executed: end of block
0
670 }
never executed: end of block
0
671 }
never executed: end of block
0
672-
673-
674 fontSmoothingGamma = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal();-
675}
never executed: end of block
0
676-
677static void init_plugins(const QList<QByteArray> &pluginList)-
678{-
679 for (int i = 0; i < pluginList.count()
i < pluginList.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
680 QByteArray pluginSpec = pluginList.at(i);-
681 int colonPos = pluginSpec.indexOf(':');-
682 QObject *plugin;-
683 if (colonPos < 0
colonPos < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
684 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
0
685 else-
686 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)),
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1)));
0
687 QLatin1String(pluginSpec.mid(colonPos+1)));
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1)));
0
688 if (plugin
pluginDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
689 QGuiApplicationPrivate::generic_plugin_list.append(plugin);
never executed: QGuiApplicationPrivate::generic_plugin_list.append(plugin);
0
690 else-
691 QMessageLogger(__FILE__, 1199, __PRETTY_FUNCTION__).warning() << "No such plugin for spec " << pluginSpec;
never executed: QMessageLogger(__FILE__, 1199, __PRETTY_FUNCTION__).warning() << "No such plugin for spec " << pluginSpec;
0
692 }-
693}
never executed: end of block
0
694-
695void QGuiApplicationPrivate::createPlatformIntegration()-
696{-
697 QHighDpiScaling::initHighDpiScaling();-
698-
699-
700 QString platformPluginPath = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));-
701-
702-
703 QByteArray platformName;-
704-
705 platformName = "xcb";-
706-
707 QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");-
708 if (!platformNameEnv.isEmpty()
!platformNameEnv.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
709 platformName = platformNameEnv;-
710 }
never executed: end of block
0
711-
712 QString platformThemeName = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORMTHEME"));-
713-
714-
715-
716 QString icon;-
717-
718 int j = argc
argcDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
719 for (int i=1; i<argc
i<argcDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
720 if (!argv[i]
!argv[i]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
721 continue;
never executed: continue;
0
722 if (*
*argv[i] != '-'Description
TRUEnever evaluated
FALSEnever evaluated
argv[i] != '-'
*argv[i] != '-'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
723 argv[j++] = argv[i];-
724 continue;
never executed: continue;
0
725 }-
726 const bool isXcb = platformName == "xcb";-
727 const char *arg = argv[i];-
728 if (arg[1] == '-'
arg[1] == '-'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
729 ++
never executed: ++arg;
arg;
never executed: ++arg;
0
730 if (strcmp(arg, "-platformpluginpath") == 0
strcmp(arg, "-...ginpath") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
731 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
732 platformPluginPath = QString::fromLocal8Bit(argv[i]);
never executed: platformPluginPath = QString::fromLocal8Bit(argv[i]);
0
733 }
never executed: end of block
else if (strcmp(arg, "-platform") == 0
strcmp(arg, "-platform") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
734 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
735 platformName = argv[i];
never executed: platformName = argv[i];
0
736 }
never executed: end of block
else if (strcmp(arg, "-platformtheme") == 0
strcmp(arg, "-...rmtheme") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
737 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
738 platformThemeName = QString::fromLocal8Bit(argv[i]);
never executed: platformThemeName = QString::fromLocal8Bit(argv[i]);
0
739 }
never executed: end of block
else if (strcmp(arg, "-qwindowgeometry") == 0
strcmp(arg, "-...eometry") == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (isXcb
isXcbDescription
TRUEnever evaluated
FALSEnever evaluated
&& strcmp(arg, "-geometry") == 0
strcmp(arg, "-geometry") == 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
740 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
741 windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]);
never executed: windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]);
0
742 }
never executed: end of block
else if (strcmp(arg, "-qwindowtitle") == 0
strcmp(arg, "-...owtitle") == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (isXcb
isXcbDescription
TRUEnever evaluated
FALSEnever evaluated
&& strcmp(arg, "-title") == 0
strcmp(arg, "-title") == 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
743 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
744 firstWindowTitle = QString::fromLocal8Bit(argv[i]);
never executed: firstWindowTitle = QString::fromLocal8Bit(argv[i]);
0
745 }
never executed: end of block
else if (strcmp(arg, "-qwindowicon") == 0
strcmp(arg, "-...dowicon") == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (isXcb
isXcbDescription
TRUEnever evaluated
FALSEnever evaluated
&& strcmp(arg, "-icon") == 0
strcmp(arg, "-icon") == 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
746 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
747 icon = QString::fromLocal8Bit(argv[i]);-
748 }
never executed: end of block
0
749 }
never executed: end of block
else {
0
750 argv[j++] = argv[i];-
751 }
never executed: end of block
0
752 }-
753-
754 if (j < argc
j < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
755 argv[j] = 0;-
756 argc = j;-
757 }
never executed: end of block
0
758-
759 init_platform(QLatin1String(platformName), platformPluginPath, platformThemeName, argc, argv);-
760-
761 if (!icon.isEmpty()
!icon.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
762 forcedWindowIcon = QDir::isAbsolutePath(icon)
QDir::isAbsolutePath(icon)Description
TRUEnever evaluated
FALSEnever evaluated
? QIcon(icon) : QIcon::fromTheme(icon);
never executed: forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon);
0
763}
never executed: end of block
0
764-
765-
766-
767-
768-
769-
770-
771void QGuiApplicationPrivate::createEventDispatcher()-
772{-
773 ((!(!eventDispatcher)) ? qt_assert("!eventDispatcher",__FILE__,1281) : qt_noop());-
774-
775 if (platform_integration == 0
platform_integration == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
776 createPlatformIntegration();
never executed: createPlatformIntegration();
0
777-
778-
779 ((!(!eventDispatcher)) ? qt_assert("!eventDispatcher",__FILE__,1287) : qt_noop());-
780-
781 eventDispatcher = platform_integration->createEventDispatcher();-
782}
never executed: end of block
0
783-
784void QGuiApplicationPrivate::eventDispatcherReady()-
785{-
786 if (platform_integration == 0
platform_integration == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
787 createPlatformIntegration();
never executed: createPlatformIntegration();
0
788-
789 platform_integration->initialize();-
790-
791-
792-
793 if (!QGuiApplicationPrivate::highDpiScalingUpdated
!QGuiApplicati...ScalingUpdatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
794 QHighDpiScaling::updateHighDpiScaling();
never executed: QHighDpiScaling::updateHighDpiScaling();
0
795}
never executed: end of block
0
796-
797void QGuiApplicationPrivate::init()-
798{-
799 QCoreApplicationPrivate::init();-
800-
801 QCoreApplicationPrivate::is_app_running = false;-
802-
803 bool loadTestability = false;-
804 QList<QByteArray> pluginList;-
805-
806-
807 QString session_id;-
808 QString session_key;-
809 QString s;-
810 int j = argc
argcDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
811 for (int i=1; i<argc
i<argcDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
812 if (!argv[i]
!argv[i]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
813 continue;
never executed: continue;
0
814 if (*
*argv[i] != '-'Description
TRUEnever evaluated
FALSEnever evaluated
argv[i] != '-'
*argv[i] != '-'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
815 argv[j++] = argv[i];-
816 continue;
never executed: continue;
0
817 }-
818 const char *arg = argv[i];-
819 if (arg[1] == '-'
arg[1] == '-'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
820 ++
never executed: ++arg;
arg;
never executed: ++arg;
0
821 if (strcmp(arg, "-plugin") == 0
strcmp(arg, "-plugin") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
822 if (++
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
i < argc
++i < argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
823 pluginList << argv[i];
never executed: pluginList << argv[i];
0
824 }
never executed: end of block
else if (strcmp(arg, "-reverse") == 0
strcmp(arg, "-reverse") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
825 force_reverse = true;-
826 }
never executed: end of block
else if (strcmp(arg, "-session") == 0
strcmp(arg, "-session") == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& i < argc - 1
i < argc - 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
827 ++i;-
828 if (argv[i]
argv[i]Description
TRUEnever evaluated
FALSEnever evaluated
&& *
*argv[i]Description
TRUEnever evaluated
FALSEnever evaluated
argv[i]
*argv[i]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
829 session_id = QString::fromLatin1(argv[i]);-
830 int p = session_id.indexOf(QLatin1Char('_'));-
831 if (p >= 0
p >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
832 session_key = session_id.mid(p +1);-
833 session_id = session_id.left(p);-
834 }
never executed: end of block
0
835 is_session_restored = true;-
836 }
never executed: end of block
0
837-
838 }
never executed: end of block
else if (strcmp(arg, "-testability") == 0
strcmp(arg, "-...ability") == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
839 loadTestability = true;-
840 }
never executed: end of block
else if (strncmp(arg, "-style=", 7) == 0
strncmp(arg, "...yle=", 7) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
841 s = QString::fromLocal8Bit(arg + 7);-
842 }
never executed: end of block
else if (strcmp(arg, "-style") == 0
strcmp(arg, "-style") == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& i < argc - 1
i < argc - 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
843 s = QString::fromLocal8Bit(argv[++i]);-
844 }
never executed: end of block
else {
0
845 argv[j++] = argv[i];-
846 }
never executed: end of block
0
847-
848 if (!s.isEmpty()
!s.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
849 styleOverride = s;
never executed: styleOverride = s;
0
850 }
never executed: end of block
0
851-
852 if (j < argc
j < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
853 argv[j] = 0;-
854 argc = j;-
855 }
never executed: end of block
0
856-
857-
858 QByteArray envPlugins = qgetenv("QT_QPA_GENERIC_PLUGINS");-
859 if (!envPlugins.isEmpty()
!envPlugins.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
860 pluginList += envPlugins.split(',');
never executed: pluginList += envPlugins.split(',');
0
861-
862 if (platform_integration == 0
platform_integration == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
863 createPlatformIntegration();
never executed: createPlatformIntegration();
0
864-
865 initPalette();-
866 QFont::initialize();-
867-
868 mouse_double_click_distance = platformTheme()->themeHint(QPlatformTheme::MouseDoubleClickDistance).toInt();-
869-
870-
871 QCursorData::initialize();-
872-
873-
874-
875 qRegisterGuiVariant();-
876-
877-
878-
879 qRegisterGuiGetInterpolator();-
880-
881-
882-
883-
884 if ((static_cast<
(static_cast<Q...penGLContexts)Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_ShareOpenGLContexts)
(static_cast<Q...penGLContexts)Description
TRUEnever evaluated
FALSEnever evaluated
&& !qt_gl_global_share_context()
!qt_gl_global_share_context()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
885 QOpenGLContext *ctx = new QOpenGLContext;-
886 ctx->setFormat(QSurfaceFormat::defaultFormat());-
887 ctx->create();-
888 qt_gl_set_global_share_context(ctx);-
889 ownGlobalShareContext = true;-
890 }
never executed: end of block
0
891-
892-
893 QWindowSystemInterfacePrivate::eventTime.start();-
894-
895 is_app_running = true;-
896 init_plugins(pluginList);-
897 QWindowSystemInterface::flushWindowSystemEvents();-
898-
899-
900 QGuiApplication * const q = q_func();-
901-
902-
903 session_manager = new QSessionManager(q, session_id, session_key);-
904-
905-
906-
907 if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0
qEnvironmentVa...TABILITY") > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
908 loadTestability = true;
never executed: loadTestability = true;
0
909-
910 if (loadTestability
loadTestabilityDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
911 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: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
0
912 if (__builtin_expect(!!(!testLib.load()), false)
__builtin_expe...oad()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
913 QMessageLogger(__FILE__, 1445, __PRETTY_FUNCTION__).critical() << "Library qttestability load failed:" << testLib.errorString();-
914 }
never executed: end of block
else {
0
915 typedef void (*TasInitialize)(void);-
916 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");-
917 if (__builtin_expect(!!(!initFunction), false)
__builtin_expe...ction), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
918 QMessageLogger(__FILE__, 1450, __PRETTY_FUNCTION__).critical("Library qttestability resolve failed!");-
919 }
never executed: end of block
else {
0
920 initFunction();-
921 }
never executed: end of block
0
922 }-
923 }-
924-
925-
926-
927-
928 if (layout_direction == Qt::LayoutDirectionAuto
layout_directi...tDirectionAutoDescription
TRUEnever evaluated
FALSEnever evaluated
|| force_reverse
force_reverseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
929 QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);
never executed: QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);
0
930}
never executed: end of block
0
931-
932extern void qt_cleanupFontDatabase();-
933-
934QGuiApplicationPrivate::~QGuiApplicationPrivate()-
935{-
936 is_app_closing = true;-
937 is_app_running = false;-
938-
939 for (int i = 0; i < generic_plugin_list.count()
i < generic_pl...n_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
940 delete generic_plugin_list.at(i);
never executed: delete generic_plugin_list.at(i);
0
941 generic_plugin_list.clear();-
942-
943 clearFontUnlocked();-
944-
945 QFont::cleanup();-
946-
947-
948 QCursorData::cleanup();-
949-
950-
951 layout_direction = Qt::LeftToRight;-
952-
953 cleanupThreadData();-
954-
955 delete QGuiApplicationPrivate::styleHints;-
956 QGuiApplicationPrivate::styleHints = nullptr;-
957 delete inputMethod;-
958-
959 qt_cleanupFontDatabase();-
960-
961 QPixmapCache::clear();-
962-
963-
964 if (ownGlobalShareContext
ownGlobalShareContextDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
965 delete qt_gl_global_share_context();-
966 qt_gl_set_global_share_context(0);-
967 }
never executed: end of block
0
968-
969-
970 platform_integration->destroy();-
971-
972 delete platform_theme;-
973 platform_theme = 0;-
974 delete platform_integration;-
975 platform_integration = 0;-
976 delete m_gammaTables.load();-
977-
978 window_list.clear();-
979}
never executed: end of block
0
980Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()-
981{-
982 return
never executed: return QGuiApplicationPrivate::modifier_buttons;
QGuiApplicationPrivate::modifier_buttons;
never executed: return QGuiApplicationPrivate::modifier_buttons;
0
983}-
984Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()-
985{-
986 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 1568, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return Qt::KeyboardModifiers(0);
Qt::KeyboardModifiers(0);
never executed: return Qt::KeyboardModifiers(0);
}
0
987 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();-
988 return
never executed: return pi->queryKeyboardModifiers();
pi->queryKeyboardModifiers();
never executed: return pi->queryKeyboardModifiers();
0
989}-
990Qt::MouseButtons QGuiApplication::mouseButtons()-
991{-
992 return
never executed: return QGuiApplicationPrivate::mouse_buttons;
QGuiApplicationPrivate::mouse_buttons;
never executed: return QGuiApplicationPrivate::mouse_buttons;
0
993}-
994-
995-
996-
997-
998-
999QPlatformNativeInterface *QGuiApplication::platformNativeInterface()-
1000{-
1001 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();-
1002 return
never executed: return pi ? pi->nativeInterface() : 0;
pi ? pi->nativeInterface() : 0;
never executed: return pi ? pi->nativeInterface() : 0;
0
1003}-
1004-
1005-
1006-
1007-
1008QFunctionPointer QGuiApplication::platformFunction(const QByteArray &function)-
1009{-
1010 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();-
1011 if (!pi
!piDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1012 QMessageLogger(__FILE__, 1608, __PRETTY_FUNCTION__).warning("QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function");-
1013 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
1014 }-
1015-
1016 return
never executed: return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr;
pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr;
never executed: return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr;
0
1017}-
1018int QGuiApplication::exec()-
1019{-
1020-
1021 QAccessible::setRootObject((static_cast<QGuiApplication *>(QCoreApplication::instance())));-
1022-
1023 return
never executed: return QCoreApplication::exec();
QCoreApplication::exec();
never executed: return QCoreApplication::exec();
0
1024}-
1025-
1026-
1027-
1028bool QGuiApplication::notify(QObject *object, QEvent *event)-
1029{-
1030 if (object->isWindowType()
object->isWindowType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1031 QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
never executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
0
1032 return
never executed: return QCoreApplication::notify(object, event);
QCoreApplication::notify(object, event);
never executed: return QCoreApplication::notify(object, event);
0
1033}-
1034-
1035-
1036-
1037bool QGuiApplication::event(QEvent *e)-
1038{-
1039 if(e->type() == QEvent::LanguageChange
e->type() == Q...LanguageChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1040 setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);-
1041 }
never executed: end of block
0
1042 return
never executed: return QCoreApplication::event(e);
QCoreApplication::event(e);
never executed: return QCoreApplication::event(e);
0
1043}-
1044-
1045-
1046-
1047-
1048bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents)-
1049{-
1050 return
never executed: return QCoreApplication::compressEvent(event, receiver, postedEvents);
QCoreApplication::compressEvent(event, receiver, postedEvents);
never executed: return QCoreApplication::compressEvent(event, receiver, postedEvents);
0
1051}-
1052-
1053void QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event)-
1054{-
1055 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1056 return;
never executed: return;
0
1057 QPlatformWindow *platformWindow = window->handle();-
1058 if (!platformWindow
!platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1059 return;
never executed: return;
0
1060-
1061 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1062 return;
never executed: return;
0
1063-
1064 platformWindow->windowEvent(event);-
1065}
never executed: end of block
0
1066-
1067bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)-
1068{-
1069 return
never executed: return window->nativeEvent(eventType, message, result);
window->nativeEvent(eventType, message, result);
never executed: return window->nativeEvent(eventType, message, result);
0
1070}-
1071-
1072void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)-
1073{-
1074 switch(e->type) {-
1075 case
never executed: case QWindowSystemInterfacePrivate::FrameStrutMouse:
QWindowSystemInterfacePrivate::FrameStrutMouse:
never executed: case QWindowSystemInterfacePrivate::FrameStrutMouse:
0
1076 case
never executed: case QWindowSystemInterfacePrivate::Mouse:
QWindowSystemInterfacePrivate::Mouse:
never executed: case QWindowSystemInterfacePrivate::Mouse:
0
1077 QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e));-
1078 break;
never executed: break;
0
1079 case
never executed: case QWindowSystemInterfacePrivate::Wheel:
QWindowSystemInterfacePrivate::Wheel:
never executed: case QWindowSystemInterfacePrivate::Wheel:
0
1080 QGuiApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e));-
1081 break;
never executed: break;
0
1082 case
never executed: case QWindowSystemInterfacePrivate::Key:
QWindowSystemInterfacePrivate::Key:
never executed: case QWindowSystemInterfacePrivate::Key:
0
1083 QGuiApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e));-
1084 break;
never executed: break;
0
1085 case
never executed: case QWindowSystemInterfacePrivate::Touch:
QWindowSystemInterfacePrivate::Touch:
never executed: case QWindowSystemInterfacePrivate::Touch:
0
1086 QGuiApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e));-
1087 break;
never executed: break;
0
1088 case
never executed: case QWindowSystemInterfacePrivate::GeometryChange:
QWindowSystemInterfacePrivate::GeometryChange:
never executed: case QWindowSystemInterfacePrivate::GeometryChange:
0
1089 QGuiApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e));-
1090 break;
never executed: break;
0
1091 case
never executed: case QWindowSystemInterfacePrivate::Enter:
QWindowSystemInterfacePrivate::Enter:
never executed: case QWindowSystemInterfacePrivate::Enter:
0
1092 QGuiApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e));-
1093 break;
never executed: break;
0
1094 case
never executed: case QWindowSystemInterfacePrivate::Leave:
QWindowSystemInterfacePrivate::Leave:
never executed: case QWindowSystemInterfacePrivate::Leave:
0
1095 QGuiApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e));-
1096 break;
never executed: break;
0
1097 case
never executed: case QWindowSystemInterfacePrivate::ActivatedWindow:
QWindowSystemInterfacePrivate::ActivatedWindow:
never executed: case QWindowSystemInterfacePrivate::ActivatedWindow:
0
1098 QGuiApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e));-
1099 break;
never executed: break;
0
1100 case
never executed: case QWindowSystemInterfacePrivate::WindowStateChanged:
QWindowSystemInterfacePrivate::WindowStateChanged:
never executed: case QWindowSystemInterfacePrivate::WindowStateChanged:
0
1101 QGuiApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e));-
1102 break;
never executed: break;
0
1103 case
never executed: case QWindowSystemInterfacePrivate::WindowScreenChanged:
QWindowSystemInterfacePrivate::WindowScreenChanged:
never executed: case QWindowSystemInterfacePrivate::WindowScreenChanged:
0
1104 QGuiApplicationPrivate::processWindowScreenChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowScreenChangedEvent *>(e));-
1105 break;
never executed: break;
0
1106 case
never executed: case QWindowSystemInterfacePrivate::ApplicationStateChanged:
QWindowSystemInterfacePrivate::ApplicationStateChanged:
never executed: case QWindowSystemInterfacePrivate::ApplicationStateChanged:
{
0
1107 QWindowSystemInterfacePrivate::ApplicationStateChangedEvent * changeEvent = static_cast<QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *>(e);-
1108 QGuiApplicationPrivate::setApplicationState(changeEvent->newState, changeEvent->forcePropagate); }-
1109 break;
never executed: break;
0
1110 case
never executed: case QWindowSystemInterfacePrivate::FlushEvents:
QWindowSystemInterfacePrivate::FlushEvents:
never executed: case QWindowSystemInterfacePrivate::FlushEvents:
{
0
1111 QWindowSystemInterfacePrivate::FlushEventsEvent *flushEventsEvent = static_cast<QWindowSystemInterfacePrivate::FlushEventsEvent *>(e);-
1112 QWindowSystemInterface::deferredFlushWindowSystemEvents(flushEventsEvent->flags); }-
1113 break;
never executed: break;
0
1114 case
never executed: case QWindowSystemInterfacePrivate::Close:
QWindowSystemInterfacePrivate::Close:
never executed: case QWindowSystemInterfacePrivate::Close:
0
1115 QGuiApplicationPrivate::processCloseEvent(-
1116 static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e));-
1117 break;
never executed: break;
0
1118 case
never executed: case QWindowSystemInterfacePrivate::ScreenOrientation:
QWindowSystemInterfacePrivate::ScreenOrientation:
never executed: case QWindowSystemInterfacePrivate::ScreenOrientation:
0
1119 QGuiApplicationPrivate::reportScreenOrientationChange(-
1120 static_cast<QWindowSystemInterfacePrivate::ScreenOrientationEvent *>(e));-
1121 break;
never executed: break;
0
1122 case
never executed: case QWindowSystemInterfacePrivate::ScreenGeometry:
QWindowSystemInterfacePrivate::ScreenGeometry:
never executed: case QWindowSystemInterfacePrivate::ScreenGeometry:
0
1123 QGuiApplicationPrivate::reportGeometryChange(-
1124 static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e));-
1125 break;
never executed: break;
0
1126 case
never executed: case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch:
QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch:
never executed: case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch:
0
1127 QGuiApplicationPrivate::reportLogicalDotsPerInchChange(-
1128 static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e));-
1129 break;
never executed: break;
0
1130 case
never executed: case QWindowSystemInterfacePrivate::ScreenRefreshRate:
QWindowSystemInterfacePrivate::ScreenRefreshRate:
never executed: case QWindowSystemInterfacePrivate::ScreenRefreshRate:
0
1131 QGuiApplicationPrivate::reportRefreshRateChange(-
1132 static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e));-
1133 break;
never executed: break;
0
1134 case
never executed: case QWindowSystemInterfacePrivate::ThemeChange:
QWindowSystemInterfacePrivate::ThemeChange:
never executed: case QWindowSystemInterfacePrivate::ThemeChange:
0
1135 QGuiApplicationPrivate::processThemeChanged(-
1136 static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));-
1137 break;
never executed: break;
0
1138 case
never executed: case QWindowSystemInterfacePrivate::Expose:
QWindowSystemInterfacePrivate::Expose:
never executed: case QWindowSystemInterfacePrivate::Expose:
0
1139 QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e));-
1140 break;
never executed: break;
0
1141 case
never executed: case QWindowSystemInterfacePrivate::Tablet:
QWindowSystemInterfacePrivate::Tablet:
never executed: case QWindowSystemInterfacePrivate::Tablet:
0
1142 QGuiApplicationPrivate::processTabletEvent(-
1143 static_cast<QWindowSystemInterfacePrivate::TabletEvent *>(e));-
1144 break;
never executed: break;
0
1145 case
never executed: case QWindowSystemInterfacePrivate::TabletEnterProximity:
QWindowSystemInterfacePrivate::TabletEnterProximity:
never executed: case QWindowSystemInterfacePrivate::TabletEnterProximity:
0
1146 QGuiApplicationPrivate::processTabletEnterProximityEvent(-
1147 static_cast<QWindowSystemInterfacePrivate::TabletEnterProximityEvent *>(e));-
1148 break;
never executed: break;
0
1149 case
never executed: case QWindowSystemInterfacePrivate::TabletLeaveProximity:
QWindowSystemInterfacePrivate::TabletLeaveProximity:
never executed: case QWindowSystemInterfacePrivate::TabletLeaveProximity:
0
1150 QGuiApplicationPrivate::processTabletLeaveProximityEvent(-
1151 static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e));-
1152 break;
never executed: break;
0
1153-
1154 case
never executed: case QWindowSystemInterfacePrivate::Gesture:
QWindowSystemInterfacePrivate::Gesture:
never executed: case QWindowSystemInterfacePrivate::Gesture:
0
1155 QGuiApplicationPrivate::processGestureEvent(-
1156 static_cast<QWindowSystemInterfacePrivate::GestureEvent *>(e));-
1157 break;
never executed: break;
0
1158-
1159 case
never executed: case QWindowSystemInterfacePrivate::PlatformPanel:
QWindowSystemInterfacePrivate::PlatformPanel:
never executed: case QWindowSystemInterfacePrivate::PlatformPanel:
0
1160 QGuiApplicationPrivate::processPlatformPanelEvent(-
1161 static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));-
1162 break;
never executed: break;
0
1163 case
never executed: case QWindowSystemInterfacePrivate::FileOpen:
QWindowSystemInterfacePrivate::FileOpen:
never executed: case QWindowSystemInterfacePrivate::FileOpen:
0
1164 QGuiApplicationPrivate::processFileOpenEvent(-
1165 static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e));-
1166 break;
never executed: break;
0
1167-
1168 case
never executed: case QWindowSystemInterfacePrivate::ContextMenu:
QWindowSystemInterfacePrivate::ContextMenu:
never executed: case QWindowSystemInterfacePrivate::ContextMenu:
0
1169 QGuiApplicationPrivate::processContextMenuEvent(-
1170 static_cast<QWindowSystemInterfacePrivate::ContextMenuEvent *>(e));-
1171 break;
never executed: break;
0
1172-
1173 case
never executed: case QWindowSystemInterfacePrivate::EnterWhatsThisMode:
QWindowSystemInterfacePrivate::EnterWhatsThisMode:
never executed: case QWindowSystemInterfacePrivate::EnterWhatsThisMode:
0
1174 QGuiApplication::postEvent(QGuiApplication::instance(), new QEvent(QEvent::EnterWhatsThisMode));-
1175 break;
never executed: break;
0
1176 default
never executed: default:
:
never executed: default:
0
1177 QMessageLogger(__FILE__, 1797, __PRETTY_FUNCTION__).warning() << "Unknown user input event type:" << e->type;-
1178 break;
never executed: break;
0
1179 }-
1180}-
1181-
1182void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)-
1183{-
1184 QEvent::Type type;-
1185 Qt::MouseButtons stateChange = e->buttons ^ buttons;-
1186 if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition
e->globalPos !...CursorPositionDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(stateChange != Qt::NoButton)Description
TRUEnever evaluated
FALSEnever evaluated
stateChange != Qt::NoButton)
(stateChange != Qt::NoButton)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1187-
1188-
1189-
1190 QWindowSystemInterfacePrivate::MouseEvent mouseButtonEvent(-
1191 e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers, e->source);-
1192 if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic
e->flags & QWi...ent::SyntheticDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1193 mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
never executed: mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
0
1194 e->buttons = buttons;-
1195 processMouseEvent(e);-
1196 processMouseEvent(&mouseButtonEvent);-
1197 return;
never executed: return;
0
1198 }-
1199-
1200 QWindow *window = e->window.data();-
1201 modifier_buttons = e->modifiers;-
1202-
1203 QPointF localPoint = e->localPos;-
1204 QPointF globalPoint = e->globalPos;-
1205-
1206 if (e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1207 window = QGuiApplication::topLevelAt(globalPoint.toPoint());-
1208 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1209-
1210-
1211 if (e->buttons != Qt::NoButton
e->buttons != Qt::NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1212 if (!currentMousePressWindow
!currentMousePressWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1213 currentMousePressWindow = window;
never executed: currentMousePressWindow = window;
0
1214 else-
1215 window = currentMousePressWindow;
never executed: window = currentMousePressWindow;
0
1216 } else if (currentMousePressWindow
currentMousePressWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1217 window = currentMousePressWindow;-
1218 currentMousePressWindow = 0;-
1219 }
never executed: end of block
0
1220 QPointF delta = globalPoint - globalPoint.toPoint();-
1221 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;-
1222 }
never executed: end of block
0
1223 }
never executed: end of block
0
1224-
1225 Qt::MouseButton button = Qt::NoButton;-
1226 bool doubleClick = false;-
1227 const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse;-
1228-
1229 if (QGuiApplicationPrivate::lastCursorPosition != globalPoint
QGuiApplicatio...!= globalPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1230 type = frameStrut
frameStrutDescription
TRUEnever evaluated
FALSEnever evaluated
? QEvent::NonClientAreaMouseMove : QEvent::MouseMove;
0
1231 QGuiApplicationPrivate::lastCursorPosition = globalPoint;-
1232 if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance
qAbs(globalPoi...click_distanceDescription
TRUEnever evaluated
FALSEnever evaluated
||
0
1233 qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance
qAbs(globalPoi...click_distanceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1234 mousePressButton = Qt::NoButton;
never executed: mousePressButton = Qt::NoButton;
0
1235 }
never executed: end of block
else {
0
1236 for (int check = Qt::LeftButton;-
1237 check <= int(Qt::MaxMouseButton)
check <= int(Q...axMouseButton)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1238 check = check << 1) {-
1239 if (check & stateChange
check & stateChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1240 button = Qt::MouseButton(check);-
1241 break;
never executed: break;
0
1242 }-
1243 }
never executed: end of block
0
1244 if (button == Qt::NoButton
button == Qt::NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1245-
1246 return;
never executed: return;
0
1247 }-
1248 mouse_buttons = buttons = e->buttons;-
1249 if (button & e->buttons
button & e->buttonsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1250 ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval());-
1251 doubleClick = e->timestamp - mousePressTime < doubleClickInterval
e->timestamp -...eClickIntervalDescription
TRUEnever evaluated
FALSEnever evaluated
&& button == mousePressButton
button == mousePressButtonDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1252 type = frameStrut
frameStrutDescription
TRUEnever evaluated
FALSEnever evaluated
? QEvent::NonClientAreaMouseButtonPress : QEvent::MouseButtonPress;
0
1253 mousePressTime = e->timestamp;-
1254 mousePressButton = button;-
1255 const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint();-
1256 mousePressX = point.x();-
1257 mousePressY = point.y();-
1258 }
never executed: end of block
else {
0
1259 type = frameStrut
frameStrutDescription
TRUEnever evaluated
FALSEnever evaluated
? QEvent::NonClientAreaMouseButtonRelease : QEvent::MouseButtonRelease;
0
1260 }
never executed: end of block
0
1261 }-
1262-
1263 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1264 return;
never executed: return;
0
1265-
1266-
1267 if (!e->synthetic()
!e->synthetic()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1268 if (const
const QScreen ...ndow->screen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = window->screen()
const QScreen ...ndow->screen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1269 if (QPlatformCursor *cursor = screen->handle()->cursor()
QPlatformCurso...le()->cursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1270 const QPointF nativeLocalPoint = QHighDpi::toNativePixels(localPoint, screen);-
1271 const QPointF nativeGlobalPoint = QHighDpi::toNativePixels(globalPoint, screen);-
1272 QMouseEvent ev(type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint,-
1273 button, buttons, e->modifiers, e->source);-
1274 ev.setTimestamp(e->timestamp);-
1275 cursor->pointerEvent(ev);-
1276 }
never executed: end of block
0
1277 }
never executed: end of block
0
1278-
1279-
1280 QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source);-
1281 ev.setTimestamp(e->timestamp);-
1282-
1283 if (window->d_func()->blockedByModalWindow
window->d_func...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1284-
1285 return;
never executed: return;
0
1286 }-
1287-
1288 if (doubleClick
doubleClickDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(ev.type() == ...seButtonPress)Description
TRUEnever evaluated
FALSEnever evaluated
ev.type() == QEvent::MouseButtonPress)
(ev.type() == ...seButtonPress)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1289-
1290 setMouseEventFlags(&ev, ev.flags() | Qt::MouseEventCreatedDoubleClick);-
1291 }
never executed: end of block
0
1292-
1293 QGuiApplication::sendSpontaneousEvent(window, &ev);-
1294 e->eventAccepted = ev.isAccepted();-
1295 if (!e->synthetic()
!e->synthetic()Description
TRUEnever evaluated
FALSEnever evaluated
&& !ev.isAccepted()
!ev.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
0
1296 && !frameStrut
!frameStrutDescription
TRUEnever evaluated
FALSEnever evaluated
0
1297 && (static_cast<
(static_cast<Q...edMouseEvents)Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)
(static_cast<Q...edMouseEvents)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1298 if (!m_fakeTouchDevice
!m_fakeTouchDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1299 m_fakeTouchDevice = new QTouchDevice;-
1300 QWindowSystemInterface::registerTouchDevice(m_fakeTouchDevice);-
1301 }
never executed: end of block
0
1302 QList<QWindowSystemInterface::TouchPoint> points;-
1303 QWindowSystemInterface::TouchPoint point;-
1304 point.id = 1;-
1305 point.area = QRectF(globalPoint.x() - 2, globalPoint.y() - 2, 4, 4);-
1306-
1307-
1308-
1309-
1310 if (type == QEvent::MouseButtonPress
type == QEvent...useButtonPressDescription
TRUEnever evaluated
FALSEnever evaluated
&& button == Qt::LeftButton
button == Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1311 point.state = Qt::TouchPointPressed;-
1312 }
never executed: end of block
else if (type == QEvent::MouseButtonRelease
type == QEvent...eButtonReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& button == Qt::LeftButton
button == Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1313 point.state = Qt::TouchPointReleased;-
1314 }
never executed: end of block
else if (type == QEvent::MouseMove
type == QEvent::MouseMoveDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(buttons & Qt::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
buttons & Qt::LeftButton)
(buttons & Qt::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1315 point.state = Qt::TouchPointMoved;-
1316 }
never executed: end of block
else {
0
1317 return;
never executed: return;
0
1318 }-
1319-
1320 points << point;-
1321-
1322 QEvent::Type type;-
1323 QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::fromNativeTouchPoints(points, window, &type);-
1324-
1325 QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers);-
1326 fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;-
1327 processTouchEvent(&fake);-
1328 }
never executed: end of block
0
1329 if (doubleClick
doubleClickDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1330 mousePressButton = Qt::NoButton;-
1331 if (!e->window.isNull()
!e->window.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1332 const QEvent::Type doubleClickType = frameStrut
frameStrutDescription
TRUEnever evaluated
FALSEnever evaluated
? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
0
1333 QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,-
1334 button, buttons, e->modifiers, e->source);-
1335 dblClickEvent.setTimestamp(e->timestamp);-
1336 QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);-
1337 }
never executed: end of block
0
1338 }
never executed: end of block
0
1339}
never executed: end of block
0
1340-
1341void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)-
1342{-
1343-
1344 QWindow *window = e->window.data();-
1345 QPointF globalPoint = e->globalPos;-
1346 QPointF localPoint = e->localPos;-
1347-
1348 if (e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1349 window = QGuiApplication::topLevelAt(globalPoint.toPoint());-
1350 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1351 QPointF delta = globalPoint - globalPoint.toPoint();-
1352 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;-
1353 }
never executed: end of block
0
1354 }
never executed: end of block
0
1355-
1356 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1357 return;
never executed: return;
0
1358-
1359 QGuiApplicationPrivate::lastCursorPosition = globalPoint;-
1360 modifier_buttons = e->modifiers;-
1361-
1362 if (window->d_func()->blockedByModalWindow
window->d_func...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1363-
1364 return;
never executed: return;
0
1365 }-
1366-
1367 QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation,-
1368 buttons, e->modifiers, e->phase, e->source, e->inverted);-
1369 ev.setTimestamp(e->timestamp);-
1370 QGuiApplication::sendSpontaneousEvent(window, &ev);-
1371-
1372}
never executed: end of block
0
1373-
1374-
1375-
1376void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)-
1377{-
1378 QWindow *window = e->window.data();-
1379 modifier_buttons = e->modifiers;-
1380 if (e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
1381-
1382-
1383-
1384 ) {-
1385 window = QGuiApplication::focusWindow();-
1386 }
never executed: end of block
0
1387-
1388-
1389-
1390-
1391 if (e->keyType == QEvent::KeyPress
e->keyType == QEvent::KeyPressDescription
TRUEnever evaluated
FALSEnever evaluated
&& window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1392 if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
QWindowSystemI...->repeatCount)Description
TRUEnever evaluated
FALSEnever evaluated
0
1393 e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)
QWindowSystemI...->repeatCount)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1394 return;
never executed: return;
0
1395 }
never executed: end of block
0
1396-
1397-
1398 QKeyEvent ev(e->keyType, e->key, e->modifiers,-
1399 e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,-
1400 e->unicode, e->repeat, e->repeatCount);-
1401 ev.setTimestamp(e->timestamp);-
1402-
1403-
1404-
1405 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
&& !window->d_func()->blockedByModalWindow
!window->d_fun...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1406 QGuiApplication::sendSpontaneousEvent(window, &ev);
never executed: QGuiApplication::sendSpontaneousEvent(window, &ev);
0
1407 e->eventAccepted = ev.isAccepted();-
1408}
never executed: end of block
0
1409-
1410void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)-
1411{-
1412 if (!e->enter
!e->enterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1413 return;
never executed: return;
0
1414 if (e->enter.data()->d_func()->blockedByModalWindow
e->enter.data(...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1415-
1416 return;
never executed: return;
0
1417 }-
1418-
1419 currentMouseWindow = e->enter;-
1420-
1421 QEnterEvent event(e->localPos, e->localPos, e->globalPos);-
1422 QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event);-
1423}
never executed: end of block
0
1424-
1425void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e)-
1426{-
1427 if (!e->leave
!e->leaveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1428 return;
never executed: return;
0
1429 if (e->leave.data()->d_func()->blockedByModalWindow
e->leave.data(...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1430-
1431 return;
never executed: return;
0
1432 }-
1433-
1434 currentMouseWindow = 0;-
1435-
1436 QEvent event(QEvent::Leave);-
1437 QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);-
1438}
never executed: end of block
0
1439-
1440void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)-
1441{-
1442 QWindow *previous = QGuiApplicationPrivate::focus_window;-
1443 QWindow *newFocus = e->activated.data();-
1444-
1445 if (previous == newFocus
previous == newFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1446 return;
never executed: return;
0
1447-
1448 if (newFocus
newFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1449 if (QPlatformWindow *platformWindow = newFocus->handle()
QPlatformWindo...ocus->handle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1450 if (platformWindow->isAlertState()
platformWindow->isAlertState()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1451 platformWindow->setAlertState(false);
never executed: platformWindow->setAlertState(false);
0
1452-
1453 QObject *previousFocusObject = previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
? previous->focusObject() : 0;
0
1454-
1455 if (previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1456 QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);-
1457 QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);-
1458 }
never executed: end of block
0
1459-
1460 QGuiApplicationPrivate::focus_window = newFocus;-
1461 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))
!(static_cast<...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1462 return;
never executed: return;
0
1463-
1464 if (previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1465 Qt::FocusReason r = e->reason;-
1466 if ((r == Qt::OtherFocusReason
r == Qt::OtherFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
|| r == Qt::ActiveWindowFocusReason
r == Qt::Activ...dowFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
) &&
0
1467 newFocus
newFocusDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(newFocus->fla...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
newFocus->flags() & Qt::Popup) == Qt::Popup
(newFocus->fla...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1468 r = Qt::PopupFocusReason;
never executed: r = Qt::PopupFocusReason;
0
1469 QFocusEvent focusOut(QEvent::FocusOut, r);-
1470 QCoreApplication::sendSpontaneousEvent(previous, &focusOut);-
1471 QObject::disconnect(previous, qFlagLocation("2""focusObjectChanged(QObject*)" "\0" __FILE__ ":" "2109"),-
1472 (static_cast<QGuiApplication *>(QCoreApplication::instance())), qFlagLocation("1""_q_updateFocusObject(QObject*)" "\0" __FILE__ ":" "2110"));-
1473 }
never executed: end of block
else if (!platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)
!platformInteg...licationState)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1474 setApplicationState(Qt::ApplicationActive);-
1475 }
never executed: end of block
0
1476-
1477 if (QGuiApplicationPrivate::focus_window
QGuiApplicatio...::focus_windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1478 Qt::FocusReason r = e->reason;-
1479 if ((r == Qt::OtherFocusReason
r == Qt::OtherFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
|| r == Qt::ActiveWindowFocusReason
r == Qt::Activ...dowFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
) &&
0
1480 previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(previous->fla...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
previous->flags() & Qt::Popup) == Qt::Popup
(previous->fla...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1481 r = Qt::PopupFocusReason;
never executed: r = Qt::PopupFocusReason;
0
1482 QFocusEvent focusIn(QEvent::FocusIn, r);-
1483 QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn);-
1484 QObject::connect(QGuiApplicationPrivate::focus_window, qFlagLocation("2""focusObjectChanged(QObject*)" "\0" __FILE__ ":" "2122"),-
1485 (static_cast<QGuiApplication *>(QCoreApplication::instance())), qFlagLocation("1""_q_updateFocusObject(QObject*)" "\0" __FILE__ ":" "2123"));-
1486 }
never executed: end of block
else if (!platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)
!platformInteg...licationState)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1487 setApplicationState(Qt::ApplicationInactive);-
1488 }
never executed: end of block
0
1489-
1490 if (self
selfDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1491 self->notifyActiveWindowChange(previous);-
1492-
1493 if (previousFocusObject != (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()
previousFocusO...>focusObject()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1494 self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject());
never executed: self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject());
0
1495 }
never executed: end of block
0
1496-
1497 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusWindowChanged(newFocus);-
1498 if (previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1499 previous->activeChanged();
never executed: previous->activeChanged();
0
1500 if (newFocus
newFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1501 newFocus->activeChanged();
never executed: newFocus->activeChanged();
0
1502}
never executed: end of block
0
1503-
1504void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse)-
1505{-
1506 if (QWindow *window = wse->window.data()
QWindow *windo...>window.data()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1507 QWindowStateChangeEvent e(window->windowState());-
1508 window->d_func()->windowState = wse->newState;-
1509 QGuiApplication::sendSpontaneousEvent(window, &e);-
1510 }
never executed: end of block
0
1511}
never executed: end of block
0
1512-
1513void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)-
1514{-
1515 if (QWindow *window = wse->window.data()
QWindow *windo...>window.data()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1516 if (window->isTopLevel()
window->isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1517 if (QScreen *screen = wse->screen.data()
QScreen *scree...>screen.data()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1518 window->d_func()->setTopLevelScreen(screen, false );
never executed: window->d_func()->setTopLevelScreen(screen, false );
0
1519 else-
1520 window->setScreen(0);
never executed: window->setScreen(0);
0
1521 }-
1522-
1523 if (window->handle()
window->handle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1524 QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect());-
1525 processGeometryChangeEvent(&gce);-
1526 }
never executed: end of block
0
1527 }
never executed: end of block
0
1528}
never executed: end of block
0
1529-
1530void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce)-
1531{-
1532 if (self
selfDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1533 self->notifyThemeChanged();
never executed: self->notifyThemeChanged();
0
1534 if (QWindow *window = tce->window.data()
QWindow *windo...>window.data()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1535 QEvent e(QEvent::ThemeChange);-
1536 QGuiApplication::sendSpontaneousEvent(window, &e);-
1537 }
never executed: end of block
0
1538}
never executed: end of block
0
1539-
1540void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)-
1541{-
1542 if (e->tlw.isNull()
e->tlw.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1543 return;
never executed: return;
0
1544-
1545 QWindow *window = e->tlw.data();-
1546 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1547 return;
never executed: return;
0
1548-
1549 QRect newRect = e->newGeometry;-
1550 QRect oldRect = e->oldGeometry.isNull()
e->oldGeometry.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
? window->d_func()->geometry : e->oldGeometry;
0
1551-
1552 bool isResize = oldRect.size() != newRect.size();-
1553 bool isMove = oldRect.topLeft() != newRect.topLeft();-
1554-
1555 window->d_func()->geometry = newRect;-
1556-
1557 if (isResize
isResizeDescription
TRUEnever evaluated
FALSEnever evaluated
|| window->d_func()->resizeEventPending
window->d_func...zeEventPendingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1558 QResizeEvent e(newRect.size(), oldRect.size());-
1559 QGuiApplication::sendSpontaneousEvent(window, &e);-
1560-
1561 window->d_func()->resizeEventPending = false;-
1562-
1563 if (oldRect.width() != newRect.width()
oldRect.width(...ewRect.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1564 window->widthChanged(newRect.width());
never executed: window->widthChanged(newRect.width());
0
1565 if (oldRect.height() != newRect.height()
oldRect.height...wRect.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1566 window->heightChanged(newRect.height());
never executed: window->heightChanged(newRect.height());
0
1567 }
never executed: end of block
0
1568-
1569 if (isMove
isMoveDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1570-
1571 QMoveEvent e(newRect.topLeft(), oldRect.topLeft());-
1572 QGuiApplication::sendSpontaneousEvent(window, &e);-
1573-
1574 if (oldRect.x() != newRect.x()
oldRect.x() != newRect.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1575 window->xChanged(newRect.x());
never executed: window->xChanged(newRect.x());
0
1576 if (oldRect.y() != newRect.y()
oldRect.y() != newRect.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1577 window->yChanged(newRect.y());
never executed: window->yChanged(newRect.y());
0
1578 }
never executed: end of block
0
1579}
never executed: end of block
0
1580-
1581void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e)-
1582{-
1583 if (e->window.isNull()
e->window.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1584 return;
never executed: return;
0
1585 if (e->window.data()->d_func()->blockedByModalWindow
e->window.data...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1586-
1587 return;
never executed: return;
0
1588 }-
1589-
1590 QCloseEvent event;-
1591 QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);-
1592 if (e->accepted
e->acceptedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1593 *(e->accepted) = event.isAccepted();-
1594 }
never executed: end of block
0
1595}
never executed: end of block
0
1596-
1597void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e)-
1598{-
1599 if (e->url.isEmpty()
e->url.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1600 return;
never executed: return;
0
1601-
1602 QFileOpenEvent event(e->url);-
1603 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event);-
1604}
never executed: end of block
0
1605-
1606QGuiApplicationPrivate::TabletPointData &QGuiApplicationPrivate::tabletDevicePoint(qint64 deviceId)-
1607{-
1608 for (int i = 0; i < tabletDevicePoints.size()
i < tabletDevicePoints.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1609 TabletPointData &pointData = tabletDevicePoints[i];-
1610 if (pointData.deviceId == deviceId
pointData.deviceId == deviceIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1611 return
never executed: return pointData;
pointData;
never executed: return pointData;
0
1612 }
never executed: end of block
0
1613-
1614 tabletDevicePoints.append(TabletPointData(deviceId));-
1615 return
never executed: return tabletDevicePoints.last();
tabletDevicePoints.last();
never executed: return tabletDevicePoints.last();
0
1616}-
1617-
1618void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e)-
1619{-
1620-
1621 TabletPointData &pointData = tabletDevicePoint(e->uid);-
1622-
1623 QEvent::Type type = QEvent::TabletMove;-
1624 if (e->buttons != pointData.state
e->buttons != pointData.stateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1625 type = (
(e->buttons > pointData.state)Description
TRUEnever evaluated
FALSEnever evaluated
e->buttons > pointData.state)
(e->buttons > pointData.state)Description
TRUEnever evaluated
FALSEnever evaluated
? QEvent::TabletPress : QEvent::TabletRelease;
never executed: type = (e->buttons > pointData.state) ? QEvent::TabletPress : QEvent::TabletRelease;
0
1626-
1627 QWindow *window = e->window.data();-
1628 modifier_buttons = e->modifiers;-
1629-
1630 bool localValid = true;-
1631-
1632-
1633-
1634 if (type == QEvent::TabletPress
type == QEvent::TabletPressDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1635 if (e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1636 window = QGuiApplication::topLevelAt(e->global.toPoint());-
1637 localValid = false;-
1638 }
never executed: end of block
0
1639 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1640 return;
never executed: return;
0
1641 pointData.target = window;-
1642 }
never executed: end of block
else {
0
1643 if (e->nullWindow()
e->nullWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1644 window = pointData.target;-
1645 localValid = false;-
1646 }
never executed: end of block
0
1647 if (type == QEvent::TabletRelease
type == QEvent::TabletReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1648 pointData.target = nullptr;
never executed: pointData.target = nullptr;
0
1649 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1650 return;
never executed: return;
0
1651 }
never executed: end of block
0
1652 QPointF local = e->local;-
1653 if (!localValid
!localValidDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1654 QPointF delta = e->global - e->global.toPoint();-
1655 local = window->mapFromGlobal(e->global.toPoint()) + delta;-
1656 }
never executed: end of block
0
1657 Qt::MouseButtons stateChange = e->buttons ^ pointData.state;-
1658 Qt::MouseButton button = Qt::NoButton;-
1659 for (int check = Qt::LeftButton; check <= int(Qt::MaxMouseButton)
check <= int(Q...axMouseButton)Description
TRUEnever evaluated
FALSEnever evaluated
; check = check << 1) {
0
1660 if (check & stateChange
check & stateChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1661 button = Qt::MouseButton(check);-
1662 break;
never executed: break;
0
1663 }-
1664 }
never executed: end of block
0
1665 QTabletEvent ev(type, local, e->global,-
1666 e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt,-
1667 e->tangentialPressure, e->rotation, e->z,-
1668 e->modifiers, e->uid, button, e->buttons);-
1669 ev.setAccepted(false);-
1670 ev.setTimestamp(e->timestamp);-
1671 QGuiApplication::sendSpontaneousEvent(window, &ev);-
1672 pointData.state = e->buttons;-
1673 if (!ev.isAccepted()
!ev.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& !QWindowSystemInterfacePrivate::TabletEvent::platformSynthesizesMouse
!QWindowSystem...nthesizesMouseDescription
TRUEnever evaluated
FALSEnever evaluated
0
1674 && (static_cast<
(static_cast<Q...dTabletEvents)Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents)
(static_cast<Q...dTabletEvents)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1675 QWindowSystemInterfacePrivate::MouseEvent fake(window, e->timestamp, e->local, e->global,-
1676 e->buttons, e->modifiers, Qt::MouseEventSynthesizedByQt);-
1677 fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;-
1678 processMouseEvent(&fake);-
1679 }
never executed: end of block
0
1680-
1681-
1682-
1683}
never executed: end of block
0
1684-
1685void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e)-
1686{-
1687-
1688 QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(),-
1689 e->device, e->pointerType, 0, 0, 0,-
1690 0, 0, 0,-
1691 Qt::NoModifier, e->uid, Qt::NoButton, tabletDevicePoint(e->uid).state);-
1692 ev.setTimestamp(e->timestamp);-
1693 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev);-
1694-
1695-
1696-
1697}
never executed: end of block
0
1698-
1699void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e)-
1700{-
1701-
1702 QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(),-
1703 e->device, e->pointerType, 0, 0, 0,-
1704 0, 0, 0,-
1705 Qt::NoModifier, e->uid, Qt::NoButton, tabletDevicePoint(e->uid).state);-
1706 ev.setTimestamp(e->timestamp);-
1707 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev);-
1708-
1709-
1710-
1711}
never executed: end of block
0
1712-
1713-
1714void QGuiApplicationPrivate::processGestureEvent(QWindowSystemInterfacePrivate::GestureEvent *e)-
1715{-
1716 if (e->window.isNull()
e->window.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1717 return;
never executed: return;
0
1718-
1719 QNativeGestureEvent ev(e->type, e->pos, e->pos, e->globalPos, e->realValue, e->sequenceId, e->intValue);-
1720 ev.setTimestamp(e->timestamp);-
1721 QGuiApplication::sendSpontaneousEvent(e->window, &ev);-
1722}
never executed: end of block
0
1723-
1724-
1725void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e)-
1726{-
1727 if (!e->window
!e->windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1728 return;
never executed: return;
0
1729-
1730 if (e->window->d_func()->blockedByModalWindow
e->window->d_f...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1731-
1732 return;
never executed: return;
0
1733 }-
1734-
1735 QEvent ev(QEvent::PlatformPanel);-
1736 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);-
1737}
never executed: end of block
0
1738-
1739-
1740void QGuiApplicationPrivate::processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e)-
1741{-
1742-
1743-
1744 if (!e->window
!e->windowDescription
TRUEnever evaluated
FALSEnever evaluated
|| e->mouseTriggered
e->mouseTriggeredDescription
TRUEnever evaluated
FALSEnever evaluated
|| e->window->d_func()->blockedByModalWindow
e->window->d_f...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1745 return;
never executed: return;
0
1746-
1747 QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers);-
1748 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);-
1749}
never executed: end of block
0
1750-
1751-
1752__attribute__((visibility("default"))) uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k)-
1753{-
1754 return
never executed: return qHash(k.device) + k.touchPointId;
qHash(k.device) + k.touchPointId;
never executed: return qHash(k.device) + k.touchPointId;
0
1755}-
1756-
1757__attribute__((visibility("default"))) bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey &a,-
1758 const QGuiApplicationPrivate::ActiveTouchPointsKey &b)-
1759{-
1760 return
never executed: return a.device == b.device && a.touchPointId == b.touchPointId;
a.device == b.device
never executed: return a.device == b.device && a.touchPointId == b.touchPointId;
0
1761 && a.touchPointId == b.touchPointId;
never executed: return a.device == b.device && a.touchPointId == b.touchPointId;
0
1762}-
1763-
1764void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e)-
1765{-
1766 QGuiApplicationPrivate *d = self;-
1767 modifier_buttons = e->modifiers;-
1768-
1769 if (e->touchType == QEvent::TouchCancel
e->touchType =...t::TouchCancelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1770-
1771-
1772 QTouchEvent touchEvent(QEvent::TouchCancel, e->device, e->modifiers);-
1773 touchEvent.setTimestamp(e->timestamp);-
1774 QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it-
1775 = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd();-
1776 QSet<QWindow *> windowsNeedingCancel;-
1777 while (it != ite
it != iteDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1778 QWindow *w = it->window.data();-
1779 if (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1780 windowsNeedingCancel.insert(w);
never executed: windowsNeedingCancel.insert(w);
0
1781 ++it;-
1782 }
never executed: end of block
0
1783 for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(),-
1784 winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd
winIt != winItEndDescription
TRUEnever evaluated
FALSEnever evaluated
; ++winIt) {
0
1785 touchEvent.setWindow(*winIt);-
1786 QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent);-
1787 }
never executed: end of block
0
1788 if (!self->synthesizedMousePoints.isEmpty()
!self->synthes...ints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !e->synthetic()
!e->synthetic()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1789 for (QHash<QWindow *, SynthesizedMouseData>::const_iterator synthIt = self->synthesizedMousePoints.constBegin(),-
1790 synthItEnd = self->synthesizedMousePoints.constEnd(); synthIt != synthItEnd
synthIt != synthItEndDescription
TRUEnever evaluated
FALSEnever evaluated
; ++synthIt) {
0
1791 if (!synthIt->window
!synthIt->windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1792 continue;
never executed: continue;
0
1793 QWindowSystemInterfacePrivate::MouseEvent fake(synthIt->window.data(),-
1794 e->timestamp,-
1795 synthIt->pos,-
1796 synthIt->screenPos,-
1797 buttons & ~Qt::LeftButton,-
1798 e->modifiers,-
1799 Qt::MouseEventSynthesizedByQt);-
1800 fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;-
1801 processMouseEvent(&fake);-
1802 }
never executed: end of block
0
1803 self->synthesizedMousePoints.clear();-
1804 }
never executed: end of block
0
1805 self->activeTouchPoints.clear();-
1806 self->lastTouchType = e->touchType;-
1807 return;
never executed: return;
0
1808 }-
1809-
1810-
1811 if (self->lastTouchType == QEvent::TouchCancel
self->lastTouc...t::TouchCancelDescription
TRUEnever evaluated
FALSEnever evaluated
&& e->touchType != QEvent::TouchBegin
e->touchType !...nt::TouchBeginDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1812 return;
never executed: return;
0
1813-
1814 self->lastTouchType = e->touchType;-
1815-
1816 QWindow *window = e->window.data();-
1817 typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;-
1818 QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;-
1819-
1820 for (int i = 0; i < e->points.count()
i < e->points.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1821 QTouchEvent::TouchPoint touchPoint = e->points.at(i);-
1822-
1823-
1824-
1825 touchPoint.d = touchPoint.d->detach();-
1826-
1827-
1828 QPointer<QWindow> w;-
1829 QTouchEvent::TouchPoint previousTouchPoint;-
1830 ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id());-
1831 ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey];-
1832 switch (touchPoint.state()) {-
1833 case
never executed: case Qt::TouchPointPressed:
Qt::TouchPointPressed:
never executed: case Qt::TouchPointPressed:
0
1834 if (e->device->type() == QTouchDevice::TouchPad
e->device->typ...vice::TouchPadDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1835-
1836 w = d->activeTouchPoints.isEmpty()
d->activeTouchPoints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
1837 ? QPointer<QWindow>()-
1838 : d->activeTouchPoints.constBegin().value().window;-
1839 }
never executed: end of block
0
1840-
1841 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1842-
1843 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1844 window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
never executed: window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
0
1845 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1846 continue;
never executed: continue;
0
1847 w = window;-
1848 }
never executed: end of block
0
1849-
1850 touchInfo.window = w;-
1851 touchPoint.d->startScreenPos = touchPoint.screenPos();-
1852 touchPoint.d->lastScreenPos = touchPoint.screenPos();-
1853 touchPoint.d->startNormalizedPos = touchPoint.normalizedPos();-
1854 touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos();-
1855 if (touchPoint.pressure() < qreal(0.)
touchPoint.pre...() < qreal(0.)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1856 touchPoint.d->pressure = qreal(1.);
never executed: touchPoint.d->pressure = qreal(1.);
0
1857-
1858 touchInfo.touchPoint = touchPoint;-
1859 break;
never executed: break;
0
1860-
1861 case
never executed: case Qt::TouchPointReleased:
Qt::TouchPointReleased:
never executed: case Qt::TouchPointReleased:
0
1862 w = touchInfo.window;-
1863 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1864 continue;
never executed: continue;
0
1865-
1866 previousTouchPoint = touchInfo.touchPoint;-
1867 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();-
1868 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();-
1869 touchPoint.d->startPos = previousTouchPoint.startPos();-
1870 touchPoint.d->lastPos = previousTouchPoint.pos();-
1871 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();-
1872 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();-
1873 if (touchPoint.pressure() < qreal(0.)
touchPoint.pre...() < qreal(0.)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1874 touchPoint.d->pressure = qreal(0.);
never executed: touchPoint.d->pressure = qreal(0.);
0
1875-
1876 break;
never executed: break;
0
1877-
1878 default
never executed: default:
:
never executed: default:
0
1879 w = touchInfo.window;-
1880 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1881 continue;
never executed: continue;
0
1882-
1883 previousTouchPoint = touchInfo.touchPoint;-
1884 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();-
1885 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();-
1886 touchPoint.d->startPos = previousTouchPoint.startPos();-
1887 touchPoint.d->lastPos = previousTouchPoint.pos();-
1888 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();-
1889 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();-
1890 if (touchPoint.pressure() < qreal(0.)
touchPoint.pre...() < qreal(0.)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1891 touchPoint.d->pressure = qreal(1.);
never executed: touchPoint.d->pressure = qreal(1.);
0
1892-
1893-
1894-
1895 if (touchPoint.state() != Qt::TouchPointStationary
touchPoint.sta...ointStationaryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1896 touchInfo.touchPoint = touchPoint;
never executed: touchInfo.touchPoint = touchPoint;
0
1897 break;
never executed: break;
0
1898 }-
1899-
1900 ((!(w.data() != 0)) ? qt_assert("w.data() != 0",__FILE__,2538) : qt_noop());-
1901-
1902-
1903 touchPoint.d->sceneRect = touchPoint.screenRect();-
1904 touchPoint.d->startScenePos = touchPoint.startScreenPos();-
1905 touchPoint.d->lastScenePos = touchPoint.lastScreenPos();-
1906-
1907 StatesAndTouchPoints &maskAndPoints = windowsNeedingEvents[w.data()];-
1908 maskAndPoints.first |= touchPoint.state();-
1909 maskAndPoints.second.append(touchPoint);-
1910 }
never executed: end of block
0
1911-
1912 if (windowsNeedingEvents.isEmpty()
windowsNeedingEvents.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1913 return;
never executed: return;
0
1914-
1915 QHash<QWindow *, StatesAndTouchPoints>::ConstIterator it = windowsNeedingEvents.constBegin();-
1916 const QHash<QWindow *, StatesAndTouchPoints>::ConstIterator end = windowsNeedingEvents.constEnd();-
1917 for (; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1918 QWindow *w = it.key();-
1919-
1920 QEvent::Type eventType;-
1921 switch (it.value().first) {-
1922 case
never executed: case Qt::TouchPointPressed:
Qt::TouchPointPressed:
never executed: case Qt::TouchPointPressed:
0
1923 eventType = QEvent::TouchBegin;-
1924 break;
never executed: break;
0
1925 case
never executed: case Qt::TouchPointReleased:
Qt::TouchPointReleased:
never executed: case Qt::TouchPointReleased:
0
1926 eventType = QEvent::TouchEnd;-
1927 break;
never executed: break;
0
1928 case
never executed: case Qt::TouchPointStationary:
Qt::TouchPointStationary:
never executed: case Qt::TouchPointStationary:
0
1929-
1930 continue;
never executed: continue;
0
1931 default
never executed: default:
:
never executed: default:
0
1932 eventType = QEvent::TouchUpdate;-
1933 break;
never executed: break;
0
1934 }-
1935-
1936 if (w->d_func()->blockedByModalWindow
w->d_func()->b...dByModalWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1937-
1938-
1939-
1940 if (eventType == QEvent::TouchEnd
eventType == QEvent::TouchEndDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1941-
1942-
1943 QTouchEvent touchEvent(QEvent::TouchCancel,-
1944 e->device,-
1945 e->modifiers);-
1946 touchEvent.setTimestamp(e->timestamp);-
1947 touchEvent.setWindow(w);-
1948 QGuiApplication::sendSpontaneousEvent(w, &touchEvent);-
1949 }
never executed: end of block
0
1950 continue;
never executed: continue;
0
1951 }-
1952-
1953 QTouchEvent touchEvent(eventType,-
1954 e->device,-
1955 e->modifiers,-
1956 it.value().first,-
1957 it.value().second);-
1958 touchEvent.setTimestamp(e->timestamp);-
1959 touchEvent.setWindow(w);-
1960-
1961 const int pointCount = touchEvent.touchPoints().count();-
1962 for (int i = 0; i < pointCount
i < pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1963 QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i];-
1964-
1965-
1966 QRectF rect = touchPoint.screenRect();-
1967 const QPointF screenPos = rect.center();-
1968 const QPointF delta = screenPos - screenPos.toPoint();-
1969-
1970 rect.moveCenter(w->mapFromGlobal(screenPos.toPoint()) + delta);-
1971 touchPoint.d->rect = rect;-
1972 if (touchPoint.state() == Qt::TouchPointPressed
touchPoint.sta...chPointPressedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1973 touchPoint.d->startPos = w->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta;-
1974 touchPoint.d->lastPos = w->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta;-
1975 }
never executed: end of block
0
1976 }
never executed: end of block
0
1977-
1978 QGuiApplication::sendSpontaneousEvent(w, &touchEvent);-
1979 if (!e->synthetic()
!e->synthetic()Description
TRUEnever evaluated
FALSEnever evaluated
&& !touchEvent.isAccepted()
!touchEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& (static_cast<
(static_cast<Q...edTouchEvents)Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)
(static_cast<Q...edTouchEvents)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1980-
1981 if (!(touchEvent.device()->capabilities() & QTouchDevice::MouseEmulation)
!(touchEvent.d...ouseEmulation)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1982 Qt::MouseButtons b = eventType == QEvent::TouchEnd
eventType == QEvent::TouchEndDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::NoButton : Qt::LeftButton;
0
1983 if (b == Qt::NoButton
b == Qt::NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1984 self->synthesizedMousePoints.clear();
never executed: self->synthesizedMousePoints.clear();
0
1985-
1986 const QList<QTouchEvent::TouchPoint> &touchPoints = touchEvent.touchPoints();-
1987 if (eventType == QEvent::TouchBegin
eventType == Q...nt::TouchBeginDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1988 m_fakeMouseSourcePointId = touchPoints.first().id();
never executed: m_fakeMouseSourcePointId = touchPoints.first().id();
0
1989-
1990 for (int i = 0; i < touchPoints.count()
i < touchPoints.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1991 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);-
1992 if (touchPoint.id() == m_fakeMouseSourcePointId
touchPoint.id(...eSourcePointIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1993 if (b != Qt::NoButton
b != Qt::NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1994 self->synthesizedMousePoints.insert(w, SynthesizedMouseData(
never executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w));
0
1995 touchPoint.pos(), touchPoint.screenPos(), w));
never executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w));
0
1996 QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,-
1997 touchPoint.pos(),-
1998 touchPoint.screenPos(),-
1999 b | (buttons & ~Qt::LeftButton),-
2000 e->modifiers,-
2001 Qt::MouseEventSynthesizedByQt);-
2002 fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;-
2003 processMouseEvent(&fake);-
2004 break;
never executed: break;
0
2005 }-
2006 }
never executed: end of block
0
2007 }
never executed: end of block
0
2008 }
never executed: end of block
0
2009 }
never executed: end of block
0
2010-
2011-
2012-
2013-
2014-
2015 for (int i = 0; i < e->points.count()
i < e->points.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2016 QTouchEvent::TouchPoint touchPoint = e->points.at(i);-
2017 if (touchPoint.state() == Qt::TouchPointReleased
touchPoint.sta...hPointReleasedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2018 d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
never executed: d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
0
2019 }
never executed: end of block
0
2020}
never executed: end of block
0
2021-
2022void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e)-
2023{-
2024-
2025 if (QCoreApplication::startingUp()
QCoreApplication::startingUp()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2026 return;
never executed: return;
0
2027-
2028 if (!e->screen
!e->screenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2029 return;
never executed: return;
0
2030-
2031 QScreen *s = e->screen.data();-
2032 s->d_func()->orientation = e->orientation;-
2033-
2034 updateFilteredScreenOrientation(s);-
2035}
never executed: end of block
0
2036-
2037void QGuiApplicationPrivate::updateFilteredScreenOrientation(QScreen *s)-
2038{-
2039 Qt::ScreenOrientation o = s->d_func()->orientation;-
2040 if (o == Qt::PrimaryOrientation
o == Qt::PrimaryOrientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2041 o = s->primaryOrientation();
never executed: o = s->primaryOrientation();
0
2042 o = Qt::ScreenOrientation(o & s->orientationUpdateMask());-
2043 if (o == Qt::PrimaryOrientation
o == Qt::PrimaryOrientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2044 return;
never executed: return;
0
2045 if (o == s->d_func()->filteredOrientation
o == s->d_func...redOrientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2046 return;
never executed: return;
0
2047 s->d_func()->filteredOrientation = o;-
2048 reportScreenOrientationChange(s);-
2049}
never executed: end of block
0
2050-
2051void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s)-
2052{-
2053 s->orientationChanged(s->orientation());-
2054-
2055 QScreenOrientationChangeEvent event(s, s->orientation());-
2056 QCoreApplication::sendEvent(QCoreApplication::instance(), &event);-
2057}
never executed: end of block
0
2058-
2059void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e)-
2060{-
2061-
2062 if (QCoreApplication::startingUp()
QCoreApplication::startingUp()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2063 return;
never executed: return;
0
2064-
2065 if (!e->screen
!e->screenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2066 return;
never executed: return;
0
2067-
2068 QScreen *s = e->screen.data();-
2069-
2070 bool geometryChanged = e->geometry != s->d_func()->geometry;-
2071 s->d_func()->geometry = e->geometry;-
2072-
2073 bool availableGeometryChanged = e->availableGeometry != s->d_func()->availableGeometry;-
2074 s->d_func()->availableGeometry = e->availableGeometry;-
2075-
2076 if (geometryChanged
geometryChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2077 Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();-
2078 s->d_func()->updatePrimaryOrientation();-
2079-
2080 s->geometryChanged(s->geometry());-
2081 s->physicalSizeChanged(s->physicalSize());-
2082 s->physicalDotsPerInchChanged(s->physicalDotsPerInch());-
2083 s->logicalDotsPerInchChanged(s->logicalDotsPerInch());-
2084-
2085 if (s->primaryOrientation() != primaryOrientation
s->primaryOrie...aryOrientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2086 s->primaryOrientationChanged(s->primaryOrientation());
never executed: s->primaryOrientationChanged(s->primaryOrientation());
0
2087-
2088 if (s->d_func()->orientation == Qt::PrimaryOrientation
s->d_func()->o...aryOrientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2089 updateFilteredScreenOrientation(s);
never executed: updateFilteredScreenOrientation(s);
0
2090 }
never executed: end of block
0
2091-
2092 if (availableGeometryChanged
availableGeometryChangedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2093 s->availableGeometryChanged(s->availableGeometry());
never executed: s->availableGeometryChanged(s->availableGeometry());
0
2094-
2095 if (geometryChanged
geometryChangedDescription
TRUEnever evaluated
FALSEnever evaluated
|| availableGeometryChanged
availableGeometryChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2096 const auto siblings = s->virtualSiblings();-
2097 for (QScreen* sibling : siblings)-
2098 sibling->virtualGeometryChanged(sibling->virtualGeometry());
never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry());
0
2099 }
never executed: end of block
0
2100}
never executed: end of block
0
2101-
2102void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e)-
2103{-
2104-
2105 if (QCoreApplication::startingUp()
QCoreApplication::startingUp()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2106 return;
never executed: return;
0
2107-
2108 if (!e->screen
!e->screenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2109 return;
never executed: return;
0
2110-
2111 QScreen *s = e->screen.data();-
2112 s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY);-
2113-
2114 s->logicalDotsPerInchChanged(s->logicalDotsPerInch());-
2115}
never executed: end of block
0
2116-
2117void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e)-
2118{-
2119-
2120 if (QCoreApplication::startingUp()
QCoreApplication::startingUp()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2121 return;
never executed: return;
0
2122-
2123 if (!e->screen
!e->screenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2124 return;
never executed: return;
0
2125-
2126 QScreen *s = e->screen.data();-
2127 qreal rate = e->rate;-
2128-
2129 if (rate < 1.0
rate < 1.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2130 rate = 60.0;
never executed: rate = 60.0;
0
2131 if (!qFuzzyCompare(s->d_func()->refreshRate, rate)
!qFuzzyCompare...eshRate, rate)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2132 s->d_func()->refreshRate = rate;-
2133 s->refreshRateChanged(s->refreshRate());-
2134 }
never executed: end of block
0
2135}
never executed: end of block
0
2136-
2137void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)-
2138{-
2139 if (!e->exposed
!e->exposedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2140 return;
never executed: return;
0
2141-
2142 QWindow *window = e->exposed.data();-
2143 if (!window
!windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2144 return;
never executed: return;
0
2145 QWindowPrivate *p = qt_window_private(window);-
2146-
2147 if (!p->receivedExpose
!p->receivedExposeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2148 if (p->resizeEventPending
p->resizeEventPendingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2149-
2150-
2151 QResizeEvent e(window->geometry().size(), p->geometry.size());-
2152 QGuiApplication::sendSpontaneousEvent(window, &e);-
2153-
2154 p->resizeEventPending = false;-
2155 }
never executed: end of block
0
2156-
2157 p->receivedExpose = true;-
2158 }
never executed: end of block
0
2159-
2160 p->exposed = e->isExposed
e->isExposedDescription
TRUEnever evaluated
FALSEnever evaluated
&& window->screen()
window->screen()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2161-
2162 QExposeEvent exposeEvent(e->region);-
2163 QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);-
2164}
never executed: end of block
0
2165-
2166-
2167-
2168QPlatformDragQtResponse QGuiApplicationPrivate::processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions)-
2169{-
2170 static QPointer<QWindow> currentDragWindow;-
2171 static Qt::DropAction lastAcceptedDropAction = Qt::IgnoreAction;-
2172 QPlatformDrag *platformDrag = platformIntegration()->drag();-
2173 if (!platformDrag
!platformDragDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2174 lastAcceptedDropAction = Qt::IgnoreAction;-
2175 return
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
2176 }-
2177-
2178 if (!dropData
!dropDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2179 if (currentDragWindow.data() == w
currentDragWindow.data() == wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2180 currentDragWindow = 0;
never executed: currentDragWindow = 0;
0
2181 QDragLeaveEvent e;-
2182 QGuiApplication::sendEvent(w, &e);-
2183 lastAcceptedDropAction = Qt::IgnoreAction;-
2184 return
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
2185 }-
2186 QDragMoveEvent me(p, supportedActions, dropData,-
2187 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());-
2188-
2189 if (w != currentDragWindow
w != currentDragWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2190 lastAcceptedDropAction = Qt::IgnoreAction;-
2191 if (currentDragWindow
currentDragWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2192 QDragLeaveEvent e;-
2193 QGuiApplication::sendEvent(currentDragWindow, &e);-
2194 }
never executed: end of block
0
2195 currentDragWindow = w;-
2196 QDragEnterEvent e(p, supportedActions, dropData,-
2197 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());-
2198 QGuiApplication::sendEvent(w, &e);-
2199 if (e.isAccepted()
e.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& e.dropAction() != Qt::IgnoreAction
e.dropAction()...::IgnoreActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2200 lastAcceptedDropAction = e.dropAction();
never executed: lastAcceptedDropAction = e.dropAction();
0
2201 }
never executed: end of block
0
2202-
2203-
2204 if (lastAcceptedDropAction != Qt::IgnoreAction
lastAcceptedDr...::IgnoreActionDescription
TRUEnever evaluated
FALSEnever evaluated
0
2205 && (
(supportedActi...tedDropAction)Description
TRUEnever evaluated
FALSEnever evaluated
supportedActions & lastAcceptedDropAction)
(supportedActi...tedDropAction)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2206 me.setDropAction(lastAcceptedDropAction);-
2207 me.accept();-
2208 }
never executed: end of block
0
2209 QGuiApplication::sendEvent(w, &me);-
2210 lastAcceptedDropAction = me.isAccepted()
me.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
?
0
2211 me.dropAction() : Qt::IgnoreAction;-
2212 return
never executed: return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
never executed: return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
0
2213}-
2214-
2215QPlatformDropQtResponse QGuiApplicationPrivate::processDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions)-
2216{-
2217 QDropEvent de(p, supportedActions, dropData,-
2218 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());-
2219 QGuiApplication::sendEvent(w, &de);-
2220-
2221 Qt::DropAction acceptedAction = de.isAccepted()
de.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
? de.dropAction() : Qt::IgnoreAction;
0
2222 QPlatformDropQtResponse response(de.isAccepted(),acceptedAction);-
2223 return
never executed: return response;
response;
never executed: return response;
0
2224}-
2225-
2226-
2227-
2228-
2229-
2230-
2231-
2232QClipboard * QGuiApplication::clipboard()-
2233{-
2234 if (QGuiApplicationPrivate::qt_clipboard == 0
QGuiApplicatio...clipboard == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2235 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))
!(static_cast<...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2236 QMessageLogger(__FILE__, 2874, __PRETTY_FUNCTION__).warning("QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard");-
2237 return
never executed: return 0;
0;
never executed: return 0;
0
2238 }-
2239 QGuiApplicationPrivate::qt_clipboard = new QClipboard(0);-
2240 }
never executed: end of block
0
2241 return
never executed: return QGuiApplicationPrivate::qt_clipboard;
QGuiApplicationPrivate::qt_clipboard;
never executed: return QGuiApplicationPrivate::qt_clipboard;
0
2242}-
2243QPalette QGuiApplication::palette()-
2244{-
2245 initPalette();-
2246 return
never executed: return *QGuiApplicationPrivate::app_pal;
*QGuiApplicationPrivate::app_pal;
never executed: return *QGuiApplicationPrivate::app_pal;
0
2247}-
2248-
2249-
2250-
2251-
2252-
2253-
2254void QGuiApplication::setPalette(const QPalette &pal)-
2255{-
2256 if (QGuiApplicationPrivate::app_pal
QGuiApplicatio...ivate::app_palDescription
TRUEnever evaluated
FALSEnever evaluated
&& pal.isCopyOf(*QGuiApplicationPrivate::app_pal)
pal.isCopyOf(*...vate::app_pal)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2257 return;
never executed: return;
0
2258 if (!QGuiApplicationPrivate::app_pal
!QGuiApplicati...ivate::app_palDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2259 QGuiApplicationPrivate::app_pal = new QPalette(pal);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(pal);
0
2260 else-
2261 *
never executed: *QGuiApplicationPrivate::app_pal = pal;
QGuiApplicationPrivate::app_pal = pal;
never executed: *QGuiApplicationPrivate::app_pal = pal;
0
2262 applicationResourceFlags |= ApplicationPaletteExplicitlySet;-
2263 QCoreApplication::setAttribute(Qt::AA_SetPalette);-
2264 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->paletteChanged(*QGuiApplicationPrivate::app_pal);-
2265}
never executed: end of block
0
2266-
2267void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window)-
2268{-
2269 windowGeometrySpecification.applyTo(window);-
2270}
never executed: end of block
0
2271-
2272-
2273-
2274-
2275-
2276-
2277QFont QGuiApplication::font()-
2278{-
2279 ((!(QGuiApplicationPrivate::self)) ? qt_assert_x("QGuiApplication::font()", "no QGuiApplication instance",__FILE__,2934) : qt_noop());-
2280 QMutexLocker locker(&applicationFontMutex);-
2281 initFontUnlocked();-
2282 return
never executed: return *QGuiApplicationPrivate::app_font;
*QGuiApplicationPrivate::app_font;
never executed: return *QGuiApplicationPrivate::app_font;
0
2283}-
2284-
2285-
2286-
2287-
2288-
2289-
2290void QGuiApplication::setFont(const QFont &font)-
2291{-
2292 QMutexLocker locker(&applicationFontMutex);-
2293 if (!QGuiApplicationPrivate::app_font
!QGuiApplicati...vate::app_fontDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2294 QGuiApplicationPrivate::app_font = new QFont(font);
never executed: QGuiApplicationPrivate::app_font = new QFont(font);
0
2295 else-
2296 *
never executed: *QGuiApplicationPrivate::app_font = font;
QGuiApplicationPrivate::app_font = font;
never executed: *QGuiApplicationPrivate::app_font = font;
0
2297 applicationResourceFlags |= ApplicationFontExplicitlySet;-
2298}
never executed: end of block
0
2299void QGuiApplicationPrivate::notifyLayoutDirectionChange()-
2300{-
2301 const QWindowList list = QGuiApplication::topLevelWindows();-
2302 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2303 QEvent ev(QEvent::ApplicationLayoutDirectionChange);-
2304 QCoreApplication::sendEvent(list.at(i), &ev);-
2305 }
never executed: end of block
0
2306}
never executed: end of block
0
2307-
2308void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *)-
2309{-
2310}-
2311-
2312-
2313-
2314-
2315-
2316-
2317-
2318QIcon QGuiApplication::windowIcon()-
2319{-
2320 return
never executed: return QGuiApplicationPrivate::app_icon ? *QGuiApplicationPrivate::app_icon : QIcon();
QGuiApplicationPrivate::app_icon ? *QGuiApplicationPrivate::app_icon : QIcon();
never executed: return QGuiApplicationPrivate::app_icon ? *QGuiApplicationPrivate::app_icon : QIcon();
0
2321}-
2322-
2323void QGuiApplication::setWindowIcon(const QIcon &icon)-
2324{-
2325 if (!QGuiApplicationPrivate::app_icon
!QGuiApplicati...vate::app_iconDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2326 QGuiApplicationPrivate::app_icon = new QIcon();
never executed: QGuiApplicationPrivate::app_icon = new QIcon();
0
2327 *QGuiApplicationPrivate::app_icon = icon;-
2328 if (QGuiApplicationPrivate::platform_integration
QGuiApplicatio...rm_integrationDescription
TRUEnever evaluated
FALSEnever evaluated
0
2329 && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ApplicationIcon)
QGuiApplicatio...plicationIcon)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2330 QGuiApplicationPrivate::platform_integration->setApplicationIcon(icon);
never executed: QGuiApplicationPrivate::platform_integration->setApplicationIcon(icon);
0
2331 if (QGuiApplicationPrivate::is_app_running
QGuiApplicatio...is_app_runningDescription
TRUEnever evaluated
FALSEnever evaluated
&& !QGuiApplicationPrivate::is_app_closing
!QGuiApplicati...is_app_closingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2332 QGuiApplicationPrivate::self->notifyWindowIconChanged();
never executed: QGuiApplicationPrivate::self->notifyWindowIconChanged();
0
2333}
never executed: end of block
0
2334-
2335void QGuiApplicationPrivate::notifyWindowIconChanged()-
2336{-
2337 QEvent ev(QEvent::ApplicationWindowIconChange);-
2338 const QWindowList list = QGuiApplication::topLevelWindows();-
2339 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2340 QCoreApplication::sendEvent(list.at(i), &ev);
never executed: QCoreApplication::sendEvent(list.at(i), &ev);
0
2341}
never executed: end of block
0
2342void QGuiApplication::setQuitOnLastWindowClosed(bool quit)-
2343{-
2344 QCoreApplication::setQuitLockEnabled(quit);-
2345}
never executed: end of block
0
2346-
2347-
2348-
2349bool QGuiApplication::quitOnLastWindowClosed()-
2350{-
2351 return
never executed: return QCoreApplication::isQuitLockEnabled();
QCoreApplication::isQuitLockEnabled();
never executed: return QCoreApplication::isQuitLockEnabled();
0
2352}-
2353void QGuiApplicationPrivate::emitLastWindowClosed()-
2354{-
2355 if ((static_cast<
(static_cast<Q...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))
(static_cast<Q...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
&& (static_cast<
(static_cast<Q...unc()->in_execDescription
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->d_func()->in_exec
(static_cast<Q...unc()->in_execDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2356 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->lastWindowClosed();-
2357 }
never executed: end of block
0
2358}
never executed: end of block
0
2359-
2360bool QGuiApplicationPrivate::shouldQuit()-
2361{-
2362 const QWindowList processedWindows;-
2363 return
never executed: return shouldQuitInternal(processedWindows);
shouldQuitInternal(processedWindows);
never executed: return shouldQuitInternal(processedWindows);
0
2364}-
2365-
2366bool QGuiApplicationPrivate::shouldQuitInternal(const QWindowList &processedWindows)-
2367{-
2368-
2369 QWindowList list = QGuiApplication::topLevelWindows();-
2370 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2371 QWindow *w = list.at(i);-
2372 if (processedWindows.contains(w)
processedWindows.contains(w)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2373 continue;
never executed: continue;
0
2374 if (w->isVisible()
w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& !w->transientParent()
!w->transientParent()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2375 return
never executed: return false;
false;
never executed: return false;
0
2376 }
never executed: end of block
0
2377 return
never executed: return true;
true;
never executed: return true;
0
2378}-
2379-
2380bool QGuiApplicationPrivate::tryCloseAllWindows()-
2381{-
2382 return
never executed: return tryCloseRemainingWindows(QWindowList());
tryCloseRemainingWindows(QWindowList());
never executed: return tryCloseRemainingWindows(QWindowList());
0
2383}-
2384-
2385bool QGuiApplicationPrivate::tryCloseRemainingWindows(QWindowList processedWindows)-
2386{-
2387 QWindowList list = QGuiApplication::topLevelWindows();-
2388 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2389 QWindow *w = list.at(i);-
2390 if (w->isVisible()
w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& !processedWindows.contains(w)
!processedWindows.contains(w)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2391 if (!w->close()
!w->close()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2392 return
never executed: return false;
false;
never executed: return false;
0
2393 processedWindows.append(w);-
2394 list = QGuiApplication::topLevelWindows();-
2395 i = -1;-
2396 }
never executed: end of block
0
2397 }
never executed: end of block
0
2398 return
never executed: return true;
true;
never executed: return true;
0
2399}-
2400Qt::ApplicationState QGuiApplication::applicationState()-
2401{-
2402 return
never executed: return QGuiApplicationPrivate::applicationState;
QGuiApplicationPrivate::applicationState;
never executed: return QGuiApplicationPrivate::applicationState;
0
2403}-
2404void QGuiApplicationPrivate::setApplicationState(Qt::ApplicationState state, bool forcePropagate)-
2405{-
2406 if ((
(applicationState == state)Description
TRUEnever evaluated
FALSEnever evaluated
applicationState == state)
(applicationState == state)Description
TRUEnever evaluated
FALSEnever evaluated
&& !forcePropagate
!forcePropagateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2407 return;
never executed: return;
0
2408-
2409 applicationState = state;-
2410-
2411 switch (state) {-
2412 case
never executed: case Qt::ApplicationActive:
Qt::ApplicationActive:
never executed: case Qt::ApplicationActive:
{
0
2413 QEvent appActivate(QEvent::ApplicationActivate);-
2414 QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate);-
2415 break;
never executed: break;
}
0
2416 case
never executed: case Qt::ApplicationInactive:
Qt::ApplicationInactive:
never executed: case Qt::ApplicationInactive:
{
0
2417 QEvent appDeactivate(QEvent::ApplicationDeactivate);-
2418 QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appDeactivate);-
2419 break;
never executed: break;
}
0
2420 default
never executed: default:
:
never executed: default:
0
2421 break;
never executed: break;
0
2422 }-
2423-
2424 QApplicationStateChangeEvent event(applicationState);-
2425 QCoreApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event);-
2426-
2427 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->applicationStateChanged(applicationState);-
2428}
never executed: end of block
0
2429bool QGuiApplication::isFallbackSessionManagementEnabled()-
2430{-
2431 return
never executed: return QGuiApplicationPrivate::is_fallback_session_management_enabled;
QGuiApplicationPrivate::is_fallback_session_management_enabled;
never executed: return QGuiApplicationPrivate::is_fallback_session_management_enabled;
0
2432}-
2433void QGuiApplication::setFallbackSessionManagementEnabled(bool enabled)-
2434{-
2435 QGuiApplicationPrivate::is_fallback_session_management_enabled = enabled;-
2436}
never executed: end of block
0
2437bool QGuiApplication::isSessionRestored() const-
2438{-
2439 const QGuiApplicationPrivate * const d = d_func();-
2440 return
never executed: return d->is_session_restored;
d->is_session_restored;
never executed: return d->is_session_restored;
0
2441}-
2442-
2443QString QGuiApplication::sessionId() const-
2444{-
2445 const QGuiApplicationPrivate * const d = d_func();-
2446 return
never executed: return d->session_manager->sessionId();
d->session_manager->sessionId();
never executed: return d->session_manager->sessionId();
0
2447}-
2448-
2449QString QGuiApplication::sessionKey() const-
2450{-
2451 const QGuiApplicationPrivate * const d = d_func();-
2452 return
never executed: return d->session_manager->sessionKey();
d->session_manager->sessionKey();
never executed: return d->session_manager->sessionKey();
0
2453}-
2454-
2455bool QGuiApplication::isSavingSession() const-
2456{-
2457 const QGuiApplicationPrivate * const d = d_func();-
2458 return
never executed: return d->is_saving_session;
d->is_saving_session;
never executed: return d->is_saving_session;
0
2459}-
2460-
2461void QGuiApplicationPrivate::commitData()-
2462{-
2463 QGuiApplication * const q = q_func();-
2464 is_saving_session = true;-
2465-
2466 q->commitDataRequest(*session_manager);-
2467 if (is_fallback_session_management_enabled
is_fallback_se...gement_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
&& session_manager->allowsInteraction()
session_manage...sInteraction()Description
TRUEnever evaluated
FALSEnever evaluated
0
2468 && !tryCloseAllWindows()
!tryCloseAllWindows()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2469 session_manager->cancel();-
2470 }
never executed: end of block
0
2471-
2472 is_saving_session = false;-
2473}
never executed: end of block
0
2474-
2475-
2476void QGuiApplicationPrivate::saveState()-
2477{-
2478 QGuiApplication * const q = q_func();-
2479 is_saving_session = true;-
2480 q->saveStateRequest(*session_manager);-
2481 is_saving_session = false;-
2482}
never executed: end of block
0
2483void QGuiApplication::sync()-
2484{-
2485 QCoreApplication::processEvents();-
2486 if (QGuiApplicationPrivate::platform_integration
QGuiApplicatio...rm_integrationDescription
TRUEnever evaluated
FALSEnever evaluated
0
2487 && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)
QGuiApplicatio...on::SyncState)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2488 QGuiApplicationPrivate::platform_integration->sync();-
2489 QCoreApplication::processEvents();-
2490 QWindowSystemInterface::flushWindowSystemEvents();-
2491 }
never executed: end of block
0
2492}
never executed: end of block
0
2493void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction)-
2494{-
2495 if (layout_direction == direction
layout_direction == directionDescription
TRUEnever evaluated
FALSEnever evaluated
|| direction == Qt::LayoutDirectionAuto
direction == Q...tDirectionAutoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2496 return;
never executed: return;
0
2497-
2498 layout_direction = direction;-
2499-
2500 if ((static_cast<
(static_cast<Q...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))
(static_cast<Q...::instance()))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2501 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->layoutDirectionChanged(direction);-
2502 QGuiApplicationPrivate::self->notifyLayoutDirectionChange();-
2503 }
never executed: end of block
0
2504}
never executed: end of block
0
2505-
2506Qt::LayoutDirection QGuiApplication::layoutDirection()-
2507{-
2508-
2509-
2510-
2511 return
never executed: return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
never executed: return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
0
2512}-
2513QCursor *QGuiApplication::overrideCursor()-
2514{-
2515 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 3430, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
}
0
2516 return
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first();
(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
2517}-
2518void QGuiApplication::changeOverrideCursor(const QCursor &cursor)-
2519{-
2520 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 3444, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return ;
;
never executed: return ;
}
0
2521 if ((static_cast<
(static_cast<Q...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
(static_cast<Q...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2522 return;
never executed: return;
0
2523 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst();-
2524 setOverrideCursor(cursor);-
2525}
never executed: end of block
0
2526-
2527-
2528-
2529-
2530static inline void applyCursor(QWindow *w, QCursor c)-
2531{-
2532 if (const
const QScreen ... = w->screen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = w->screen()
const QScreen ... = w->screen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2533 if (QPlatformCursor *cursor = screen->handle()->cursor()
QPlatformCurso...le()->cursor()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2534 cursor->changeCursor(&c, w);
never executed: cursor->changeCursor(&c, w);
0
2535}
never executed: end of block
0
2536-
2537static inline void unsetCursor(QWindow *w)-
2538{-
2539 if (const
const QScreen ... = w->screen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = w->screen()
const QScreen ... = w->screen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2540 if (QPlatformCursor *cursor = screen->handle()->cursor()
QPlatformCurso...le()->cursor()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2541 cursor->changeCursor(0, w);
never executed: cursor->changeCursor(0, w);
0
2542}
never executed: end of block
0
2543-
2544static inline void applyCursor(const QList<QWindow *> &l, const QCursor &c)-
2545{-
2546 for (int i = 0; i < l.size()
i < l.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2547 QWindow *w = l.at(i);-
2548 if (w->handle()
w->handle()Description
TRUEnever evaluated
FALSEnever evaluated
&& w->type() != Qt::Desktop
w->type() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2549 applyCursor(w, c);
never executed: applyCursor(w, c);
0
2550 }
never executed: end of block
0
2551}
never executed: end of block
0
2552-
2553static inline void applyWindowCursor(const QList<QWindow *> &l)-
2554{-
2555 for (int i = 0; i < l.size()
i < l.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2556 QWindow *w = l.at(i);-
2557 if (w->handle()
w->handle()Description
TRUEnever evaluated
FALSEnever evaluated
&& w->type() != Qt::Desktop
w->type() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2558 if (qt_window_private(w)->hasCursor
qt_window_priv...(w)->hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2559 applyCursor(w, w->cursor());-
2560 }
never executed: end of block
else {
0
2561 unsetCursor(w);-
2562 }
never executed: end of block
0
2563 }-
2564 }
never executed: end of block
0
2565}
never executed: end of block
0
2566void QGuiApplication::setOverrideCursor(const QCursor &cursor)-
2567{-
2568 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 3519, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return ;
;
never executed: return ;
}
0
2569 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.prepend(cursor);-
2570 applyCursor(QGuiApplicationPrivate::window_list, cursor);-
2571}
never executed: end of block
0
2572void QGuiApplication::restoreOverrideCursor()-
2573{-
2574 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 3537, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return ;
;
never executed: return ;
}
0
2575 if ((static_cast<
(static_cast<Q...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
(static_cast<Q...list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2576 return;
never executed: return;
0
2577 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst();-
2578 if ((static_cast<
(static_cast<Q...ist.size() > 0Description
TRUEnever evaluated
FALSEnever evaluated
QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.size() > 0
(static_cast<Q...ist.size() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2579 QCursor c((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.value(0));-
2580 applyCursor(QGuiApplicationPrivate::window_list, c);-
2581 }
never executed: end of block
else {
0
2582 applyWindowCursor(QGuiApplicationPrivate::window_list);-
2583 }
never executed: end of block
0
2584}-
2585QStyleHints *QGuiApplication::styleHints()-
2586{-
2587 if (!QGuiApplicationPrivate::styleHints
!QGuiApplicati...te::styleHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2588 QGuiApplicationPrivate::styleHints = new QStyleHints();
never executed: QGuiApplicationPrivate::styleHints = new QStyleHints();
0
2589 return
never executed: return QGuiApplicationPrivate::styleHints;
QGuiApplicationPrivate::styleHints;
never executed: return QGuiApplicationPrivate::styleHints;
0
2590}-
2591void QGuiApplication::setDesktopSettingsAware(bool on)-
2592{-
2593 QGuiApplicationPrivate::obey_desktop_settings = on;-
2594}
never executed: end of block
0
2595-
2596-
2597-
2598-
2599-
2600-
2601-
2602bool QGuiApplication::desktopSettingsAware()-
2603{-
2604 return
never executed: return QGuiApplicationPrivate::obey_desktop_settings;
QGuiApplicationPrivate::obey_desktop_settings;
never executed: return QGuiApplicationPrivate::obey_desktop_settings;
0
2605}-
2606QInputMethod *QGuiApplication::inputMethod()-
2607{-
2608 if (__builtin_expect(!!(QCoreApplication::instance()), true)
__builtin_expe...ance()), true)Description
TRUEnever evaluated
FALSEnever evaluated
) { }
never executed: end of block
else { QMessageLogger(__FILE__, 3605, __PRETTY_FUNCTION__).warning("Must construct a QGuiApplication first."); return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
}
0
2609 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod
!(static_cast<...)->inputMethodDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2610 (static_cast<
never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
never executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
0
2611 return
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
0
2612}-
2613QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)-
2614{-
2615 (void)cshape;;-
2616 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
2617}-
2618-
2619void QGuiApplicationPrivate::notifyThemeChanged()-
2620{-
2621 if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)
!(applicationR...ExplicitlySet)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
2622 !QCoreApplication::testAttribute(Qt::AA_SetPalette)
!QCoreApplicat...AA_SetPalette)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2623 clearPalette();-
2624 initPalette();-
2625 }
never executed: end of block
0
2626 if (!(applicationResourceFlags & ApplicationFontExplicitlySet)
!(applicationR...ExplicitlySet)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2627 QMutexLocker locker(&applicationFontMutex);-
2628 clearFontUnlocked();-
2629 initFontUnlocked();-
2630 }
never executed: end of block
0
2631}
never executed: end of block
0
2632-
2633-
2634void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag)-
2635{-
2636 (void)drag;-
2637-
2638}
never executed: end of block
0
2639-
2640-
2641const QDrawHelperGammaTables *QGuiApplicationPrivate::gammaTables()-
2642{-
2643 QDrawHelperGammaTables *result = m_gammaTables.load();-
2644 if (!result
!resultDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
2645 QDrawHelperGammaTables *tables = new QDrawHelperGammaTables(fontSmoothingGamma);-
2646 if (!m_gammaTables.testAndSetRelease(0, tables)
!m_gammaTables...ase(0, tables)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2647 delete tables;
never executed: delete tables;
0
2648 result = m_gammaTables.load();-
2649 }
never executed: end of block
0
2650 return
never executed: return result;
result;
never executed: return result;
0
2651}-
2652-
2653void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object)-
2654{-
2655 QGuiApplication * const q = q_func();-
2656-
2657 QPlatformInputContext *inputContext = platformIntegration()->inputContext();-
2658 bool enabled = false;-
2659 if (object
objectDescription
TRUEnever evaluated
FALSEnever evaluated
&& inputContext
inputContextDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2660 QInputMethodQueryEvent query(Qt::ImEnabled | Qt::ImHints);-
2661 QGuiApplication::sendEvent(object, &query);-
2662 enabled = query.value(Qt::ImEnabled).toBool();-
2663 if (enabled
enabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2664 static const bool supportsHiddenText = inputContext->hasCapability(QPlatformInputContext::HiddenTextCapability);-
2665 const Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(query.value(Qt::ImHints).toInt());-
2666 if ((
(hints & Qt::ImhHiddenText)Description
TRUEnever evaluated
FALSEnever evaluated
hints & Qt::ImhHiddenText)
(hints & Qt::ImhHiddenText)Description
TRUEnever evaluated
FALSEnever evaluated
&& !supportsHiddenText
!supportsHiddenTextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2667 enabled = false;
never executed: enabled = false;
0
2668 }
never executed: end of block
0
2669 }
never executed: end of block
0
2670-
2671 QPlatformInputContextPrivate::setInputMethodAccepted(enabled);-
2672 if (inputContext
inputContextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2673 inputContext->setFocusObject(object);
never executed: inputContext->setFocusObject(object);
0
2674 q->focusObjectChanged(object);-
2675}
never executed: end of block
0
2676-
2677enum MouseMasks {-
2678 MouseCapsMask = 0xFF,-
2679 MouseSourceMaskDst = 0xFF00,-
2680 MouseSourceMaskSrc = MouseCapsMask,-
2681 MouseSourceShift = 8,-
2682 MouseFlagsCapsMask = 0xFF0000,-
2683 MouseFlagsShift = 16-
2684};-
2685-
2686int QGuiApplicationPrivate::mouseEventCaps(QMouseEvent *event)-
2687{-
2688 return
never executed: return event->caps & MouseCapsMask;
event->caps & MouseCapsMask;
never executed: return event->caps & MouseCapsMask;
0
2689}-
2690-
2691QVector2D QGuiApplicationPrivate::mouseEventVelocity(QMouseEvent *event)-
2692{-
2693 return
never executed: return event->velocity;
event->velocity;
never executed: return event->velocity;
0
2694}-
2695-
2696void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, int caps, const QVector2D &velocity)-
2697{-
2698 ((!(caps <= MouseCapsMask)) ? qt_assert("caps <= MouseCapsMask",__FILE__,3707) : qt_noop());-
2699 event->caps &= ~MouseCapsMask;-
2700 event->caps |= caps & MouseCapsMask;-
2701 event->velocity = velocity;-
2702}
never executed: end of block
0
2703-
2704Qt::MouseEventSource QGuiApplicationPrivate::mouseEventSource(const QMouseEvent *event)-
2705{-
2706 return
never executed: return Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift);
Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift);
never executed: return Qt::MouseEventSource((event->caps & MouseSourceMaskDst) >> MouseSourceShift);
0
2707}-
2708-
2709void QGuiApplicationPrivate::setMouseEventSource(QMouseEvent *event, Qt::MouseEventSource source)-
2710{-
2711-
2712-
2713 int value = source;-
2714 ((!(value <= MouseSourceMaskSrc)) ? qt_assert("value <= MouseSourceMaskSrc",__FILE__,3723) : qt_noop());-
2715 event->caps &= ~MouseSourceMaskDst;-
2716 event->caps |= (value & MouseSourceMaskSrc) << MouseSourceShift;-
2717}
never executed: end of block
0
2718-
2719Qt::MouseEventFlags QGuiApplicationPrivate::mouseEventFlags(const QMouseEvent *event)-
2720{-
2721 return
never executed: return Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift);
Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift);
never executed: return Qt::MouseEventFlags((event->caps & MouseFlagsCapsMask) >> MouseFlagsShift);
0
2722}-
2723-
2724void QGuiApplicationPrivate::setMouseEventFlags(QMouseEvent *event, Qt::MouseEventFlags flags)-
2725{-
2726-
2727 unsigned int value = flags;-
2728 ((!(value <= Qt::MouseEventFlagMask)) ? qt_assert("value <= Qt::MouseEventFlagMask",__FILE__,3737) : qt_noop());-
2729 event->caps &= ~MouseFlagsCapsMask;-
2730 event->caps |= (value & Qt::MouseEventFlagMask) << MouseFlagsShift;-
2731}
never executed: end of block
0
2732-
2733QInputDeviceManager *QGuiApplicationPrivate::inputDeviceManager()-
2734{-
2735 ((!(QGuiApplication::instance())) ? qt_assert("QGuiApplication::instance()",__FILE__,3744) : qt_noop());-
2736-
2737 if (!m_inputDeviceManager
!m_inputDeviceManagerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2738 m_inputDeviceManager = new QInputDeviceManager(QGuiApplication::instance());
never executed: m_inputDeviceManager = new QInputDeviceManager(QGuiApplication::instance());
0
2739-
2740 return
never executed: return m_inputDeviceManager;
m_inputDeviceManager;
never executed: return m_inputDeviceManager;
0
2741}-
2742-
2743-
2744-
Switch to Source codePreprocessed file

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