Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qapplication.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||
18 | - | |||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||
21 | - | |||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||
23 | - | |||||||||||||||||||||||||
24 | - | |||||||||||||||||||||||||
25 | static void initResources() | - | ||||||||||||||||||||||||
26 | { | - | ||||||||||||||||||||||||
27 | - | |||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||
30 | do { extern int qInitResources_qstyle (); qInitResources_qstyle (); } while (0); | - | ||||||||||||||||||||||||
31 | - | |||||||||||||||||||||||||
32 | do { extern int qInitResources_qmessagebox (); qInitResources_qmessagebox (); } while (0); | - | ||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||
34 | } never executed: end of block | 0 | ||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||
36 | - | |||||||||||||||||||||||||
37 | __attribute__((visibility("default"))) void qt_call_post_routines(); | - | ||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||
39 | QApplicationPrivate *QApplicationPrivate::self = 0; | - | ||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||
41 | static void initSystemPalette() | - | ||||||||||||||||||||||||
42 | { | - | ||||||||||||||||||||||||
43 | if (!QApplicationPrivate::sys_pal
| 0 | ||||||||||||||||||||||||
44 | QPalette defaultPlatte; | - | ||||||||||||||||||||||||
45 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
46 | defaultPlatte = QApplicationPrivate::app_style->standardPalette(); never executed: defaultPlatte = QApplicationPrivate::app_style->standardPalette(); | 0 | ||||||||||||||||||||||||
47 | if (const
| 0 | ||||||||||||||||||||||||
48 | QApplicationPrivate::setSystemPalette(themePalette->resolve(defaultPlatte)); | - | ||||||||||||||||||||||||
49 | QApplicationPrivate::initializeWidgetPaletteHash(); | - | ||||||||||||||||||||||||
50 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
51 | QApplicationPrivate::setSystemPalette(defaultPlatte); | - | ||||||||||||||||||||||||
52 | } never executed: end of block | 0 | ||||||||||||||||||||||||
53 | } | - | ||||||||||||||||||||||||
54 | } never executed: end of block | 0 | ||||||||||||||||||||||||
55 | - | |||||||||||||||||||||||||
56 | static void clearSystemPalette() | - | ||||||||||||||||||||||||
57 | { | - | ||||||||||||||||||||||||
58 | delete QApplicationPrivate::sys_pal; | - | ||||||||||||||||||||||||
59 | QApplicationPrivate::sys_pal = 0; | - | ||||||||||||||||||||||||
60 | } never executed: end of block | 0 | ||||||||||||||||||||||||
61 | - | |||||||||||||||||||||||||
62 | static QByteArray get_style_class_name() | - | ||||||||||||||||||||||||
63 | { | - | ||||||||||||||||||||||||
64 | QScopedPointer<QStyle> s(QStyleFactory::create(QApplicationPrivate::desktopStyleKey())); | - | ||||||||||||||||||||||||
65 | if (!s.isNull()
| 0 | ||||||||||||||||||||||||
66 | return never executed: s->metaObject()->className();return s->metaObject()->className(); never executed: return s->metaObject()->className(); | 0 | ||||||||||||||||||||||||
67 | return never executed: QByteArray();return QByteArray(); never executed: return QByteArray(); | 0 | ||||||||||||||||||||||||
68 | } | - | ||||||||||||||||||||||||
69 | - | |||||||||||||||||||||||||
70 | static QByteArray nativeStyleClassName() | - | ||||||||||||||||||||||||
71 | { | - | ||||||||||||||||||||||||
72 | static QByteArray name = get_style_class_name(); | - | ||||||||||||||||||||||||
73 | return never executed: name;return name; never executed: return name; | 0 | ||||||||||||||||||||||||
74 | } | - | ||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||
77 | - | |||||||||||||||||||||||||
78 | - | |||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||
80 | bool QApplicationPrivate::autoSipEnabled = true; | - | ||||||||||||||||||||||||
81 | - | |||||||||||||||||||||||||
82 | - | |||||||||||||||||||||||||
83 | QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, int flags) | - | ||||||||||||||||||||||||
84 | : QGuiApplicationPrivate(argc, argv, flags) | - | ||||||||||||||||||||||||
85 | { | - | ||||||||||||||||||||||||
86 | application_type = QApplicationPrivate::Gui; | - | ||||||||||||||||||||||||
87 | - | |||||||||||||||||||||||||
88 | - | |||||||||||||||||||||||||
89 | gestureManager = 0; | - | ||||||||||||||||||||||||
90 | gestureWidget = 0; | - | ||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||
92 | - | |||||||||||||||||||||||||
93 | if (!self
| 0 | ||||||||||||||||||||||||
94 | self = this; never executed: self = this; | 0 | ||||||||||||||||||||||||
95 | } never executed: end of block | 0 | ||||||||||||||||||||||||
96 | - | |||||||||||||||||||||||||
97 | QApplicationPrivate::~QApplicationPrivate() | - | ||||||||||||||||||||||||
98 | { | - | ||||||||||||||||||||||||
99 | if (self == this
| 0 | ||||||||||||||||||||||||
100 | self = 0; never executed: self = 0; | 0 | ||||||||||||||||||||||||
101 | } never executed: end of block | 0 | ||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | void QApplicationPrivate::createEventDispatcher() | - | ||||||||||||||||||||||||
104 | { | - | ||||||||||||||||||||||||
105 | QGuiApplicationPrivate::createEventDispatcher(); | - | ||||||||||||||||||||||||
106 | } never executed: end of block | 0 | ||||||||||||||||||||||||
107 | QWidget *QApplication::topLevelAt(const QPoint &pos) | - | ||||||||||||||||||||||||
108 | { | - | ||||||||||||||||||||||||
109 | if (const
| 0 | ||||||||||||||||||||||||
110 | if (const
| 0 | ||||||||||||||||||||||||
111 | return never executed: widgetWindow->widget();return widgetWindow->widget(); never executed: return widgetWindow->widget(); | 0 | ||||||||||||||||||||||||
112 | } never executed: end of block | 0 | ||||||||||||||||||||||||
113 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
114 | } | - | ||||||||||||||||||||||||
115 | void qt_init(QApplicationPrivate *priv, int type | - | ||||||||||||||||||||||||
116 | ); | - | ||||||||||||||||||||||||
117 | void qt_init_tooltip_palette(); | - | ||||||||||||||||||||||||
118 | void qt_cleanup(); | - | ||||||||||||||||||||||||
119 | - | |||||||||||||||||||||||||
120 | QStyle *QApplicationPrivate::app_style = 0; | - | ||||||||||||||||||||||||
121 | bool QApplicationPrivate::overrides_native_style = false; | - | ||||||||||||||||||||||||
122 | - | |||||||||||||||||||||||||
123 | - | |||||||||||||||||||||||||
124 | QString QApplicationPrivate::styleSheet; | - | ||||||||||||||||||||||||
125 | - | |||||||||||||||||||||||||
126 | QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = 0; | - | ||||||||||||||||||||||||
127 | - | |||||||||||||||||||||||||
128 | int QApplicationPrivate::app_cspec = QApplication::NormalColor; | - | ||||||||||||||||||||||||
129 | - | |||||||||||||||||||||||||
130 | QPalette *QApplicationPrivate::sys_pal = 0; | - | ||||||||||||||||||||||||
131 | QPalette *QApplicationPrivate::set_pal = 0; | - | ||||||||||||||||||||||||
132 | - | |||||||||||||||||||||||||
133 | QFont *QApplicationPrivate::sys_font = 0; | - | ||||||||||||||||||||||||
134 | QFont *QApplicationPrivate::set_font = 0; | - | ||||||||||||||||||||||||
135 | - | |||||||||||||||||||||||||
136 | QWidget *QApplicationPrivate::main_widget = 0; | - | ||||||||||||||||||||||||
137 | QWidget *QApplicationPrivate::focus_widget = 0; | - | ||||||||||||||||||||||||
138 | QWidget *QApplicationPrivate::hidden_focus_widget = 0; | - | ||||||||||||||||||||||||
139 | QWidget *QApplicationPrivate::active_window = 0; | - | ||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||
141 | int QApplicationPrivate::wheel_scroll_lines; | - | ||||||||||||||||||||||||
142 | QPointer<QWidget> QApplicationPrivate::wheel_widget; | - | ||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||
144 | bool qt_in_tab_key_event = false; | - | ||||||||||||||||||||||||
145 | int qt_antialiasing_threshold = -1; | - | ||||||||||||||||||||||||
146 | QSize QApplicationPrivate::app_strut = QSize(0,0); | - | ||||||||||||||||||||||||
147 | int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - | ||||||||||||||||||||||||
148 | bool QApplicationPrivate::widgetCount = false; | - | ||||||||||||||||||||||||
149 | - | |||||||||||||||||||||||||
150 | - | |||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||
152 | - | |||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||
154 | inline bool QApplicationPrivate::isAlien(QWidget *widget) | - | ||||||||||||||||||||||||
155 | { | - | ||||||||||||||||||||||||
156 | return never executed: widget && !widget->isWindow();return widget && !widget->isWindow(); never executed: return widget && !widget->isWindow(); | 0 | ||||||||||||||||||||||||
157 | } | - | ||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||
159 | bool __attribute__((visibility("default"))) qt_tab_all_widgets() | - | ||||||||||||||||||||||||
160 | { | - | ||||||||||||||||||||||||
161 | return never executed: QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls;return QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls; never executed: return QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls; | 0 | ||||||||||||||||||||||||
162 | } | - | ||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||
165 | - | |||||||||||||||||||||||||
166 | namespace { namespace Q_QGS_app_palettes { typedef PaletteHash Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<PaletteHash, Q_QGS_app_palettes::innerFunction, Q_QGS_app_palettes::guard> app_palettes;return &holder.value; | 0 | ||||||||||||||||||||||||
167 | PaletteHash *qt_app_palettes_hash() | - | ||||||||||||||||||||||||
168 | { | - | ||||||||||||||||||||||||
169 | return never executed: app_palettes();return app_palettes(); never executed: return app_palettes(); | 0 | ||||||||||||||||||||||||
170 | } | - | ||||||||||||||||||||||||
171 | - | |||||||||||||||||||||||||
172 | namespace { namespace Q_QGS_app_fonts { typedef FontHash Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<FontHash, Q_QGS_app_fonts::innerFunction, Q_QGS_app_fonts::guard> app_fonts;return &holder.value; | 0 | ||||||||||||||||||||||||
173 | FontHash *qt_app_fonts_hash() | - | ||||||||||||||||||||||||
174 | { | - | ||||||||||||||||||||||||
175 | return never executed: app_fonts();return app_fonts(); never executed: return app_fonts(); | 0 | ||||||||||||||||||||||||
176 | } | - | ||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||
178 | QWidgetList *QApplicationPrivate::popupWidgets = 0; | - | ||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||
180 | QDesktopWidget *qt_desktopWidget = 0; | - | ||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||
182 | - | |||||||||||||||||||||||||
183 | - | |||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||
185 | void QApplicationPrivate::process_cmdline() | - | ||||||||||||||||||||||||
186 | { | - | ||||||||||||||||||||||||
187 | if (styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
188 | styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); never executed: styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); | 0 | ||||||||||||||||||||||||
189 | - | |||||||||||||||||||||||||
190 | if (!styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
191 | if (app_style
| 0 | ||||||||||||||||||||||||
192 | delete app_style; | - | ||||||||||||||||||||||||
193 | app_style = 0; | - | ||||||||||||||||||||||||
194 | } never executed: end of block | 0 | ||||||||||||||||||||||||
195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||
197 | - | |||||||||||||||||||||||||
198 | if (!qt_is_gui_used
| 0 | ||||||||||||||||||||||||
199 | return; never executed: return; | 0 | ||||||||||||||||||||||||
200 | - | |||||||||||||||||||||||||
201 | int i, j; | - | ||||||||||||||||||||||||
202 | - | |||||||||||||||||||||||||
203 | j = 1; | - | ||||||||||||||||||||||||
204 | for (i=1; i<argc
| 0 | ||||||||||||||||||||||||
205 | if (!argv[i]
| 0 | ||||||||||||||||||||||||
206 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
207 | if (*
| 0 | ||||||||||||||||||||||||
208 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||
209 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
210 | } | - | ||||||||||||||||||||||||
211 | const char *arg = argv[i]; | - | ||||||||||||||||||||||||
212 | if (arg[1] == '-'
| 0 | ||||||||||||||||||||||||
213 | ++ never executed: arg;++arg; never executed: ++arg; | 0 | ||||||||||||||||||||||||
214 | if (strcmp(arg, "-qdevel") == 0
| 0 | ||||||||||||||||||||||||
215 | - | |||||||||||||||||||||||||
216 | - | |||||||||||||||||||||||||
217 | } never executed: else if (strcmp(arg, "-stylesheet") == 0end of block
| 0 | ||||||||||||||||||||||||
218 | styleSheet = QLatin1String("file:///"); | - | ||||||||||||||||||||||||
219 | styleSheet.append(QString::fromLocal8Bit(argv[++i])); | - | ||||||||||||||||||||||||
220 | } never executed: else if (strncmp(arg, "-stylesheet=", 12) == 0end of block
| 0 | ||||||||||||||||||||||||
221 | styleSheet = QLatin1String("file:///"); | - | ||||||||||||||||||||||||
222 | styleSheet.append(QString::fromLocal8Bit(arg + 12)); | - | ||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||
224 | } never executed: else if (qstrcmp(arg, "-widgetcount") == 0end of block
| 0 | ||||||||||||||||||||||||
225 | widgetCount = true; | - | ||||||||||||||||||||||||
226 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
227 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||
228 | } never executed: end of block | 0 | ||||||||||||||||||||||||
229 | } | - | ||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | if(j < argc
| 0 | ||||||||||||||||||||||||
232 | argv[j] = 0; | - | ||||||||||||||||||||||||
233 | argc = j; | - | ||||||||||||||||||||||||
234 | } never executed: end of block | 0 | ||||||||||||||||||||||||
235 | } never executed: end of block | 0 | ||||||||||||||||||||||||
236 | QApplication::QApplication(int &argc, char **argv, int _internal) | - | ||||||||||||||||||||||||
237 | - | |||||||||||||||||||||||||
238 | : QGuiApplication(*new QApplicationPrivate(argc, argv, _internal)) | - | ||||||||||||||||||||||||
239 | { | - | ||||||||||||||||||||||||
240 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
241 | d->init(); | - | ||||||||||||||||||||||||
242 | } never executed: end of block | 0 | ||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||
246 | - | |||||||||||||||||||||||||
247 | void QApplicationPrivate::init() | - | ||||||||||||||||||||||||
248 | { | - | ||||||||||||||||||||||||
249 | QGuiApplicationPrivate::init(); | - | ||||||||||||||||||||||||
250 | - | |||||||||||||||||||||||||
251 | initResources(); | - | ||||||||||||||||||||||||
252 | - | |||||||||||||||||||||||||
253 | qt_is_gui_used = (application_type != QApplicationPrivate::Tty); | - | ||||||||||||||||||||||||
254 | process_cmdline(); | - | ||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||
257 | qt_init(this, application_type); | - | ||||||||||||||||||||||||
258 | initialize(); | - | ||||||||||||||||||||||||
259 | eventDispatcher->startingUp(); | - | ||||||||||||||||||||||||
260 | - | |||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | - | |||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||
265 | - | |||||||||||||||||||||||||
266 | - | |||||||||||||||||||||||||
267 | QAccessible::installFactory(&qAccessibleFactory); | - | ||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||
269 | - | |||||||||||||||||||||||||
270 | } never executed: end of block | 0 | ||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||
272 | void qt_init(QApplicationPrivate *priv, int type) | - | ||||||||||||||||||||||||
273 | { | - | ||||||||||||||||||||||||
274 | (void)priv;; | - | ||||||||||||||||||||||||
275 | (void)type;; | - | ||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||
277 | QColormap::initialize(); | - | ||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | qt_init_tooltip_palette(); | - | ||||||||||||||||||||||||
280 | - | |||||||||||||||||||||||||
281 | QApplicationPrivate::initializeWidgetFontHash(); | - | ||||||||||||||||||||||||
282 | } never executed: end of block | 0 | ||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||
284 | void qt_init_tooltip_palette() | - | ||||||||||||||||||||||||
285 | { | - | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | if (const
| 0 | ||||||||||||||||||||||||
288 | QToolTip::setPalette(*toolTipPalette); never executed: QToolTip::setPalette(*toolTipPalette); | 0 | ||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||
290 | } never executed: end of block | 0 | ||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||
292 | - | |||||||||||||||||||||||||
293 | void qRegisterGuiStateMachine(); | - | ||||||||||||||||||||||||
294 | void qUnregisterGuiStateMachine(); | - | ||||||||||||||||||||||||
295 | - | |||||||||||||||||||||||||
296 | extern void qRegisterWidgetsVariant(); | - | ||||||||||||||||||||||||
297 | - | |||||||||||||||||||||||||
298 | - | |||||||||||||||||||||||||
299 | - | |||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | - | |||||||||||||||||||||||||
303 | void QApplicationPrivate::initialize() | - | ||||||||||||||||||||||||
304 | { | - | ||||||||||||||||||||||||
305 | is_app_running = false; | - | ||||||||||||||||||||||||
306 | - | |||||||||||||||||||||||||
307 | QWidgetPrivate::mapper = new QWidgetMapper; | - | ||||||||||||||||||||||||
308 | QWidgetPrivate::allWidgets = new QWidgetSet; | - | ||||||||||||||||||||||||
309 | - | |||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||
311 | qRegisterWidgetsVariant(); | - | ||||||||||||||||||||||||
312 | - | |||||||||||||||||||||||||
313 | - | |||||||||||||||||||||||||
314 | QAbstractDeclarativeData::setWidgetParent = QWidgetPrivate::setWidgetParentHelper; | - | ||||||||||||||||||||||||
315 | - | |||||||||||||||||||||||||
316 | if (application_type != QApplicationPrivate::Tty
| 0 | ||||||||||||||||||||||||
317 | ( never executed: void) QApplication::style();(void) QApplication::style(); never executed: (void) QApplication::style(); | 0 | ||||||||||||||||||||||||
318 | - | |||||||||||||||||||||||||
319 | - | |||||||||||||||||||||||||
320 | qRegisterGuiStateMachine(); | - | ||||||||||||||||||||||||
321 | - | |||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||
323 | if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0
| 0 | ||||||||||||||||||||||||
324 | QCoreApplication::setAttribute(Qt::AA_NativeWindows); never executed: QCoreApplication::setAttribute(Qt::AA_NativeWindows); | 0 | ||||||||||||||||||||||||
325 | QApplicationPrivate::wheel_scroll_lines = 3; | - | ||||||||||||||||||||||||
326 | - | |||||||||||||||||||||||||
327 | - | |||||||||||||||||||||||||
328 | if (qt_is_gui_used
| 0 | ||||||||||||||||||||||||
329 | initializeMultitouch(); never executed: initializeMultitouch(); | 0 | ||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||
331 | if (QApplication::desktopSettingsAware()
| 0 | ||||||||||||||||||||||||
332 | if (const
| 0 | ||||||||||||||||||||||||
333 | QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); | - | ||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||
335 | QApplicationPrivate::wheel_scroll_lines = theme->themeHint(QPlatformTheme::WheelScrollLines).toInt(); | - | ||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||
337 | } never executed: end of block | 0 | ||||||||||||||||||||||||
338 | - | |||||||||||||||||||||||||
339 | is_app_running = true; | - | ||||||||||||||||||||||||
340 | } never executed: end of block | 0 | ||||||||||||||||||||||||
341 | - | |||||||||||||||||||||||||
342 | static void setPossiblePalette(const QPalette *palette, const char *className) | - | ||||||||||||||||||||||||
343 | { | - | ||||||||||||||||||||||||
344 | if (palette == 0
| 0 | ||||||||||||||||||||||||
345 | return; never executed: return; | 0 | ||||||||||||||||||||||||
346 | QApplicationPrivate::setPalette_helper(*palette, className, false); | - | ||||||||||||||||||||||||
347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
348 | - | |||||||||||||||||||||||||
349 | void QApplicationPrivate::initializeWidgetPaletteHash() | - | ||||||||||||||||||||||||
350 | { | - | ||||||||||||||||||||||||
351 | QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme(); | - | ||||||||||||||||||||||||
352 | if (!platformTheme
| 0 | ||||||||||||||||||||||||
353 | return; never executed: return; | 0 | ||||||||||||||||||||||||
354 | qt_app_palettes_hash()->clear(); | - | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton"); | - | ||||||||||||||||||||||||
357 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton"); | - | ||||||||||||||||||||||||
358 | setPossiblePalette(platformTheme->palette(QPlatformTheme::CheckBoxPalette), "QCheckBox"); | - | ||||||||||||||||||||||||
359 | setPossiblePalette(platformTheme->palette(QPlatformTheme::RadioButtonPalette), "QRadioButton"); | - | ||||||||||||||||||||||||
360 | setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView"); | - | ||||||||||||||||||||||||
361 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView"); | - | ||||||||||||||||||||||||
362 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPalette), "QMessageBoxLabel"); | - | ||||||||||||||||||||||||
363 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar"); | - | ||||||||||||||||||||||||
364 | setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel"); | - | ||||||||||||||||||||||||
365 | setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox"); | - | ||||||||||||||||||||||||
366 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuPalette), "QMenu"); | - | ||||||||||||||||||||||||
367 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuBarPalette), "QMenuBar"); | - | ||||||||||||||||||||||||
368 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextEdit"); | - | ||||||||||||||||||||||||
369 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextControl"); | - | ||||||||||||||||||||||||
370 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextLineEditPalette), "QLineEdit"); | - | ||||||||||||||||||||||||
371 | } never executed: end of block | 0 | ||||||||||||||||||||||||
372 | - | |||||||||||||||||||||||||
373 | void QApplicationPrivate::initializeWidgetFontHash() | - | ||||||||||||||||||||||||
374 | { | - | ||||||||||||||||||||||||
375 | const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); | - | ||||||||||||||||||||||||
376 | if (!theme
| 0 | ||||||||||||||||||||||||
377 | return; never executed: return; | 0 | ||||||||||||||||||||||||
378 | FontHash *fontHash = qt_app_fonts_hash(); | - | ||||||||||||||||||||||||
379 | fontHash->clear(); | - | ||||||||||||||||||||||||
380 | - | |||||||||||||||||||||||||
381 | if (const
| 0 | ||||||||||||||||||||||||
382 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenu") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenu" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenu") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenu" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
383 | if (const
| 0 | ||||||||||||||||||||||||
384 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
385 | if (const
| 0 | ||||||||||||||||||||||||
386 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
387 | if (const
| 0 | ||||||||||||||||||||||||
388 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMessageBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMessageBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMessageBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMessageBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
389 | if (const
| 0 | ||||||||||||||||||||||||
390 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
391 | if (const
| 0 | ||||||||||||||||||||||||
392 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTipLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTipLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTipLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTipLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
393 | if (const
| 0 | ||||||||||||||||||||||||
394 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
395 | if (const
| 0 | ||||||||||||||||||||||||
396 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QStatusBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QStatusBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QStatusBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QStatusBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
397 | if (const
| 0 | ||||||||||||||||||||||||
398 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMdiSubWindowTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMdiSubWindowTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMdiSubWindowTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMdiSubWindowTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
399 | if (const
| 0 | ||||||||||||||||||||||||
400 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QDockWidgetTitle") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QDockWidgetTitle" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QDockWidgetTitle") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QDockWidgetTitle" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
401 | if (const
| 0 | ||||||||||||||||||||||||
402 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QPushButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QPushButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QPushButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QPushButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
403 | if (const
| 0 | ||||||||||||||||||||||||
404 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QCheckBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QCheckBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QCheckBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QCheckBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
405 | if (const
| 0 | ||||||||||||||||||||||||
406 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QRadioButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QRadioButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QRadioButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QRadioButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
407 | if (const
| 0 | ||||||||||||||||||||||||
408 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QToolButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QToolButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QToolButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QToolButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
409 | if (const
| 0 | ||||||||||||||||||||||||
410 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QAbstractItemView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QAbstractItemView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QAbstractItemView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QAbstractItemView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
411 | if (const
| 0 | ||||||||||||||||||||||||
412 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
413 | if (const
| 0 | ||||||||||||||||||||||||
414 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QHeaderView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QHeaderView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QHeaderView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QHeaderView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
415 | if (const
| 0 | ||||||||||||||||||||||||
416 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
417 | if (const
| 0 | ||||||||||||||||||||||||
418 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
419 | if (const
| 0 | ||||||||||||||||||||||||
420 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboLineEdit") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboLineEdit" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboLineEdit") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboLineEdit" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
421 | if (const
| 0 | ||||||||||||||||||||||||
422 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QSmallFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QSmallFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QSmallFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QSmallFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
423 | if (const
| 0 | ||||||||||||||||||||||||
424 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMiniFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMiniFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba; never executed: }()), *font);return ba; never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMiniFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMiniFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
425 | } never executed: end of block | 0 | ||||||||||||||||||||||||
426 | QWidget *QApplication::activePopupWidget() | - | ||||||||||||||||||||||||
427 | { | - | ||||||||||||||||||||||||
428 | return never executed: QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ?return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr; never executed: return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr; | 0 | ||||||||||||||||||||||||
429 | QApplicationPrivate::popupWidgets->constLast() : nullptr; never executed: return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr; | 0 | ||||||||||||||||||||||||
430 | } | - | ||||||||||||||||||||||||
431 | QWidget *QApplication::activeModalWidget() | - | ||||||||||||||||||||||||
432 | { | - | ||||||||||||||||||||||||
433 | QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(modalWindow()); | - | ||||||||||||||||||||||||
434 | return never executed: widgetWindow ? widgetWindow->widget() : 0;return widgetWindow ? widgetWindow->widget() : 0; never executed: return widgetWindow ? widgetWindow->widget() : 0; | 0 | ||||||||||||||||||||||||
435 | } | - | ||||||||||||||||||||||||
436 | - | |||||||||||||||||||||||||
437 | - | |||||||||||||||||||||||||
438 | - | |||||||||||||||||||||||||
439 | - | |||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||
441 | - | |||||||||||||||||||||||||
442 | QApplication::~QApplication() | - | ||||||||||||||||||||||||
443 | { | - | ||||||||||||||||||||||||
444 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
445 | - | |||||||||||||||||||||||||
446 | - | |||||||||||||||||||||||||
447 | qt_call_post_routines(); | - | ||||||||||||||||||||||||
448 | - | |||||||||||||||||||||||||
449 | - | |||||||||||||||||||||||||
450 | d->toolTipWakeUp.stop(); | - | ||||||||||||||||||||||||
451 | d->toolTipFallAsleep.stop(); | - | ||||||||||||||||||||||||
452 | - | |||||||||||||||||||||||||
453 | QApplicationPrivate::is_app_closing = true; | - | ||||||||||||||||||||||||
454 | QApplicationPrivate::is_app_running = false; | - | ||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||
456 | delete QWidgetPrivate::mapper; | - | ||||||||||||||||||||||||
457 | QWidgetPrivate::mapper = 0; | - | ||||||||||||||||||||||||
458 | - | |||||||||||||||||||||||||
459 | - | |||||||||||||||||||||||||
460 | if (QWidgetPrivate::allWidgets
| 0 | ||||||||||||||||||||||||
461 | QWidgetSet *mySet = QWidgetPrivate::allWidgets; | - | ||||||||||||||||||||||||
462 | QWidgetPrivate::allWidgets = 0; | - | ||||||||||||||||||||||||
463 | for (QWidgetSet::ConstIterator it = mySet->constBegin(), cend = mySet->constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
464 | QWidget *w = *it; | - | ||||||||||||||||||||||||
465 | if (!w->parent()
| 0 | ||||||||||||||||||||||||
466 | w->destroy(true, true); never executed: w->destroy(true, true); | 0 | ||||||||||||||||||||||||
467 | } never executed: end of block | 0 | ||||||||||||||||||||||||
468 | delete mySet; | - | ||||||||||||||||||||||||
469 | } never executed: end of block | 0 | ||||||||||||||||||||||||
470 | - | |||||||||||||||||||||||||
471 | delete qt_desktopWidget; | - | ||||||||||||||||||||||||
472 | qt_desktopWidget = 0; | - | ||||||||||||||||||||||||
473 | - | |||||||||||||||||||||||||
474 | delete QApplicationPrivate::app_pal; | - | ||||||||||||||||||||||||
475 | QApplicationPrivate::app_pal = 0; | - | ||||||||||||||||||||||||
476 | clearSystemPalette(); | - | ||||||||||||||||||||||||
477 | delete QApplicationPrivate::set_pal; | - | ||||||||||||||||||||||||
478 | QApplicationPrivate::set_pal = 0; | - | ||||||||||||||||||||||||
479 | app_palettes()->clear(); | - | ||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||
481 | delete QApplicationPrivate::sys_font; | - | ||||||||||||||||||||||||
482 | QApplicationPrivate::sys_font = 0; | - | ||||||||||||||||||||||||
483 | delete QApplicationPrivate::set_font; | - | ||||||||||||||||||||||||
484 | QApplicationPrivate::set_font = 0; | - | ||||||||||||||||||||||||
485 | app_fonts()->clear(); | - | ||||||||||||||||||||||||
486 | - | |||||||||||||||||||||||||
487 | delete QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
488 | QApplicationPrivate::app_style = 0; | - | ||||||||||||||||||||||||
489 | - | |||||||||||||||||||||||||
490 | - | |||||||||||||||||||||||||
491 | if (qt_is_gui_used
| 0 | ||||||||||||||||||||||||
492 | delete QDragManager::self(); never executed: delete QDragManager::self(); | 0 | ||||||||||||||||||||||||
493 | - | |||||||||||||||||||||||||
494 | - | |||||||||||||||||||||||||
495 | d->cleanupMultitouch(); | - | ||||||||||||||||||||||||
496 | - | |||||||||||||||||||||||||
497 | qt_cleanup(); | - | ||||||||||||||||||||||||
498 | - | |||||||||||||||||||||||||
499 | if (QApplicationPrivate::widgetCount
| 0 | ||||||||||||||||||||||||
500 | QMessageLogger(__FILE__, 883, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); never executed: QMessageLogger(__FILE__, 883, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); | 0 | ||||||||||||||||||||||||
501 | - | |||||||||||||||||||||||||
502 | QApplicationPrivate::obey_desktop_settings = true; | - | ||||||||||||||||||||||||
503 | - | |||||||||||||||||||||||||
504 | QApplicationPrivate::app_strut = QSize(0, 0); | - | ||||||||||||||||||||||||
505 | QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - | ||||||||||||||||||||||||
506 | QApplicationPrivate::widgetCount = false; | - | ||||||||||||||||||||||||
507 | - | |||||||||||||||||||||||||
508 | - | |||||||||||||||||||||||||
509 | - | |||||||||||||||||||||||||
510 | qUnregisterGuiStateMachine(); | - | ||||||||||||||||||||||||
511 | - | |||||||||||||||||||||||||
512 | } never executed: end of block | 0 | ||||||||||||||||||||||||
513 | void qt_cleanup() | - | ||||||||||||||||||||||||
514 | { | - | ||||||||||||||||||||||||
515 | QPixmapCache::clear(); | - | ||||||||||||||||||||||||
516 | QColormap::cleanup(); | - | ||||||||||||||||||||||||
517 | - | |||||||||||||||||||||||||
518 | QApplicationPrivate::active_window = 0; | - | ||||||||||||||||||||||||
519 | - | |||||||||||||||||||||||||
520 | - | |||||||||||||||||||||||||
521 | - | |||||||||||||||||||||||||
522 | - | |||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||
524 | - | |||||||||||||||||||||||||
525 | } never executed: end of block | 0 | ||||||||||||||||||||||||
526 | QWidget *QApplication::widgetAt(const QPoint &p) | - | ||||||||||||||||||||||||
527 | { | - | ||||||||||||||||||||||||
528 | QWidget *window = QApplication::topLevelAt(p); | - | ||||||||||||||||||||||||
529 | if (!window
| 0 | ||||||||||||||||||||||||
530 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||
532 | QWidget *child = 0; | - | ||||||||||||||||||||||||
533 | - | |||||||||||||||||||||||||
534 | if (!window->testAttribute(Qt::WA_TransparentForMouseEvents)
| 0 | ||||||||||||||||||||||||
535 | child = window->childAt(window->mapFromGlobal(p)); never executed: child = window->childAt(window->mapFromGlobal(p)); | 0 | ||||||||||||||||||||||||
536 | - | |||||||||||||||||||||||||
537 | if (child
| 0 | ||||||||||||||||||||||||
538 | return never executed: child;return child; never executed: return child; | 0 | ||||||||||||||||||||||||
539 | - | |||||||||||||||||||||||||
540 | if (window->testAttribute(Qt::WA_TransparentForMouseEvents)
| 0 | ||||||||||||||||||||||||
541 | - | |||||||||||||||||||||||||
542 | - | |||||||||||||||||||||||||
543 | - | |||||||||||||||||||||||||
544 | int x = p.x(); | - | ||||||||||||||||||||||||
545 | int y = p.y(); | - | ||||||||||||||||||||||||
546 | QRegion oldmask = window->mask(); | - | ||||||||||||||||||||||||
547 | QPoint wpoint = window->mapFromGlobal(QPoint(x, y)); | - | ||||||||||||||||||||||||
548 | QRegion newmask = (oldmask.isEmpty()
| 0 | ||||||||||||||||||||||||
549 | - QRegion(wpoint.x(), wpoint.y(), 1, 1); | - | ||||||||||||||||||||||||
550 | window->setMask(newmask); | - | ||||||||||||||||||||||||
551 | QWidget *recurse = 0; | - | ||||||||||||||||||||||||
552 | if (QApplication::topLevelAt(p) != window
| 0 | ||||||||||||||||||||||||
553 | recurse = widgetAt(x, y); never executed: recurse = widgetAt(x, y); | 0 | ||||||||||||||||||||||||
554 | if (oldmask.isEmpty()
| 0 | ||||||||||||||||||||||||
555 | window->clearMask(); never executed: window->clearMask(); | 0 | ||||||||||||||||||||||||
556 | else | - | ||||||||||||||||||||||||
557 | window->setMask(oldmask); never executed: window->setMask(oldmask); | 0 | ||||||||||||||||||||||||
558 | return never executed: recurse;return recurse; never executed: return recurse; | 0 | ||||||||||||||||||||||||
559 | } | - | ||||||||||||||||||||||||
560 | return never executed: window;return window; never executed: return window; | 0 | ||||||||||||||||||||||||
561 | } | - | ||||||||||||||||||||||||
562 | bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) | - | ||||||||||||||||||||||||
563 | { | - | ||||||||||||||||||||||||
564 | if ((event->type() == QEvent::UpdateRequest
| 0 | ||||||||||||||||||||||||
565 | || event->type() == QEvent::LayoutRequest
| 0 | ||||||||||||||||||||||||
566 | || event->type() == QEvent::Resize
| 0 | ||||||||||||||||||||||||
567 | || event->type() == QEvent::Move
| 0 | ||||||||||||||||||||||||
568 | || event->type() == QEvent::LanguageChange
| 0 | ||||||||||||||||||||||||
569 | for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd()
| 0 | ||||||||||||||||||||||||
570 | const QPostEvent &cur = *it; | - | ||||||||||||||||||||||||
571 | if (cur.receiver != receiver
| 0 | ||||||||||||||||||||||||
572 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
573 | if (cur.event->type() == QEvent::LayoutRequest
| 0 | ||||||||||||||||||||||||
574 | || cur.event->type() == QEvent::UpdateRequest
| 0 | ||||||||||||||||||||||||
575 | ; | - | ||||||||||||||||||||||||
576 | } never executed: else if (cur.event->type() == QEvent::Resizeend of block
| 0 | ||||||||||||||||||||||||
577 | ((QResizeEvent *)(cur.event))->s = ((QResizeEvent *)event)->s; | - | ||||||||||||||||||||||||
578 | } never executed: else if (cur.event->type() == QEvent::Moveend of block
| 0 | ||||||||||||||||||||||||
579 | ((QMoveEvent *)(cur.event))->p = ((QMoveEvent *)event)->p; | - | ||||||||||||||||||||||||
580 | } never executed: else if (cur.event->type() == QEvent::LanguageChangeend of block
| 0 | ||||||||||||||||||||||||
581 | ; | - | ||||||||||||||||||||||||
582 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
583 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
584 | } | - | ||||||||||||||||||||||||
585 | delete event; | - | ||||||||||||||||||||||||
586 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
587 | } | - | ||||||||||||||||||||||||
588 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
589 | } | - | ||||||||||||||||||||||||
590 | return never executed: QGuiApplication::compressEvent(event, receiver, postedEvents);return QGuiApplication::compressEvent(event, receiver, postedEvents); never executed: return QGuiApplication::compressEvent(event, receiver, postedEvents); | 0 | ||||||||||||||||||||||||
591 | } | - | ||||||||||||||||||||||||
592 | void QApplication::setAutoSipEnabled(const bool enabled) | - | ||||||||||||||||||||||||
593 | { | - | ||||||||||||||||||||||||
594 | QApplicationPrivate::autoSipEnabled = enabled; | - | ||||||||||||||||||||||||
595 | } never executed: end of block | 0 | ||||||||||||||||||||||||
596 | - | |||||||||||||||||||||||||
597 | bool QApplication::autoSipEnabled() const | - | ||||||||||||||||||||||||
598 | { | - | ||||||||||||||||||||||||
599 | return never executed: QApplicationPrivate::autoSipEnabled;return QApplicationPrivate::autoSipEnabled; never executed: return QApplicationPrivate::autoSipEnabled; | 0 | ||||||||||||||||||||||||
600 | } | - | ||||||||||||||||||||||||
601 | - | |||||||||||||||||||||||||
602 | - | |||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||
604 | QString QApplication::styleSheet() const | - | ||||||||||||||||||||||||
605 | { | - | ||||||||||||||||||||||||
606 | return never executed: QApplicationPrivate::styleSheet;return QApplicationPrivate::styleSheet; never executed: return QApplicationPrivate::styleSheet; | 0 | ||||||||||||||||||||||||
607 | } | - | ||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||
609 | void QApplication::setStyleSheet(const QString& styleSheet) | - | ||||||||||||||||||||||||
610 | { | - | ||||||||||||||||||||||||
611 | QApplicationPrivate::styleSheet = styleSheet; | - | ||||||||||||||||||||||||
612 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplicationPrivate::app_style); | - | ||||||||||||||||||||||||
613 | if (styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
614 | if (!proxy
| 0 | ||||||||||||||||||||||||
615 | return; never executed: return; | 0 | ||||||||||||||||||||||||
616 | setStyle(proxy->base); | - | ||||||||||||||||||||||||
617 | } never executed: else if (proxyend of block
| 0 | ||||||||||||||||||||||||
618 | proxy->repolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
619 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
620 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(QApplicationPrivate::app_style); | - | ||||||||||||||||||||||||
621 | QApplicationPrivate::app_style->setParent(newProxy); | - | ||||||||||||||||||||||||
622 | setStyle(newProxy); | - | ||||||||||||||||||||||||
623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
624 | } | - | ||||||||||||||||||||||||
625 | QStyle *QApplication::style() | - | ||||||||||||||||||||||||
626 | { | - | ||||||||||||||||||||||||
627 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
628 | return never executed: QApplicationPrivate::app_style;return QApplicationPrivate::app_style; never executed: return QApplicationPrivate::app_style; | 0 | ||||||||||||||||||||||||
629 | if (!qobject_cast<QApplication *>(QCoreApplication::instance())
| 0 | ||||||||||||||||||||||||
630 | ((!(!"No style available without QApplication!")) ? qt_assert("!\"No style available without QApplication!\"",__FILE__,1123) : qt_noop()); | - | ||||||||||||||||||||||||
631 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
632 | } | - | ||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||
634 | if (!QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
635 | - | |||||||||||||||||||||||||
636 | - | |||||||||||||||||||||||||
637 | QString style; | - | ||||||||||||||||||||||||
638 | if (!QApplicationPrivate::styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
639 | style = QApplicationPrivate::styleOverride.toLower(); | - | ||||||||||||||||||||||||
640 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
641 | style = QApplicationPrivate::desktopStyleKey(); | - | ||||||||||||||||||||||||
642 | } never executed: end of block | 0 | ||||||||||||||||||||||||
643 | - | |||||||||||||||||||||||||
644 | QStyle *&app_style = QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
645 | app_style = QStyleFactory::create(style); | - | ||||||||||||||||||||||||
646 | if (!app_style
| 0 | ||||||||||||||||||||||||
647 | const QStringList styles = QStyleFactory::keys(); | - | ||||||||||||||||||||||||
648 | for (const auto &style : styles) { | - | ||||||||||||||||||||||||
649 | if ((
| 0 | ||||||||||||||||||||||||
650 | break; never executed: break; | 0 | ||||||||||||||||||||||||
651 | } never executed: end of block | 0 | ||||||||||||||||||||||||
652 | } never executed: end of block | 0 | ||||||||||||||||||||||||
653 | if (!app_style
| 0 | ||||||||||||||||||||||||
654 | ((!(!"No styles available!")) ? qt_assert("!\"No styles available!\"",__FILE__,1147) : qt_noop()); | - | ||||||||||||||||||||||||
655 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
656 | } | - | ||||||||||||||||||||||||
657 | QApplicationPrivate::overrides_native_style = | - | ||||||||||||||||||||||||
658 | app_style->objectName() != QApplicationPrivate::desktopStyleKey(); | - | ||||||||||||||||||||||||
659 | } never executed: end of block | 0 | ||||||||||||||||||||||||
660 | - | |||||||||||||||||||||||||
661 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
662 | - | |||||||||||||||||||||||||
663 | initSystemPalette(); | - | ||||||||||||||||||||||||
664 | - | |||||||||||||||||||||||||
665 | if (QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
666 | QApplication::setPalette(*QApplicationPrivate::set_pal); never executed: QApplication::setPalette(*QApplicationPrivate::set_pal); | 0 | ||||||||||||||||||||||||
667 | - | |||||||||||||||||||||||||
668 | - | |||||||||||||||||||||||||
669 | if (!QApplicationPrivate::styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
670 | (static_cast<QApplication *>(QCoreApplication::instance()))->setStyleSheet(QApplicationPrivate::styleSheet); | - | ||||||||||||||||||||||||
671 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
672 | - | |||||||||||||||||||||||||
673 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); never executed: QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); | 0 | ||||||||||||||||||||||||
674 | - | |||||||||||||||||||||||||
675 | return never executed: QApplicationPrivate::app_style;return QApplicationPrivate::app_style; never executed: return QApplicationPrivate::app_style; | 0 | ||||||||||||||||||||||||
676 | } | - | ||||||||||||||||||||||||
677 | void QApplication::setStyle(QStyle *style) | - | ||||||||||||||||||||||||
678 | { | - | ||||||||||||||||||||||||
679 | if (!style
| 0 | ||||||||||||||||||||||||
680 | return; never executed: return; | 0 | ||||||||||||||||||||||||
681 | - | |||||||||||||||||||||||||
682 | QWidgetList all = allWidgets(); | - | ||||||||||||||||||||||||
683 | - | |||||||||||||||||||||||||
684 | - | |||||||||||||||||||||||||
685 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
686 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
687 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
688 | QWidget *w = *it; | - | ||||||||||||||||||||||||
689 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
690 | w->testAttribute(Qt::WA_WState_Polished)
| 0 | ||||||||||||||||||||||||
691 | QApplicationPrivate::app_style->unpolish(w); | - | ||||||||||||||||||||||||
692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
693 | } never executed: end of block | 0 | ||||||||||||||||||||||||
694 | } never executed: end of block | 0 | ||||||||||||||||||||||||
695 | QApplicationPrivate::app_style->unpolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
696 | } never executed: end of block | 0 | ||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||
698 | QStyle *old = QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
699 | - | |||||||||||||||||||||||||
700 | QApplicationPrivate::overrides_native_style = | - | ||||||||||||||||||||||||
701 | nativeStyleClassName() == QByteArray(style->metaObject()->className()); | - | ||||||||||||||||||||||||
702 | - | |||||||||||||||||||||||||
703 | - | |||||||||||||||||||||||||
704 | if (!QApplicationPrivate::styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
705 | - | |||||||||||||||||||||||||
706 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(style); | - | ||||||||||||||||||||||||
707 | style->setParent(newProxy); | - | ||||||||||||||||||||||||
708 | QApplicationPrivate::app_style = newProxy; | - | ||||||||||||||||||||||||
709 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
710 | - | |||||||||||||||||||||||||
711 | QApplicationPrivate::app_style = style; never executed: QApplicationPrivate::app_style = style; | 0 | ||||||||||||||||||||||||
712 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||
714 | - | |||||||||||||||||||||||||
715 | - | |||||||||||||||||||||||||
716 | - | |||||||||||||||||||||||||
717 | if (QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
718 | QApplication::setPalette(*QApplicationPrivate::set_pal); | - | ||||||||||||||||||||||||
719 | } never executed: else if (QApplicationPrivate::sys_palend of block
| 0 | ||||||||||||||||||||||||
720 | clearSystemPalette(); | - | ||||||||||||||||||||||||
721 | initSystemPalette(); | - | ||||||||||||||||||||||||
722 | QApplicationPrivate::initializeWidgetPaletteHash(); | - | ||||||||||||||||||||||||
723 | QApplicationPrivate::initializeWidgetFontHash(); | - | ||||||||||||||||||||||||
724 | QApplicationPrivate::setPalette_helper(*QApplicationPrivate::sys_pal, 0, false); | - | ||||||||||||||||||||||||
725 | } never executed: else if (!QApplicationPrivate::sys_palend of block
| 0 | ||||||||||||||||||||||||
726 | - | |||||||||||||||||||||||||
727 | QApplicationPrivate::setSystemPalette(QApplicationPrivate::app_style->standardPalette()); | - | ||||||||||||||||||||||||
728 | } never executed: end of block | 0 | ||||||||||||||||||||||||
729 | - | |||||||||||||||||||||||||
730 | - | |||||||||||||||||||||||||
731 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
732 | - | |||||||||||||||||||||||||
733 | - | |||||||||||||||||||||||||
734 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
735 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
736 | QWidget *w = *it; | - | ||||||||||||||||||||||||
737 | if (w->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||
738 | if (w->style() == QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
739 | QApplicationPrivate::app_style->polish(w); never executed: QApplicationPrivate::app_style->polish(w); | 0 | ||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||
741 | else | - | ||||||||||||||||||||||||
742 | w->setStyleSheet(w->styleSheet()); never executed: w->setStyleSheet(w->styleSheet()); | 0 | ||||||||||||||||||||||||
743 | - | |||||||||||||||||||||||||
744 | } | - | ||||||||||||||||||||||||
745 | } never executed: end of block | 0 | ||||||||||||||||||||||||
746 | - | |||||||||||||||||||||||||
747 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
748 | QWidget *w = *it; | - | ||||||||||||||||||||||||
749 | if (w->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||
750 | QEvent e(QEvent::StyleChange); | - | ||||||||||||||||||||||||
751 | QApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||
752 | w->update(); | - | ||||||||||||||||||||||||
753 | } never executed: end of block | 0 | ||||||||||||||||||||||||
754 | } never executed: end of block | 0 | ||||||||||||||||||||||||
755 | } never executed: end of block | 0 | ||||||||||||||||||||||||
756 | - | |||||||||||||||||||||||||
757 | - | |||||||||||||||||||||||||
758 | if (QStyleSheetStyle *oldProxy = qobject_cast<QStyleSheetStyle *>(old)
| 0 | ||||||||||||||||||||||||
759 | oldProxy->deref(); | - | ||||||||||||||||||||||||
760 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||
762 | if (old
| 0 | ||||||||||||||||||||||||
763 | delete old; | - | ||||||||||||||||||||||||
764 | } never executed: end of block | 0 | ||||||||||||||||||||||||
765 | - | |||||||||||||||||||||||||
766 | if (QApplicationPrivate::focus_widget
| 0 | ||||||||||||||||||||||||
767 | QFocusEvent in(QEvent::FocusIn, Qt::OtherFocusReason); | - | ||||||||||||||||||||||||
768 | QApplication::sendEvent(QApplicationPrivate::focus_widget->style(), &in); | - | ||||||||||||||||||||||||
769 | QApplicationPrivate::focus_widget->update(); | - | ||||||||||||||||||||||||
770 | } never executed: end of block | 0 | ||||||||||||||||||||||||
771 | } never executed: end of block | 0 | ||||||||||||||||||||||||
772 | QStyle* QApplication::setStyle(const QString& style) | - | ||||||||||||||||||||||||
773 | { | - | ||||||||||||||||||||||||
774 | QStyle *s = QStyleFactory::create(style); | - | ||||||||||||||||||||||||
775 | if (!s
| 0 | ||||||||||||||||||||||||
776 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
777 | - | |||||||||||||||||||||||||
778 | setStyle(s); | - | ||||||||||||||||||||||||
779 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||
780 | } | - | ||||||||||||||||||||||||
781 | - | |||||||||||||||||||||||||
782 | - | |||||||||||||||||||||||||
783 | - | |||||||||||||||||||||||||
784 | - | |||||||||||||||||||||||||
785 | - | |||||||||||||||||||||||||
786 | - | |||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||
788 | int QApplication::colorSpec() | - | ||||||||||||||||||||||||
789 | { | - | ||||||||||||||||||||||||
790 | return never executed: QApplicationPrivate::app_cspec;return QApplicationPrivate::app_cspec; never executed: return QApplicationPrivate::app_cspec; | 0 | ||||||||||||||||||||||||
791 | } | - | ||||||||||||||||||||||||
792 | void QApplication::setColorSpec(int spec) | - | ||||||||||||||||||||||||
793 | { | - | ||||||||||||||||||||||||
794 | if (__builtin_expect(!!((static_cast<QApplication *>(QCoreApplication::instance()))), false)
| 0 | ||||||||||||||||||||||||
795 | QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " never executed: QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " "called before the QApplication object is created"); | 0 | ||||||||||||||||||||||||
796 | "called before the QApplication object is created"); never executed: QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " "called before the QApplication object is created"); | 0 | ||||||||||||||||||||||||
797 | QApplicationPrivate::app_cspec = spec; | - | ||||||||||||||||||||||||
798 | } never executed: end of block | 0 | ||||||||||||||||||||||||
799 | QSize QApplication::globalStrut() | - | ||||||||||||||||||||||||
800 | { | - | ||||||||||||||||||||||||
801 | return never executed: QApplicationPrivate::app_strut;return QApplicationPrivate::app_strut; never executed: return QApplicationPrivate::app_strut; | 0 | ||||||||||||||||||||||||
802 | } | - | ||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||
804 | void QApplication::setGlobalStrut(const QSize& strut) | - | ||||||||||||||||||||||||
805 | { | - | ||||||||||||||||||||||||
806 | QApplicationPrivate::app_strut = strut; | - | ||||||||||||||||||||||||
807 | } never executed: end of block | 0 | ||||||||||||||||||||||||
808 | QPalette QApplication::palette(const QWidget* w) | - | ||||||||||||||||||||||||
809 | { | - | ||||||||||||||||||||||||
810 | typedef PaletteHash::const_iterator PaletteHashConstIt; | - | ||||||||||||||||||||||||
811 | - | |||||||||||||||||||||||||
812 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
813 | if (w
| 0 | ||||||||||||||||||||||||
814 | PaletteHashConstIt it = hash->constFind(w->metaObject()->className()); | - | ||||||||||||||||||||||||
815 | const PaletteHashConstIt cend = hash->constEnd(); | - | ||||||||||||||||||||||||
816 | if (it != cend
| 0 | ||||||||||||||||||||||||
817 | return never executed: *it;return *it; never executed: return *it; | 0 | ||||||||||||||||||||||||
818 | for (it = hash->constBegin(); it != cend
| 0 | ||||||||||||||||||||||||
819 | if (w->inherits(it.key())
| 0 | ||||||||||||||||||||||||
820 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
821 | } never executed: end of block | 0 | ||||||||||||||||||||||||
822 | } never executed: end of block | 0 | ||||||||||||||||||||||||
823 | return never executed: palette();return palette(); never executed: return palette(); | 0 | ||||||||||||||||||||||||
824 | } | - | ||||||||||||||||||||||||
825 | QPalette QApplication::palette(const char *className) | - | ||||||||||||||||||||||||
826 | { | - | ||||||||||||||||||||||||
827 | if (!QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
828 | palette(); never executed: palette(); | 0 | ||||||||||||||||||||||||
829 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
830 | if (className
| 0 | ||||||||||||||||||||||||
831 | QHash<QByteArray, QPalette>::ConstIterator it = hash->constFind(className); | - | ||||||||||||||||||||||||
832 | if (it != hash->constEnd()
| 0 | ||||||||||||||||||||||||
833 | return never executed: *it;return *it; never executed: return *it; | 0 | ||||||||||||||||||||||||
834 | } never executed: end of block | 0 | ||||||||||||||||||||||||
835 | return never executed: *QApplicationPrivate::app_pal;return *QApplicationPrivate::app_pal; never executed: return *QApplicationPrivate::app_pal; | 0 | ||||||||||||||||||||||||
836 | } | - | ||||||||||||||||||||||||
837 | - | |||||||||||||||||||||||||
838 | void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash) | - | ||||||||||||||||||||||||
839 | { | - | ||||||||||||||||||||||||
840 | QPalette pal = palette; | - | ||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||
842 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
843 | QApplicationPrivate::app_style->polish(pal); never executed: QApplicationPrivate::app_style->polish(pal); | 0 | ||||||||||||||||||||||||
844 | - | |||||||||||||||||||||||||
845 | bool all = false; | - | ||||||||||||||||||||||||
846 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
847 | if (!className
| 0 | ||||||||||||||||||||||||
848 | if (QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
849 | return; never executed: return; | 0 | ||||||||||||||||||||||||
850 | if (!QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
851 | QApplicationPrivate::app_pal = new QPalette(pal); never executed: QApplicationPrivate::app_pal = new QPalette(pal); | 0 | ||||||||||||||||||||||||
852 | else | - | ||||||||||||||||||||||||
853 | * never executed: QApplicationPrivate::app_pal = pal;*QApplicationPrivate::app_pal = pal; never executed: *QApplicationPrivate::app_pal = pal; | 0 | ||||||||||||||||||||||||
854 | if (hash
| 0 | ||||||||||||||||||||||||
855 | all = true; | - | ||||||||||||||||||||||||
856 | if (clearWidgetPaletteHash
| 0 | ||||||||||||||||||||||||
857 | hash->clear(); never executed: hash->clear(); | 0 | ||||||||||||||||||||||||
858 | } never executed: end of block | 0 | ||||||||||||||||||||||||
859 | } never executed: else if (hashend of block
| 0 | ||||||||||||||||||||||||
860 | hash->insert(className, pal); | - | ||||||||||||||||||||||||
861 | } never executed: end of block | 0 | ||||||||||||||||||||||||
862 | - | |||||||||||||||||||||||||
863 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
864 | - | |||||||||||||||||||||||||
865 | QEvent e(QEvent::ApplicationPaletteChange); | - | ||||||||||||||||||||||||
866 | QApplication::sendEvent(QApplication::instance(), &e); | - | ||||||||||||||||||||||||
867 | - | |||||||||||||||||||||||||
868 | QWidgetList wids = QApplication::allWidgets(); | - | ||||||||||||||||||||||||
869 | for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
870 | QWidget *w = *it; | - | ||||||||||||||||||||||||
871 | if (all
| 0 | ||||||||||||||||||||||||
872 | QApplication::sendEvent(w, &e); never executed: QApplication::sendEvent(w, &e); | 0 | ||||||||||||||||||||||||
873 | } never executed: end of block | 0 | ||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||
875 | - | |||||||||||||||||||||||||
876 | - | |||||||||||||||||||||||||
877 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - | ||||||||||||||||||||||||
878 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - | ||||||||||||||||||||||||
879 | it != scenes.constEnd()
| 0 | ||||||||||||||||||||||||
880 | QApplication::sendEvent(*it, &e); | - | ||||||||||||||||||||||||
881 | } never executed: end of block | 0 | ||||||||||||||||||||||||
882 | - | |||||||||||||||||||||||||
883 | } never executed: end of block | 0 | ||||||||||||||||||||||||
884 | if (!className
| 0 | ||||||||||||||||||||||||
885 | if (!QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
886 | QApplicationPrivate::set_pal = new QPalette(palette); never executed: QApplicationPrivate::set_pal = new QPalette(palette); | 0 | ||||||||||||||||||||||||
887 | else | - | ||||||||||||||||||||||||
888 | * never executed: QApplicationPrivate::set_pal = palette;*QApplicationPrivate::set_pal = palette; never executed: *QApplicationPrivate::set_pal = palette; | 0 | ||||||||||||||||||||||||
889 | QCoreApplication::setAttribute(Qt::AA_SetPalette); | - | ||||||||||||||||||||||||
890 | } never executed: end of block | 0 | ||||||||||||||||||||||||
891 | } never executed: end of block | 0 | ||||||||||||||||||||||||
892 | void QApplication::setPalette(const QPalette &palette, const char* className) | - | ||||||||||||||||||||||||
893 | { | - | ||||||||||||||||||||||||
894 | QApplicationPrivate::setPalette_helper(palette, className, true); | - | ||||||||||||||||||||||||
895 | } never executed: end of block | 0 | ||||||||||||||||||||||||
896 | - | |||||||||||||||||||||||||
897 | - | |||||||||||||||||||||||||
898 | - | |||||||||||||||||||||||||
899 | void QApplicationPrivate::setSystemPalette(const QPalette &pal) | - | ||||||||||||||||||||||||
900 | { | - | ||||||||||||||||||||||||
901 | QPalette adjusted; | - | ||||||||||||||||||||||||
902 | adjusted = pal; | - | ||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||
904 | - | |||||||||||||||||||||||||
905 | if (!sys_pal
| 0 | ||||||||||||||||||||||||
906 | sys_pal = new QPalette(adjusted); never executed: sys_pal = new QPalette(adjusted); | 0 | ||||||||||||||||||||||||
907 | else | - | ||||||||||||||||||||||||
908 | * never executed: sys_pal = adjusted;*sys_pal = adjusted; never executed: *sys_pal = adjusted; | 0 | ||||||||||||||||||||||||
909 | - | |||||||||||||||||||||||||
910 | - | |||||||||||||||||||||||||
911 | if (!QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
912 | QApplication::setPalette(*sys_pal); never executed: QApplication::setPalette(*sys_pal); | 0 | ||||||||||||||||||||||||
913 | } never executed: end of block | 0 | ||||||||||||||||||||||||
914 | - | |||||||||||||||||||||||||
915 | - | |||||||||||||||||||||||||
916 | - | |||||||||||||||||||||||||
917 | - | |||||||||||||||||||||||||
918 | - | |||||||||||||||||||||||||
919 | - | |||||||||||||||||||||||||
920 | QFont QApplication::font() | - | ||||||||||||||||||||||||
921 | { | - | ||||||||||||||||||||||||
922 | return never executed: QGuiApplication::font();return QGuiApplication::font(); never executed: return QGuiApplication::font(); | 0 | ||||||||||||||||||||||||
923 | } | - | ||||||||||||||||||||||||
924 | QFont QApplication::font(const QWidget *widget) | - | ||||||||||||||||||||||||
925 | { | - | ||||||||||||||||||||||||
926 | typedef FontHash::const_iterator FontHashConstIt; | - | ||||||||||||||||||||||||
927 | - | |||||||||||||||||||||||||
928 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
929 | - | |||||||||||||||||||||||||
930 | if (widget
| 0 | ||||||||||||||||||||||||
931 | FontHashConstIt it = hash->constFind(widget->metaObject()->className()); | - | ||||||||||||||||||||||||
932 | const FontHashConstIt cend = hash->constEnd(); | - | ||||||||||||||||||||||||
933 | if (it != cend
| 0 | ||||||||||||||||||||||||
934 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
935 | for (it = hash->constBegin(); it != cend
| 0 | ||||||||||||||||||||||||
936 | if (widget->inherits(it.key())
| 0 | ||||||||||||||||||||||||
937 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
938 | } never executed: end of block | 0 | ||||||||||||||||||||||||
939 | } never executed: end of block | 0 | ||||||||||||||||||||||||
940 | return never executed: font();return font(); never executed: return font(); | 0 | ||||||||||||||||||||||||
941 | } | - | ||||||||||||||||||||||||
942 | QFont QApplication::font(const char *className) | - | ||||||||||||||||||||||||
943 | { | - | ||||||||||||||||||||||||
944 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
945 | if (className
| 0 | ||||||||||||||||||||||||
946 | QHash<QByteArray, QFont>::ConstIterator it = hash->constFind(className); | - | ||||||||||||||||||||||||
947 | if (it != hash->constEnd()
| 0 | ||||||||||||||||||||||||
948 | return never executed: *it;return *it; never executed: return *it; | 0 | ||||||||||||||||||||||||
949 | } never executed: end of block | 0 | ||||||||||||||||||||||||
950 | return never executed: font();return font(); never executed: return font(); | 0 | ||||||||||||||||||||||||
951 | } | - | ||||||||||||||||||||||||
952 | void QApplication::setFont(const QFont &font, const char *className) | - | ||||||||||||||||||||||||
953 | { | - | ||||||||||||||||||||||||
954 | bool all = false; | - | ||||||||||||||||||||||||
955 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
956 | if (!className
| 0 | ||||||||||||||||||||||||
957 | QGuiApplication::setFont(font); | - | ||||||||||||||||||||||||
958 | if (hash
| 0 | ||||||||||||||||||||||||
959 | all = true; | - | ||||||||||||||||||||||||
960 | hash->clear(); | - | ||||||||||||||||||||||||
961 | } never executed: end of block | 0 | ||||||||||||||||||||||||
962 | } never executed: else if (hashend of block
| 0 | ||||||||||||||||||||||||
963 | hash->insert(className, font); | - | ||||||||||||||||||||||||
964 | } never executed: end of block | 0 | ||||||||||||||||||||||||
965 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
966 | - | |||||||||||||||||||||||||
967 | QEvent e(QEvent::ApplicationFontChange); | - | ||||||||||||||||||||||||
968 | QApplication::sendEvent(QApplication::instance(), &e); | - | ||||||||||||||||||||||||
969 | - | |||||||||||||||||||||||||
970 | QWidgetList wids = QApplication::allWidgets(); | - | ||||||||||||||||||||||||
971 | for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
972 | QWidget *w = *it; | - | ||||||||||||||||||||||||
973 | if (all
| 0 | ||||||||||||||||||||||||
974 | sendEvent(w, &e); never executed: sendEvent(w, &e); | 0 | ||||||||||||||||||||||||
975 | } never executed: end of block | 0 | ||||||||||||||||||||||||
976 | - | |||||||||||||||||||||||||
977 | - | |||||||||||||||||||||||||
978 | - | |||||||||||||||||||||||||
979 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - | ||||||||||||||||||||||||
980 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - | ||||||||||||||||||||||||
981 | it != scenes.constEnd()
| 0 | ||||||||||||||||||||||||
982 | QApplication::sendEvent(*it, &e); | - | ||||||||||||||||||||||||
983 | } never executed: end of block | 0 | ||||||||||||||||||||||||
984 | - | |||||||||||||||||||||||||
985 | } never executed: end of block | 0 | ||||||||||||||||||||||||
986 | if (!className
| 0 | ||||||||||||||||||||||||
987 | if (!QApplicationPrivate::set_font
| 0 | ||||||||||||||||||||||||
988 | QApplicationPrivate::set_font = new QFont(font); never executed: QApplicationPrivate::set_font = new QFont(font); | 0 | ||||||||||||||||||||||||
989 | else | - | ||||||||||||||||||||||||
990 | * never executed: QApplicationPrivate::set_font = font;*QApplicationPrivate::set_font = font; never executed: *QApplicationPrivate::set_font = font; | 0 | ||||||||||||||||||||||||
991 | } | - | ||||||||||||||||||||||||
992 | } never executed: end of block | 0 | ||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||
994 | - | |||||||||||||||||||||||||
995 | - | |||||||||||||||||||||||||
996 | void QApplicationPrivate::setSystemFont(const QFont &font) | - | ||||||||||||||||||||||||
997 | { | - | ||||||||||||||||||||||||
998 | if (!sys_font
| 0 | ||||||||||||||||||||||||
999 | sys_font = new QFont(font); never executed: sys_font = new QFont(font); | 0 | ||||||||||||||||||||||||
1000 | else | - | ||||||||||||||||||||||||
1001 | * never executed: sys_font = font;*sys_font = font; never executed: *sys_font = font; | 0 | ||||||||||||||||||||||||
1002 | - | |||||||||||||||||||||||||
1003 | if (!QApplicationPrivate::set_font
| 0 | ||||||||||||||||||||||||
1004 | QApplication::setFont(*sys_font); never executed: QApplication::setFont(*sys_font); | 0 | ||||||||||||||||||||||||
1005 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1006 | - | |||||||||||||||||||||||||
1007 | - | |||||||||||||||||||||||||
1008 | - | |||||||||||||||||||||||||
1009 | QString QApplicationPrivate::desktopStyleKey() | - | ||||||||||||||||||||||||
1010 | { | - | ||||||||||||||||||||||||
1011 | - | |||||||||||||||||||||||||
1012 | - | |||||||||||||||||||||||||
1013 | if (const
| 0 | ||||||||||||||||||||||||
1014 | const QStringList availableKeys = QStyleFactory::keys(); | - | ||||||||||||||||||||||||
1015 | const auto styles = theme->themeHint(QPlatformTheme::StyleNames).toStringList(); | - | ||||||||||||||||||||||||
1016 | for (const QString &style : styles) { | - | ||||||||||||||||||||||||
1017 | if (availableKeys.contains(style, Qt::CaseInsensitive)
| 0 | ||||||||||||||||||||||||
1018 | return never executed: style;return style; never executed: return style; | 0 | ||||||||||||||||||||||||
1019 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1020 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1021 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
1022 | } | - | ||||||||||||||||||||||||
1023 | QIcon QApplication::windowIcon() | - | ||||||||||||||||||||||||
1024 | { | - | ||||||||||||||||||||||||
1025 | return never executed: QGuiApplication::windowIcon();return QGuiApplication::windowIcon(); never executed: return QGuiApplication::windowIcon(); | 0 | ||||||||||||||||||||||||
1026 | } | - | ||||||||||||||||||||||||
1027 | - | |||||||||||||||||||||||||
1028 | void QApplication::setWindowIcon(const QIcon &icon) | - | ||||||||||||||||||||||||
1029 | { | - | ||||||||||||||||||||||||
1030 | QGuiApplication::setWindowIcon(icon); | - | ||||||||||||||||||||||||
1031 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1032 | - | |||||||||||||||||||||||||
1033 | - | |||||||||||||||||||||||||
1034 | void QApplicationPrivate::notifyWindowIconChanged() | - | ||||||||||||||||||||||||
1035 | { | - | ||||||||||||||||||||||||
1036 | QEvent ev(QEvent::ApplicationWindowIconChange); | - | ||||||||||||||||||||||||
1037 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
1038 | QWindowList windowList = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||
1039 | - | |||||||||||||||||||||||||
1040 | - | |||||||||||||||||||||||||
1041 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1042 | windowList.removeOne(w->windowHandle()); | - | ||||||||||||||||||||||||
1043 | QCoreApplication::sendEvent(w, &ev); | - | ||||||||||||||||||||||||
1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||
1046 | - | |||||||||||||||||||||||||
1047 | - | |||||||||||||||||||||||||
1048 | for (int i = 0; i < windowList.size()
| 0 | ||||||||||||||||||||||||
1049 | QCoreApplication::sendEvent(windowList.at(i), &ev); never executed: QCoreApplication::sendEvent(windowList.at(i), &ev); | 0 | ||||||||||||||||||||||||
1050 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1051 | QWidgetList QApplication::topLevelWidgets() | - | ||||||||||||||||||||||||
1052 | { | - | ||||||||||||||||||||||||
1053 | QWidgetList list; | - | ||||||||||||||||||||||||
1054 | QWidgetList all = allWidgets(); | - | ||||||||||||||||||||||||
1055 | - | |||||||||||||||||||||||||
1056 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
1057 | QWidget *w = *it; | - | ||||||||||||||||||||||||
1058 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
1059 | list.append(w); never executed: list.append(w); | 0 | ||||||||||||||||||||||||
1060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1061 | return never executed: list;return list; never executed: return list; | 0 | ||||||||||||||||||||||||
1062 | } | - | ||||||||||||||||||||||||
1063 | QWidgetList QApplication::allWidgets() | - | ||||||||||||||||||||||||
1064 | { | - | ||||||||||||||||||||||||
1065 | if (QWidgetPrivate::allWidgets
| 0 | ||||||||||||||||||||||||
1066 | return never executed: QWidgetPrivate::allWidgets->toList();return QWidgetPrivate::allWidgets->toList(); never executed: return QWidgetPrivate::allWidgets->toList(); | 0 | ||||||||||||||||||||||||
1067 | return never executed: QWidgetList();return QWidgetList(); never executed: return QWidgetList(); | 0 | ||||||||||||||||||||||||
1068 | } | - | ||||||||||||||||||||||||
1069 | QWidget *QApplication::focusWidget() | - | ||||||||||||||||||||||||
1070 | { | - | ||||||||||||||||||||||||
1071 | return never executed: QApplicationPrivate::focus_widget;return QApplicationPrivate::focus_widget; never executed: return QApplicationPrivate::focus_widget; | 0 | ||||||||||||||||||||||||
1072 | } | - | ||||||||||||||||||||||||
1073 | - | |||||||||||||||||||||||||
1074 | void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) | - | ||||||||||||||||||||||||
1075 | { | - | ||||||||||||||||||||||||
1076 | - | |||||||||||||||||||||||||
1077 | if (focus
| 0 | ||||||||||||||||||||||||
1078 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1079 | - | |||||||||||||||||||||||||
1080 | - | |||||||||||||||||||||||||
1081 | hidden_focus_widget = 0; | - | ||||||||||||||||||||||||
1082 | - | |||||||||||||||||||||||||
1083 | if (focus != focus_widget
| 0 | ||||||||||||||||||||||||
1084 | if (focus
| 0 | ||||||||||||||||||||||||
1085 | hidden_focus_widget = focus; | - | ||||||||||||||||||||||||
1086 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1087 | } | - | ||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||
1089 | if (focus
| 0 | ||||||||||||||||||||||||
1090 | && qt_in_tab_key_event
| 0 | ||||||||||||||||||||||||
1091 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); never executed: focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); | 0 | ||||||||||||||||||||||||
1092 | else if (focus
| 0 | ||||||||||||||||||||||||
1093 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - | ||||||||||||||||||||||||
1094 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1095 | QWidget *prev = focus_widget; | - | ||||||||||||||||||||||||
1096 | focus_widget = focus; | - | ||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||
1098 | if(focus_widget
| 0 | ||||||||||||||||||||||||
1099 | focus_widget->d_func()->setFocus_sys(); never executed: focus_widget->d_func()->setFocus_sys(); | 0 | ||||||||||||||||||||||||
1100 | - | |||||||||||||||||||||||||
1101 | if (reason != Qt::NoFocusReason
| 0 | ||||||||||||||||||||||||
1102 | - | |||||||||||||||||||||||||
1103 | - | |||||||||||||||||||||||||
1104 | if (prev
| 0 | ||||||||||||||||||||||||
1105 | - | |||||||||||||||||||||||||
1106 | - | |||||||||||||||||||||||||
1107 | - | |||||||||||||||||||||||||
1108 | - | |||||||||||||||||||||||||
1109 | - | |||||||||||||||||||||||||
1110 | - | |||||||||||||||||||||||||
1111 | QFocusEvent out(QEvent::FocusOut, reason); | - | ||||||||||||||||||||||||
1112 | QPointer<QWidget> that = prev; | - | ||||||||||||||||||||||||
1113 | QApplication::sendEvent(prev, &out); | - | ||||||||||||||||||||||||
1114 | if (that
| 0 | ||||||||||||||||||||||||
1115 | QApplication::sendEvent(that->style(), &out); never executed: QApplication::sendEvent(that->style(), &out); | 0 | ||||||||||||||||||||||||
1116 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1117 | if(focus
| 0 | ||||||||||||||||||||||||
1118 | QFocusEvent in(QEvent::FocusIn, reason); | - | ||||||||||||||||||||||||
1119 | QPointer<QWidget> that = focus; | - | ||||||||||||||||||||||||
1120 | QApplication::sendEvent(focus, &in); | - | ||||||||||||||||||||||||
1121 | if (that
| 0 | ||||||||||||||||||||||||
1122 | QApplication::sendEvent(that->style(), &in); never executed: QApplication::sendEvent(that->style(), &in); | 0 | ||||||||||||||||||||||||
1123 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1124 | (static_cast<QApplication *>(QCoreApplication::instance()))->focusChanged(prev, focus_widget); | - | ||||||||||||||||||||||||
1125 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1126 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1127 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1128 | QWidget *QApplication::activeWindow() | - | ||||||||||||||||||||||||
1129 | { | - | ||||||||||||||||||||||||
1130 | return never executed: QApplicationPrivate::active_window;return QApplicationPrivate::active_window; never executed: return QApplicationPrivate::active_window; | 0 | ||||||||||||||||||||||||
1131 | } | - | ||||||||||||||||||||||||
1132 | - | |||||||||||||||||||||||||
1133 | - | |||||||||||||||||||||||||
1134 | - | |||||||||||||||||||||||||
1135 | - | |||||||||||||||||||||||||
1136 | - | |||||||||||||||||||||||||
1137 | - | |||||||||||||||||||||||||
1138 | - | |||||||||||||||||||||||||
1139 | QFontMetrics QApplication::fontMetrics() | - | ||||||||||||||||||||||||
1140 | { | - | ||||||||||||||||||||||||
1141 | return never executed: desktop()->fontMetrics();return desktop()->fontMetrics(); never executed: return desktop()->fontMetrics(); | 0 | ||||||||||||||||||||||||
1142 | } | - | ||||||||||||||||||||||||
1143 | - | |||||||||||||||||||||||||
1144 | bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows) | - | ||||||||||||||||||||||||
1145 | { | - | ||||||||||||||||||||||||
1146 | ((!(processedWindows)) ? qt_assert("processedWindows",__FILE__,1910) : qt_noop()); | - | ||||||||||||||||||||||||
1147 | while (QWidget *w = QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
1148 | if (!w->isVisible()
| 0 | ||||||||||||||||||||||||
1149 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1150 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||
1151 | if (!window->close()
| 0 | ||||||||||||||||||||||||
1152 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1153 | if (window
| 0 | ||||||||||||||||||||||||
1154 | processedWindows->append(window); never executed: processedWindows->append(window); | 0 | ||||||||||||||||||||||||
1155 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1156 | - | |||||||||||||||||||||||||
1157 | retry: code before this statement never executed: retry: | 0 | ||||||||||||||||||||||||
1158 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
1159 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1160 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
1161 | !w->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||
1162 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||
1163 | if (!window->close()
| 0 | ||||||||||||||||||||||||
1164 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1165 | if (window
| 0 | ||||||||||||||||||||||||
1166 | processedWindows->append(window); never executed: processedWindows->append(window); | 0 | ||||||||||||||||||||||||
1167 | goto never executed: retry;goto retry; never executed: goto retry; | 0 | ||||||||||||||||||||||||
1168 | } | - | ||||||||||||||||||||||||
1169 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1170 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1171 | } | - | ||||||||||||||||||||||||
1172 | - | |||||||||||||||||||||||||
1173 | bool QApplicationPrivate::tryCloseAllWindows() | - | ||||||||||||||||||||||||
1174 | { | - | ||||||||||||||||||||||||
1175 | QWindowList processedWindows; | - | ||||||||||||||||||||||||
1176 | return never executed: QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows)return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); never executed: return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); | 0 | ||||||||||||||||||||||||
1177 | && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); never executed: return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); | 0 | ||||||||||||||||||||||||
1178 | } | - | ||||||||||||||||||||||||
1179 | void QApplication::closeAllWindows() | - | ||||||||||||||||||||||||
1180 | { | - | ||||||||||||||||||||||||
1181 | QWindowList processedWindows; | - | ||||||||||||||||||||||||
1182 | QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows); | - | ||||||||||||||||||||||||
1183 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1184 | void QApplication::aboutQt() | - | ||||||||||||||||||||||||
1185 | { | - | ||||||||||||||||||||||||
1186 | - | |||||||||||||||||||||||||
1187 | QMessageBox::aboutQt(activeWindow()); | - | ||||||||||||||||||||||||
1188 | - | |||||||||||||||||||||||||
1189 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1190 | bool QApplication::event(QEvent *e) | - | ||||||||||||||||||||||||
1191 | { | - | ||||||||||||||||||||||||
1192 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1193 | if(e->type() == QEvent::Close
| 0 | ||||||||||||||||||||||||
1194 | QCloseEvent *ce = static_cast<QCloseEvent*>(e); | - | ||||||||||||||||||||||||
1195 | ce->accept(); | - | ||||||||||||||||||||||||
1196 | closeAllWindows(); | - | ||||||||||||||||||||||||
1197 | - | |||||||||||||||||||||||||
1198 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
1199 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1200 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
1201 | (!(w->windowType() == Qt::Dialog)
| 0 | ||||||||||||||||||||||||
1202 | ce->ignore(); | - | ||||||||||||||||||||||||
1203 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1204 | } | - | ||||||||||||||||||||||||
1205 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1206 | if (ce->isAccepted()
| 0 | ||||||||||||||||||||||||
1207 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1208 | } | - | ||||||||||||||||||||||||
1209 | - | |||||||||||||||||||||||||
1210 | } never executed: else if (e->type() == QEvent::LocaleChangeend of block
| 0 | ||||||||||||||||||||||||
1211 | - | |||||||||||||||||||||||||
1212 | - | |||||||||||||||||||||||||
1213 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
1214 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1215 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
1216 | if (!w->testAttribute(Qt::WA_SetLocale)
| 0 | ||||||||||||||||||||||||
1217 | w->d_func()->setLocale_helper(QLocale(), true); never executed: w->d_func()->setLocale_helper(QLocale(), true); | 0 | ||||||||||||||||||||||||
1218 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1219 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1220 | - | |||||||||||||||||||||||||
1221 | } never executed: else if (e->type() == QEvent::Timerend of block
| 0 | ||||||||||||||||||||||||
1222 | QTimerEvent *te = static_cast<QTimerEvent*>(e); | - | ||||||||||||||||||||||||
1223 | ((!(te != 0)) ? qt_assert("te != 0",__FILE__,2035) : qt_noop()); | - | ||||||||||||||||||||||||
1224 | if (te->timerId() == d->toolTipWakeUp.timerId()
| 0 | ||||||||||||||||||||||||
1225 | d->toolTipWakeUp.stop(); | - | ||||||||||||||||||||||||
1226 | if (d->toolTipWidget
| 0 | ||||||||||||||||||||||||
1227 | QWidget *w = d->toolTipWidget->window(); | - | ||||||||||||||||||||||||
1228 | - | |||||||||||||||||||||||||
1229 | - | |||||||||||||||||||||||||
1230 | - | |||||||||||||||||||||||||
1231 | bool showToolTip = w->testAttribute(Qt::WA_AlwaysShowToolTips); | - | ||||||||||||||||||||||||
1232 | while (w
| 0 | ||||||||||||||||||||||||
1233 | showToolTip = w->isActiveWindow(); | - | ||||||||||||||||||||||||
1234 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
1235 | w = w
| 0 | ||||||||||||||||||||||||
1236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1237 | if (showToolTip
| 0 | ||||||||||||||||||||||||
1238 | QHelpEvent e(QEvent::ToolTip, d->toolTipPos, d->toolTipGlobalPos); | - | ||||||||||||||||||||||||
1239 | QApplication::sendEvent(d->toolTipWidget, &e); | - | ||||||||||||||||||||||||
1240 | if (e.isAccepted()
| 0 | ||||||||||||||||||||||||
1241 | QStyle *s = d->toolTipWidget->style(); | - | ||||||||||||||||||||||||
1242 | int sleepDelay = s->styleHint(QStyle::SH_ToolTip_FallAsleepDelay, 0, d->toolTipWidget, 0); | - | ||||||||||||||||||||||||
1243 | d->toolTipFallAsleep.start(sleepDelay, this); | - | ||||||||||||||||||||||||
1244 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1245 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1246 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1247 | } never executed: else if (te->timerId() == d->toolTipFallAsleep.timerId()end of block
| 0 | ||||||||||||||||||||||||
1248 | d->toolTipFallAsleep.stop(); | - | ||||||||||||||||||||||||
1249 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1250 | - | |||||||||||||||||||||||||
1251 | } never executed: else if (e->type() == QEvent::EnterWhatsThisModeend of block
| 0 | ||||||||||||||||||||||||
1252 | QWhatsThis::enterWhatsThisMode(); | - | ||||||||||||||||||||||||
1253 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1254 | - | |||||||||||||||||||||||||
1255 | } | - | ||||||||||||||||||||||||
1256 | - | |||||||||||||||||||||||||
1257 | if(e->type() == QEvent::LanguageChange
| 0 | ||||||||||||||||||||||||
1258 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
1259 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1260 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
1261 | postEvent(w, new QEvent(QEvent::LanguageChange)); never executed: postEvent(w, new QEvent(QEvent::LanguageChange)); | 0 | ||||||||||||||||||||||||
1262 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1263 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1264 | - | |||||||||||||||||||||||||
1265 | return never executed: QGuiApplication::event(e);return QGuiApplication::event(e); never executed: return QGuiApplication::event(e); | 0 | ||||||||||||||||||||||||
1266 | } | - | ||||||||||||||||||||||||
1267 | void QApplicationPrivate::notifyLayoutDirectionChange() | - | ||||||||||||||||||||||||
1268 | { | - | ||||||||||||||||||||||||
1269 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
1270 | QWindowList windowList = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||
1271 | - | |||||||||||||||||||||||||
1272 | - | |||||||||||||||||||||||||
1273 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1274 | windowList.removeAll(w->windowHandle()); | - | ||||||||||||||||||||||||
1275 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - | ||||||||||||||||||||||||
1276 | QCoreApplication::sendEvent(w, &ev); | - | ||||||||||||||||||||||||
1277 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1278 | - | |||||||||||||||||||||||||
1279 | - | |||||||||||||||||||||||||
1280 | - | |||||||||||||||||||||||||
1281 | for (int i = 0; i < windowList.size()
| 0 | ||||||||||||||||||||||||
1282 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - | ||||||||||||||||||||||||
1283 | QCoreApplication::sendEvent(windowList.at(i), &ev); | - | ||||||||||||||||||||||||
1284 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1286 | void QApplication::setActiveWindow(QWidget* act) | - | ||||||||||||||||||||||||
1287 | { | - | ||||||||||||||||||||||||
1288 | QWidget* window = act
| 0 | ||||||||||||||||||||||||
1289 | - | |||||||||||||||||||||||||
1290 | if (QApplicationPrivate::active_window == window
| 0 | ||||||||||||||||||||||||
1291 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1292 | - | |||||||||||||||||||||||||
1293 | - | |||||||||||||||||||||||||
1294 | if (window
| 0 | ||||||||||||||||||||||||
1295 | - | |||||||||||||||||||||||||
1296 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1297 | } | - | ||||||||||||||||||||||||
1298 | - | |||||||||||||||||||||||||
1299 | - | |||||||||||||||||||||||||
1300 | QWidgetList toBeActivated; | - | ||||||||||||||||||||||||
1301 | QWidgetList toBeDeactivated; | - | ||||||||||||||||||||||||
1302 | - | |||||||||||||||||||||||||
1303 | if (QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
1304 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)
| 0 | ||||||||||||||||||||||||
1305 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
1306 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1307 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
1308 | toBeDeactivated.append(w); never executed: toBeDeactivated.append(w); | 0 | ||||||||||||||||||||||||
1309 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1310 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1311 | toBeDeactivated.append(QApplicationPrivate::active_window); | - | ||||||||||||||||||||||||
1312 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1313 | } | - | ||||||||||||||||||||||||
1314 | - | |||||||||||||||||||||||||
1315 | if (QApplicationPrivate::focus_widget
| 0 | ||||||||||||||||||||||||
1316 | if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||
1317 | QGuiApplication::inputMethod()->commit(); never executed: QGuiApplication::inputMethod()->commit(); | 0 | ||||||||||||||||||||||||
1318 | - | |||||||||||||||||||||||||
1319 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
1320 | QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange); | - | ||||||||||||||||||||||||
1321 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1322 | - | |||||||||||||||||||||||||
1323 | QApplicationPrivate::active_window = window; | - | ||||||||||||||||||||||||
1324 | - | |||||||||||||||||||||||||
1325 | if (QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
1326 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)
| 0 | ||||||||||||||||||||||||
1327 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
1328 | for (auto *w : list) { | - | ||||||||||||||||||||||||
1329 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
1330 | toBeActivated.append(w); never executed: toBeActivated.append(w); | 0 | ||||||||||||||||||||||||
1331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1332 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1333 | toBeActivated.append(QApplicationPrivate::active_window); | - | ||||||||||||||||||||||||
1334 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1335 | - | |||||||||||||||||||||||||
1336 | } | - | ||||||||||||||||||||||||
1337 | - | |||||||||||||||||||||||||
1338 | - | |||||||||||||||||||||||||
1339 | QEvent activationChange(QEvent::ActivationChange); | - | ||||||||||||||||||||||||
1340 | QEvent windowActivate(QEvent::WindowActivate); | - | ||||||||||||||||||||||||
1341 | QEvent windowDeactivate(QEvent::WindowDeactivate); | - | ||||||||||||||||||||||||
1342 | - | |||||||||||||||||||||||||
1343 | for (int i = 0; i < toBeActivated.size()
| 0 | ||||||||||||||||||||||||
1344 | QWidget *w = toBeActivated.at(i); | - | ||||||||||||||||||||||||
1345 | sendSpontaneousEvent(w, &windowActivate); | - | ||||||||||||||||||||||||
1346 | sendSpontaneousEvent(w, &activationChange); | - | ||||||||||||||||||||||||
1347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1348 | - | |||||||||||||||||||||||||
1349 | for(int i = 0; i < toBeDeactivated.size()
| 0 | ||||||||||||||||||||||||
1350 | QWidget *w = toBeDeactivated.at(i); | - | ||||||||||||||||||||||||
1351 | sendSpontaneousEvent(w, &windowDeactivate); | - | ||||||||||||||||||||||||
1352 | sendSpontaneousEvent(w, &activationChange); | - | ||||||||||||||||||||||||
1353 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1354 | - | |||||||||||||||||||||||||
1355 | if (QApplicationPrivate::popupWidgets == 0
| 0 | ||||||||||||||||||||||||
1356 | - | |||||||||||||||||||||||||
1357 | if (!QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
1358 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
1359 | } never executed: else if (QApplicationPrivate::active_windowend of block
| 0 | ||||||||||||||||||||||||
1360 | QWidget *w = QApplicationPrivate::active_window->focusWidget(); | - | ||||||||||||||||||||||||
1361 | if (w
| 0 | ||||||||||||||||||||||||
1362 | w->setFocus(Qt::ActiveWindowFocusReason); never executed: w->setFocus(Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
1363 | else { | - | ||||||||||||||||||||||||
1364 | w = QApplicationPrivate::focusNextPrevChild_helper(QApplicationPrivate::active_window, true); | - | ||||||||||||||||||||||||
1365 | if (w
| 0 | ||||||||||||||||||||||||
1366 | w->setFocus(Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
1367 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1368 | - | |||||||||||||||||||||||||
1369 | w = QApplicationPrivate::focus_widget; | - | ||||||||||||||||||||||||
1370 | if (!w
| 0 | ||||||||||||||||||||||||
1371 | QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); never executed: QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
1372 | else if (!QApplicationPrivate::active_window->isAncestorOf(w)
| 0 | ||||||||||||||||||||||||
1373 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); never executed: QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
1374 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1375 | } | - | ||||||||||||||||||||||||
1376 | } | - | ||||||||||||||||||||||||
1377 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1378 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1379 | - | |||||||||||||||||||||||||
1380 | QWidget *qt_tlw_for_window(QWindow *wnd) | - | ||||||||||||||||||||||||
1381 | { | - | ||||||||||||||||||||||||
1382 | - | |||||||||||||||||||||||||
1383 | while (wnd
| 0 | ||||||||||||||||||||||||
1384 | QWindow *parent = wnd->parent(); | - | ||||||||||||||||||||||||
1385 | - | |||||||||||||||||||||||||
1386 | if (parent
| 0 | ||||||||||||||||||||||||
1387 | wnd = wnd->parent(); never executed: wnd = wnd->parent(); | 0 | ||||||||||||||||||||||||
1388 | else | - | ||||||||||||||||||||||||
1389 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1390 | } | - | ||||||||||||||||||||||||
1391 | if (wnd
| 0 | ||||||||||||||||||||||||
1392 | const auto tlws = (static_cast<QApplication *>(QCoreApplication::instance()))->topLevelWidgets(); | - | ||||||||||||||||||||||||
1393 | for (QWidget *tlw : tlws) { | - | ||||||||||||||||||||||||
1394 | if (tlw->windowHandle() == wnd
| 0 | ||||||||||||||||||||||||
1395 | return never executed: tlw;return tlw; never executed: return tlw; | 0 | ||||||||||||||||||||||||
1396 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1397 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1398 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1399 | } | - | ||||||||||||||||||||||||
1400 | - | |||||||||||||||||||||||||
1401 | void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous) | - | ||||||||||||||||||||||||
1402 | { | - | ||||||||||||||||||||||||
1403 | (void)previous;; | - | ||||||||||||||||||||||||
1404 | QWindow *wnd = QGuiApplicationPrivate::focus_window; | - | ||||||||||||||||||||||||
1405 | if (inPopupMode()
| 0 | ||||||||||||||||||||||||
1406 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1407 | QWidget *tlw = qt_tlw_for_window(wnd); | - | ||||||||||||||||||||||||
1408 | QApplication::setActiveWindow(tlw); | - | ||||||||||||||||||||||||
1409 | - | |||||||||||||||||||||||||
1410 | if (wnd
| 0 | ||||||||||||||||||||||||
1411 | if (QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(wnd)
| 0 | ||||||||||||||||||||||||
1412 | if (QWidget *widget = widgetWindow->widget()
| 0 | ||||||||||||||||||||||||
1413 | if (widget->inherits("QAxHostWidget")
| 0 | ||||||||||||||||||||||||
1414 | widget->setFocus(Qt::ActiveWindowFocusReason); never executed: widget->setFocus(Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
1415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1416 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1417 | - | |||||||||||||||||||||||||
1418 | - | |||||||||||||||||||||||||
1419 | - | |||||||||||||||||||||||||
1420 | - | |||||||||||||||||||||||||
1421 | - | |||||||||||||||||||||||||
1422 | - | |||||||||||||||||||||||||
1423 | QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next, | - | ||||||||||||||||||||||||
1424 | bool *wrappingOccurred) | - | ||||||||||||||||||||||||
1425 | { | - | ||||||||||||||||||||||||
1426 | uint focus_flag = qt_tab_all_widgets()
| 0 | ||||||||||||||||||||||||
1427 | - | |||||||||||||||||||||||||
1428 | QWidget *f = toplevel->focusWidget(); | - | ||||||||||||||||||||||||
1429 | if (!f
| 0 | ||||||||||||||||||||||||
1430 | f = toplevel; never executed: f = toplevel; | 0 | ||||||||||||||||||||||||
1431 | - | |||||||||||||||||||||||||
1432 | QWidget *w = f; | - | ||||||||||||||||||||||||
1433 | QWidget *test = f->d_func()->focus_next; | - | ||||||||||||||||||||||||
1434 | bool seenWindow = false; | - | ||||||||||||||||||||||||
1435 | bool focusWidgetAfterWindow = false; | - | ||||||||||||||||||||||||
1436 | while (test
| 0 | ||||||||||||||||||||||||
1437 | if (test->isWindow()
| 0 | ||||||||||||||||||||||||
1438 | seenWindow = true; never executed: seenWindow = true; | 0 | ||||||||||||||||||||||||
1439 | - | |||||||||||||||||||||||||
1440 | if ((
| 0 | ||||||||||||||||||||||||
1441 | && !(test->d_func()->extra
| 0 | ||||||||||||||||||||||||
1442 | && test->isVisibleTo(toplevel)
| 0 | ||||||||||||||||||||||||
1443 | && !(w->windowType() == Qt::SubWindow
| 0 | ||||||||||||||||||||||||
1444 | && (toplevel->windowType() != Qt::SubWindow
| 0 | ||||||||||||||||||||||||
1445 | w = test; | - | ||||||||||||||||||||||||
1446 | if (seenWindow
| 0 | ||||||||||||||||||||||||
1447 | focusWidgetAfterWindow = true; never executed: focusWidgetAfterWindow = true; | 0 | ||||||||||||||||||||||||
1448 | if (next
| 0 | ||||||||||||||||||||||||
1449 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1450 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1451 | test = test->d_func()->focus_next; | - | ||||||||||||||||||||||||
1452 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1453 | - | |||||||||||||||||||||||||
1454 | if (wrappingOccurred != 0
| 0 | ||||||||||||||||||||||||
1455 | * never executed: wrappingOccurred = next*wrappingOccurred = next ? focusWidgetAfterWindow : !focusWidgetAfterWindow;
never executed: *wrappingOccurred = next ? focusWidgetAfterWindow : !focusWidgetAfterWindow; | 0 | ||||||||||||||||||||||||
1456 | - | |||||||||||||||||||||||||
1457 | if (w == f
| 0 | ||||||||||||||||||||||||
1458 | if (qt_in_tab_key_event
| 0 | ||||||||||||||||||||||||
1459 | w->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - | ||||||||||||||||||||||||
1460 | w->update(); | - | ||||||||||||||||||||||||
1461 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1462 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1463 | } | - | ||||||||||||||||||||||||
1464 | return never executed: w;return w; never executed: return w; | 0 | ||||||||||||||||||||||||
1465 | } | - | ||||||||||||||||||||||||
1466 | void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, const QPointF &globalPosF) | - | ||||||||||||||||||||||||
1467 | { | - | ||||||||||||||||||||||||
1468 | if ((!enter
| 0 | ||||||||||||||||||||||||
1469 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1470 | - | |||||||||||||||||||||||||
1471 | - | |||||||||||||||||||||||||
1472 | - | |||||||||||||||||||||||||
1473 | QWidgetList leaveList; | - | ||||||||||||||||||||||||
1474 | QWidgetList enterList; | - | ||||||||||||||||||||||||
1475 | - | |||||||||||||||||||||||||
1476 | bool sameWindow = leave
| 0 | ||||||||||||||||||||||||
1477 | if (leave
| 0 | ||||||||||||||||||||||||
1478 | auto *w = leave; | - | ||||||||||||||||||||||||
1479 | do { | - | ||||||||||||||||||||||||
1480 | leaveList.append(w); | - | ||||||||||||||||||||||||
1481 | } never executed: while (!w->isWindow()end of block
| 0 | ||||||||||||||||||||||||
1482 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1483 | if (enter
| 0 | ||||||||||||||||||||||||
1484 | auto *w = enter; | - | ||||||||||||||||||||||||
1485 | do { | - | ||||||||||||||||||||||||
1486 | enterList.append(w); | - | ||||||||||||||||||||||||
1487 | } never executed: while (!w->isWindow()end of block
| 0 | ||||||||||||||||||||||||
1488 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1489 | if (sameWindow
| 0 | ||||||||||||||||||||||||
1490 | int enterDepth = 0; | - | ||||||||||||||||||||||||
1491 | int leaveDepth = 0; | - | ||||||||||||||||||||||||
1492 | auto *e = enter; | - | ||||||||||||||||||||||||
1493 | while (!e->isWindow()
| 0 | ||||||||||||||||||||||||
1494 | enterDepth++; never executed: enterDepth++; | 0 | ||||||||||||||||||||||||
1495 | auto *l = leave; | - | ||||||||||||||||||||||||
1496 | while (!l->isWindow()
| 0 | ||||||||||||||||||||||||
1497 | leaveDepth++; never executed: leaveDepth++; | 0 | ||||||||||||||||||||||||
1498 | QWidget* wenter = enter; | - | ||||||||||||||||||||||||
1499 | QWidget* wleave = leave; | - | ||||||||||||||||||||||||
1500 | while (enterDepth > leaveDepth
| 0 | ||||||||||||||||||||||||
1501 | wenter = wenter->parentWidget(); | - | ||||||||||||||||||||||||
1502 | enterDepth--; | - | ||||||||||||||||||||||||
1503 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1504 | while (leaveDepth > enterDepth
| 0 | ||||||||||||||||||||||||
1505 | wleave = wleave->parentWidget(); | - | ||||||||||||||||||||||||
1506 | leaveDepth--; | - | ||||||||||||||||||||||||
1507 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1508 | while (!wenter->isWindow()
| 0 | ||||||||||||||||||||||||
1509 | wenter = wenter->parentWidget(); | - | ||||||||||||||||||||||||
1510 | wleave = wleave->parentWidget(); | - | ||||||||||||||||||||||||
1511 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1512 | - | |||||||||||||||||||||||||
1513 | for (auto *w = leave; w != wleave
| 0 | ||||||||||||||||||||||||
1514 | leaveList.append(w); never executed: leaveList.append(w); | 0 | ||||||||||||||||||||||||
1515 | - | |||||||||||||||||||||||||
1516 | for (auto *w = enter; w != wenter
| 0 | ||||||||||||||||||||||||
1517 | enterList.append(w); never executed: enterList.append(w); | 0 | ||||||||||||||||||||||||
1518 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1519 | - | |||||||||||||||||||||||||
1520 | QEvent leaveEvent(QEvent::Leave); | - | ||||||||||||||||||||||||
1521 | for (int i = 0; i < leaveList.size()
| 0 | ||||||||||||||||||||||||
1522 | auto *w = leaveList.at(i); | - | ||||||||||||||||||||||||
1523 | if (!QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
1524 | QApplication::sendEvent(w, &leaveEvent); | - | ||||||||||||||||||||||||
1525 | if (w->testAttribute(Qt::WA_Hover)
| 0 | ||||||||||||||||||||||||
1526 | (!QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
1527 | ((!(instance())) ? qt_assert("instance()",__FILE__,2391) : qt_noop()); | - | ||||||||||||||||||||||||
1528 | QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos), | - | ||||||||||||||||||||||||
1529 | QApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||
1530 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->notify_helper(w, &he); | - | ||||||||||||||||||||||||
1531 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1532 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1533 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1534 | if (!enterList.isEmpty()
| 0 | ||||||||||||||||||||||||
1535 | - | |||||||||||||||||||||||||
1536 | const QPoint globalPos = qIsInf(globalPosF.x())
| 0 | ||||||||||||||||||||||||
1537 | ? QPoint(((1<<24)-1), ((1<<24)-1)) | - | ||||||||||||||||||||||||
1538 | : globalPosF.toPoint(); | - | ||||||||||||||||||||||||
1539 | const QPoint windowPos = qAsConst(enterList).back()->window()->mapFromGlobal(globalPos); | - | ||||||||||||||||||||||||
1540 | for (auto it = enterList.crbegin(), end = enterList.crend(); it != end
| 0 | ||||||||||||||||||||||||
1541 | auto *w = *it; | - | ||||||||||||||||||||||||
1542 | if (!QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
1543 | const QPointF localPos = w->mapFromGlobal(globalPos); | - | ||||||||||||||||||||||||
1544 | QEnterEvent enterEvent(localPos, windowPos, globalPosF); | - | ||||||||||||||||||||||||
1545 | QApplication::sendEvent(w, &enterEvent); | - | ||||||||||||||||||||||||
1546 | if (w->testAttribute(Qt::WA_Hover) |