Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | static bool qt_enable_backingstore = true; | - |
12 | static inline bool qRectIntersects(const QRect &r1, const QRect &r2) | - |
13 | { | - |
14 | return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && | 75657 |
15 | qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); Execution Count:75657 | 75657 |
16 | } | - |
17 | | - |
18 | static inline bool hasBackingStoreSupport() | - |
19 | { | - |
20 | return true; executed: return true; Execution Count:102707 | 102707 |
21 | } | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); | - |
28 | extern QDesktopWidget *qt_desktopWidget; | - |
29 | QWidgetBackingStoreTracker::QWidgetBackingStoreTracker() | - |
30 | : m_ptr(0) | - |
31 | { | - |
32 | | - |
33 | } executed: } Execution Count:3525 | 3525 |
34 | | - |
35 | QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker() | - |
36 | { | - |
37 | delete m_ptr; | - |
38 | } executed: } Execution Count:3482 | 3482 |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | void QWidgetBackingStoreTracker::create(QWidget *widget) | - |
47 | { | - |
48 | destroy(); | - |
49 | m_ptr = new QWidgetBackingStore(widget); | - |
50 | } executed: } Execution Count:2504 | 2504 |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | void QWidgetBackingStoreTracker::destroy() | - |
58 | { | - |
59 | delete m_ptr; | - |
60 | m_ptr = 0; | - |
61 | m_widgets.clear(); | - |
62 | } executed: } Execution Count:11813 | 11813 |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | void QWidgetBackingStoreTracker::registerWidget(QWidget *w) | - |
70 | { | - |
71 | qt_noop(); | - |
72 | qt_noop(); | - |
73 | qt_noop(); | - |
74 | m_widgets.insert(w); | - |
75 | } | 0 |
76 | void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w) | - |
77 | { | - |
78 | if (m_widgets.remove(w) && m_widgets.isEmpty()) { partially evaluated: m_widgets.remove(w) no Evaluation Count:0 | yes Evaluation Count:324 |
never evaluated: m_widgets.isEmpty() | 0-324 |
79 | delete m_ptr; | - |
80 | m_ptr = 0; | - |
81 | } | 0 |
82 | } executed: } Execution Count:324 | 324 |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget) | - |
89 | { | - |
90 | unregisterWidget(widget); | - |
91 | for (QForeachContainer<__typeof__(widget->children())> _container_(widget->children()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QObject *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
92 | if (QWidget *childWidget = qobject_cast<QWidget *>(child)) evaluated: QWidget *childWidget = qobject_cast<QWidget *>(child) yes Evaluation Count:139 | yes Evaluation Count:318 |
| 139-318 |
93 | unregisterWidgetSubtree(childWidget); executed: unregisterWidgetSubtree(childWidget); Execution Count:139 | 139 |
94 | } executed: } Execution Count:324 | 324 |
95 | | - |
96 | QWidgetPrivate::QWidgetPrivate(int version) | - |
97 | : QObjectPrivate(version) | - |
98 | , extra(0) | - |
99 | , focus_next(0) | - |
100 | , focus_prev(0) | - |
101 | , focus_child(0) | - |
102 | , layout(0) | - |
103 | , needsFlush(0) | - |
104 | , redirectDev(0) | - |
105 | , widgetItem(0) | - |
106 | , extraPaintEngine(0) | - |
107 | , polished(0) | - |
108 | , graphicsEffect(0) | - |
109 | | - |
110 | , imHints(Qt::ImhNone) | - |
111 | | - |
112 | , inheritedFontResolveMask(0) | - |
113 | , inheritedPaletteResolveMask(0) | - |
114 | , leftmargin(0) | - |
115 | , topmargin(0) | - |
116 | , rightmargin(0) | - |
117 | , bottommargin(0) | - |
118 | , leftLayoutItemMargin(0) | - |
119 | , topLayoutItemMargin(0) | - |
120 | , rightLayoutItemMargin(0) | - |
121 | , bottomLayoutItemMargin(0) | - |
122 | , hd(0) | - |
123 | , size_policy(QSizePolicy::Preferred, QSizePolicy::Preferred) | - |
124 | , fg_role(QPalette::NoRole) | - |
125 | , bg_role(QPalette::NoRole) | - |
126 | , dirtyOpaqueChildren(1) | - |
127 | , isOpaque(0) | - |
128 | , inDirtyList(0) | - |
129 | , isScrolled(0) | - |
130 | , isMoved(0) | - |
131 | , usesDoubleBufferedGLContext(0) | - |
132 | | - |
133 | , inheritsInputMethodHints(0) | - |
134 | { | - |
135 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))) { partially evaluated: !(static_cast<QApplication *>(QCoreApplication::instance())) no Evaluation Count:0 | yes Evaluation Count:45562 |
| 0-45562 |
136 | QMessageLogger("kernel/qwidget.cpp", 285, __PRETTY_FUNCTION__).fatal("QWidget: Must construct a QApplication before a QPaintDevice"); | - |
137 | return; | 0 |
138 | } | - |
139 | | - |
140 | if (version != QObjectPrivateVersion) partially evaluated: version != QObjectPrivateVersion no Evaluation Count:0 | yes Evaluation Count:45562 |
| 0-45562 |
141 | QMessageLogger("kernel/qwidget.cpp", 290, __PRETTY_FUNCTION__).fatal("Cannot mix incompatible Qt libraries"); never executed: QMessageLogger("kernel/qwidget.cpp", 290, __PRETTY_FUNCTION__).fatal("Cannot mix incompatible Qt libraries"); | 0 |
142 | | - |
143 | isWidget = true; | - |
144 | memset(high_attributes, 0, sizeof(high_attributes)); | - |
145 | } executed: } Execution Count:45562 | 45562 |
146 | | - |
147 | | - |
148 | QWidgetPrivate::~QWidgetPrivate() | - |
149 | { | - |
150 | if (widgetItem) evaluated: widgetItem yes Evaluation Count:65 | yes Evaluation Count:41421 |
| 65-41421 |
151 | widgetItem->wid = 0; executed: widgetItem->wid = 0; Execution Count:65 | 65 |
152 | | - |
153 | if (extra) evaluated: extra yes Evaluation Count:16507 | yes Evaluation Count:24979 |
| 16507-24979 |
154 | deleteExtra(); executed: deleteExtra(); Execution Count:16507 | 16507 |
155 | | - |
156 | | - |
157 | delete graphicsEffect; | - |
158 | | - |
159 | } executed: } Execution Count:41486 | 41486 |
160 | | - |
161 | | - |
162 | | - |
163 | | - |
164 | void QWidgetPrivate::scrollChildren(int dx, int dy) | - |
165 | { | - |
166 | QWidget * const q = q_func(); | - |
167 | if (q->children().size() > 0) { evaluated: q->children().size() > 0 yes Evaluation Count:6 | yes Evaluation Count:14643 |
| 6-14643 |
168 | QPoint pd(dx, dy); | - |
169 | QObjectList childObjects = q->children(); | - |
170 | for (int i = 0; i < childObjects.size(); ++i) { evaluated: i < childObjects.size() yes Evaluation Count:6 | yes Evaluation Count:6 |
| 6 |
171 | QWidget *w = qobject_cast<QWidget*>(childObjects.at(i)); | - |
172 | if (w && !w->isWindow()) { partially evaluated: w yes Evaluation Count:6 | no Evaluation Count:0 |
partially evaluated: !w->isWindow() yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
173 | QPoint oldp = w->pos(); | - |
174 | QRect r(w->pos() + pd, w->size()); | - |
175 | w->data->crect = r; | - |
176 | if (w->testAttribute(Qt::WA_WState_Created)) partially evaluated: w->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
177 | w->d_func()->setWSGeometry(); executed: w->d_func()->setWSGeometry(); Execution Count:6 | 6 |
178 | w->d_func()->setDirtyOpaqueRegion(); | - |
179 | QMoveEvent e(r.topLeft(), oldp); | - |
180 | QApplication::sendEvent(w, &e); | - |
181 | } executed: } Execution Count:6 | 6 |
182 | } executed: } Execution Count:6 | 6 |
183 | } executed: } Execution Count:6 | 6 |
184 | } executed: } Execution Count:14649 | 14649 |
185 | | - |
186 | void QWidgetPrivate::updateWidgetTransform() | - |
187 | { | - |
188 | QWidget * const q = q_func(); | - |
189 | if (q == (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()) { evaluated: q == (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject() yes Evaluation Count:2324 | yes Evaluation Count:28042 |
| 2324-28042 |
190 | QTransform t; | - |
191 | QPoint p = q->mapTo(q->topLevelWidget(), QPoint(0,0)); | - |
192 | t.translate(p.x(), p.y()); | - |
193 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->setInputItemTransform(t); | - |
194 | } executed: } Execution Count:2324 | 2324 |
195 | } executed: } Execution Count:30366 | 30366 |
196 | bool QWidget::autoFillBackground() const | - |
197 | { | - |
198 | const QWidgetPrivate * const d = d_func(); | - |
199 | return d->extra && d->extra->autoFillBackground; executed: return d->extra && d->extra->autoFillBackground; Execution Count:107777 | 107777 |
200 | } | - |
201 | | - |
202 | void QWidget::setAutoFillBackground(bool enabled) | - |
203 | { | - |
204 | QWidgetPrivate * const d = d_func(); | - |
205 | if (!d->extra) evaluated: !d->extra yes Evaluation Count:5393 | yes Evaluation Count:962 |
| 962-5393 |
206 | d->createExtra(); executed: d->createExtra(); Execution Count:5393 | 5393 |
207 | if (d->extra->autoFillBackground == enabled) evaluated: d->extra->autoFillBackground == enabled yes Evaluation Count:73 | yes Evaluation Count:6282 |
| 73-6282 |
208 | return; executed: return; Execution Count:73 | 73 |
209 | | - |
210 | d->extra->autoFillBackground = enabled; | - |
211 | d->updateIsOpaque(); | - |
212 | update(); | - |
213 | d->updateIsOpaque(); | - |
214 | } executed: } Execution Count:6282 | 6282 |
215 | QWidgetMapper *QWidgetPrivate::mapper = 0; | - |
216 | QWidgetSet *QWidgetPrivate::allWidgets = 0; | - |
217 | | - |
218 | | - |
219 | | - |
220 | | - |
221 | | - |
222 | | - |
223 | QRegion qt_dirtyRegion(QWidget *widget) | - |
224 | { | - |
225 | if (!widget) | 0 |
226 | return QRegion(); never executed: return QRegion(); | 0 |
227 | | - |
228 | QWidgetBackingStore *bs = qt_widget_private(widget)->maybeBackingStore(); | - |
229 | if (!bs) | 0 |
230 | return QRegion(); never executed: return QRegion(); | 0 |
231 | | - |
232 | return bs->dirtyRegion(widget); never executed: return bs->dirtyRegion(widget); | 0 |
233 | } | - |
234 | struct QWidgetExceptionCleaner | - |
235 | { | - |
236 | | - |
237 | static inline void cleanup(QWidget *that, QWidgetPrivate *d) | - |
238 | { | - |
239 | | - |
240 | (void)that;; | - |
241 | (void)d;; | - |
242 | } | 0 |
243 | }; | - |
244 | QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) | - |
245 | : QObject(*new QWidgetPrivate, 0), QPaintDevice() | - |
246 | { | - |
247 | if (true) { partially evaluated: true yes Evaluation Count:19087 | no Evaluation Count:0 |
| 0-19087 |
248 | d_func()->init(parent, f); | - |
249 | } else { executed: } Execution Count:19087 | 19087 |
250 | QWidgetExceptionCleaner::cleanup(this, d_func()); | - |
251 | qt_noop(); | - |
252 | } | 0 |
253 | } | - |
254 | | - |
255 | | - |
256 | | - |
257 | | - |
258 | QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f) | - |
259 | : QObject(dd, 0), QPaintDevice() | - |
260 | { | - |
261 | QWidgetPrivate * const d = d_func(); | - |
262 | if (true) { partially evaluated: true yes Evaluation Count:26475 | no Evaluation Count:0 |
| 0-26475 |
263 | d->init(parent, f); | - |
264 | } else { executed: } Execution Count:26475 | 26475 |
265 | QWidgetExceptionCleaner::cleanup(this, d_func()); | - |
266 | qt_noop(); | - |
267 | } | 0 |
268 | } | - |
269 | | - |
270 | | - |
271 | | - |
272 | | - |
273 | int QWidget::devType() const | - |
274 | { | - |
275 | return QInternal::Widget; executed: return QInternal::Widget; Execution Count:45474 | 45474 |
276 | } | - |
277 | | - |
278 | | - |
279 | | - |
280 | void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) | - |
281 | { | - |
282 | bool customize = (flags & (Qt::CustomizeWindowHint | - |
283 | | Qt::FramelessWindowHint | - |
284 | | Qt::WindowTitleHint | - |
285 | | Qt::WindowSystemMenuHint | - |
286 | | Qt::WindowMinimizeButtonHint | - |
287 | | Qt::WindowMaximizeButtonHint | - |
288 | | Qt::WindowCloseButtonHint | - |
289 | | Qt::WindowContextHelpButtonHint)); | - |
290 | | - |
291 | uint type = (flags & Qt::WindowType_Mask); | - |
292 | | - |
293 | if ((type == Qt::Widget || type == Qt::SubWindow) && w && !w->parent()) { evaluated: type == Qt::Widget yes Evaluation Count:47693 | yes Evaluation Count:1699 |
evaluated: type == Qt::SubWindow yes Evaluation Count:21 | yes Evaluation Count:1678 |
partially evaluated: w yes Evaluation Count:47714 | no Evaluation Count:0 |
evaluated: !w->parent() yes Evaluation Count:7387 | yes Evaluation Count:40327 |
| 0-47714 |
294 | type = Qt::Window; | - |
295 | flags |= Qt::Window; | - |
296 | } executed: } Execution Count:7387 | 7387 |
297 | | - |
298 | if (flags & Qt::CustomizeWindowHint) { partially evaluated: flags & Qt::CustomizeWindowHint no Evaluation Count:0 | yes Evaluation Count:49392 |
| 0-49392 |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) { never evaluated: flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint) | 0 |
305 | flags |= Qt::WindowSystemMenuHint; | - |
306 | | - |
307 | | - |
308 | | - |
309 | | - |
310 | flags |= Qt::WindowTitleHint; | - |
311 | flags &= ~Qt::FramelessWindowHint; | - |
312 | } | 0 |
313 | } else if (customize && !(flags & Qt::FramelessWindowHint)) { evaluated: customize yes Evaluation Count:3805 | yes Evaluation Count:45587 |
evaluated: !(flags & Qt::FramelessWindowHint) yes Evaluation Count:3547 | yes Evaluation Count:258 |
| 0-45587 |
314 | | - |
315 | | - |
316 | | - |
317 | flags |= Qt::WindowSystemMenuHint; | - |
318 | flags |= Qt::WindowTitleHint; | - |
319 | } executed: } Execution Count:3547 | 3547 |
320 | if (customize) evaluated: customize yes Evaluation Count:3805 | yes Evaluation Count:45587 |
| 3805-45587 |
321 | ; executed: ; Execution Count:3805 | 3805 |
322 | else if (type == Qt::Dialog || type == Qt::Sheet) evaluated: type == Qt::Dialog yes Evaluation Count:339 | yes Evaluation Count:45248 |
evaluated: type == Qt::Sheet yes Evaluation Count:1 | yes Evaluation Count:45247 |
| 1-45248 |
323 | | - |
324 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; Execution Count:340 | 340 |
325 | | - |
326 | | - |
327 | | - |
328 | else if (type == Qt::Tool) evaluated: type == Qt::Tool yes Evaluation Count:7 | yes Evaluation Count:45240 |
| 7-45240 |
329 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; Execution Count:7 | 7 |
330 | else | - |
331 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | | 45240 |
332 | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; Execution Count:45240 | 45240 |
333 | | - |
334 | } | - |
335 | | - |
336 | void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) | - |
337 | { | - |
338 | QWidget * const q = q_func(); | - |
339 | if (!qobject_cast<QApplication *>(QCoreApplication::instance())) partially evaluated: !qobject_cast<QApplication *>(QCoreApplication::instance()) no Evaluation Count:0 | yes Evaluation Count:45562 |
| 0-45562 |
340 | QMessageLogger("kernel/qwidget.cpp", 1092, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication"); never executed: QMessageLogger("kernel/qwidget.cpp", 1092, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication"); | 0 |
341 | | - |
342 | qt_noop(); | - |
343 | if (allWidgets) partially evaluated: allWidgets yes Evaluation Count:45562 | no Evaluation Count:0 |
| 0-45562 |
344 | allWidgets->insert(q); executed: allWidgets->insert(q); Execution Count:45562 | 45562 |
345 | | - |
346 | QWidget *desktopWidget = 0; | - |
347 | if (parentWidget && parentWidget->windowType() == Qt::Desktop) { evaluated: parentWidget yes Evaluation Count:37602 | yes Evaluation Count:7960 |
partially evaluated: parentWidget->windowType() == Qt::Desktop no Evaluation Count:0 | yes Evaluation Count:37602 |
| 0-37602 |
348 | desktopWidget = parentWidget; | - |
349 | parentWidget = 0; | - |
350 | } | 0 |
351 | | - |
352 | q->data = &data; | - |
353 | | - |
354 | | - |
355 | if (!parent) { partially evaluated: !parent yes Evaluation Count:45562 | no Evaluation Count:0 |
| 0-45562 |
356 | qt_noop(); | - |
357 | | - |
358 | } executed: } Execution Count:45562 | 45562 |
359 | if (desktopWidget) { partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:45562 |
| 0-45562 |
360 | const int screen = desktopWidget->d_func()->topData()->screenIndex; | - |
361 | if (QWindow *window = q->windowHandle()) never evaluated: QWindow *window = q->windowHandle() | 0 |
362 | window->setScreen(QGuiApplication::screens().value(screen, 0)); never executed: window->setScreen(QGuiApplication::screens().value(screen, 0)); | 0 |
363 | } | 0 |
364 | | - |
365 | data.fstrut_dirty = true; | - |
366 | | - |
367 | data.winid = 0; | - |
368 | data.widget_attributes = 0; | - |
369 | data.window_flags = f; | - |
370 | data.window_state = 0; | - |
371 | data.focus_policy = 0; | - |
372 | data.context_menu_policy = Qt::DefaultContextMenu; | - |
373 | data.window_modality = Qt::NonModal; | - |
374 | | - |
375 | data.sizehint_forced = 0; | - |
376 | data.is_closing = 0; | - |
377 | data.in_show = 0; | - |
378 | data.in_set_window_state = 0; | - |
379 | data.in_destructor = false; | - |
380 | | - |
381 | | - |
382 | if (f & Qt::MSWindowsOwnDC) evaluated: f & Qt::MSWindowsOwnDC yes Evaluation Count:1 | yes Evaluation Count:45561 |
| 1-45561 |
383 | q->setAttribute(Qt::WA_NativeWindow); executed: q->setAttribute(Qt::WA_NativeWindow); Execution Count:1 | 1 |
384 | | - |
385 | | - |
386 | | - |
387 | | - |
388 | | - |
389 | q->setAttribute(Qt::WA_QuitOnClose); | - |
390 | adjustQuitOnCloseAttribute(); | - |
391 | | - |
392 | q->setAttribute(Qt::WA_WState_Hidden); | - |
393 | | - |
394 | | - |
395 | data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,640,480); evaluated: parentWidget yes Evaluation Count:37602 | yes Evaluation Count:7960 |
| 7960-37602 |
396 | focus_next = focus_prev = q; | - |
397 | | - |
398 | if ((f & Qt::WindowType_Mask) == Qt::Desktop) evaluated: (f & Qt::WindowType_Mask) == Qt::Desktop yes Evaluation Count:131 | yes Evaluation Count:45431 |
| 131-45431 |
399 | q->create(); executed: q->create(); Execution Count:131 | 131 |
400 | else if (parentWidget) evaluated: parentWidget yes Evaluation Count:37602 | yes Evaluation Count:7829 |
| 7829-37602 |
401 | q->setParent(parentWidget, data.window_flags); executed: q->setParent(parentWidget, data.window_flags); Execution Count:37602 | 37602 |
402 | else { | - |
403 | adjustFlags(data.window_flags, q); | - |
404 | resolveLayoutDirection(); | - |
405 | | - |
406 | const QBrush &background = q->palette().brush(QPalette::Window); | - |
407 | setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque()); | - |
408 | } executed: } Execution Count:7829 | 7829 |
409 | data.fnt = QFont(data.fnt, q); | - |
410 | | - |
411 | | - |
412 | | - |
413 | | - |
414 | q->setAttribute(Qt::WA_PendingMoveEvent); | - |
415 | q->setAttribute(Qt::WA_PendingResizeEvent); | - |
416 | | - |
417 | if (++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances) evaluated: ++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances yes Evaluation Count:6811 | yes Evaluation Count:38751 |
| 6811-38751 |
418 | QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; executed: QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; Execution Count:6811 | 6811 |
419 | | - |
420 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)) evaluated: QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) yes Evaluation Count:2 | yes Evaluation Count:45560 |
| 2-45560 |
421 | q->create(); executed: q->create(); Execution Count:2 | 2 |
422 | | - |
423 | QEvent e(QEvent::Create); | - |
424 | QApplication::sendEvent(q, &e); | - |
425 | QApplication::postEvent(q, new QEvent(QEvent::PolishRequest)); | - |
426 | | - |
427 | extraPaintEngine = 0; | - |
428 | } executed: } Execution Count:45562 | 45562 |
429 | | - |
430 | | - |
431 | | - |
432 | void QWidgetPrivate::createRecursively() | - |
433 | { | - |
434 | QWidget * const q = q_func(); | - |
435 | q->create(0, true, true); | - |
436 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:1198 | yes Evaluation Count:1203 |
| 1198-1203 |
437 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
438 | if (child && !child->isHidden() && !child->isWindow() && !child->testAttribute(Qt::WA_WState_Created)) evaluated: child yes Evaluation Count:784 | yes Evaluation Count:414 |
evaluated: !child->isHidden() yes Evaluation Count:478 | yes Evaluation Count:306 |
partially evaluated: !child->isWindow() yes Evaluation Count:478 | no Evaluation Count:0 |
partially evaluated: !child->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:478 | no Evaluation Count:0 |
| 0-784 |
439 | child->d_func()->createRecursively(); executed: child->d_func()->createRecursively(); Execution Count:478 | 478 |
440 | } executed: } Execution Count:1198 | 1198 |
441 | } executed: } Execution Count:1203 | 1203 |
442 | void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow) | - |
443 | { | - |
444 | QWidgetPrivate * const d = d_func(); | - |
445 | if (testAttribute(Qt::WA_WState_Created) && window == 0 && internalWinId()) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:13 | yes Evaluation Count:11630 |
partially evaluated: window == 0 yes Evaluation Count:13 | no Evaluation Count:0 |
partially evaluated: internalWinId() no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-11630 |
446 | return; | 0 |
447 | | - |
448 | if (d->data.in_destructor) partially evaluated: d->data.in_destructor no Evaluation Count:0 | yes Evaluation Count:11643 |
| 0-11643 |
449 | return; | 0 |
450 | | - |
451 | Qt::WindowType type = windowType(); | - |
452 | Qt::WindowFlags &flags = data->window_flags; | - |
453 | | - |
454 | if ((type == Qt::Widget || type == Qt::SubWindow) && !parentWidget()) { evaluated: type == Qt::Widget yes Evaluation Count:8910 | yes Evaluation Count:2733 |
evaluated: type == Qt::SubWindow yes Evaluation Count:97 | yes Evaluation Count:2636 |
partially evaluated: !parentWidget() no Evaluation Count:0 | yes Evaluation Count:9007 |
| 0-9007 |
455 | type = Qt::Window; | - |
456 | flags |= Qt::Window; | - |
457 | } | 0 |
458 | | - |
459 | if (QWidget *parent = parentWidget()) { evaluated: QWidget *parent = parentWidget() yes Evaluation Count:9110 | yes Evaluation Count:2533 |
| 2533-9110 |
460 | if (type & Qt::Window) { evaluated: type & Qt::Window yes Evaluation Count:103 | yes Evaluation Count:9007 |
| 103-9007 |
461 | if (!parent->testAttribute(Qt::WA_WState_Created)) evaluated: !parent->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:41 | yes Evaluation Count:62 |
| 41-62 |
462 | parent->createWinId(); executed: parent->createWinId(); Execution Count:41 | 41 |
463 | } else if (testAttribute(Qt::WA_NativeWindow) && !parent->internalWinId() evaluated: testAttribute(Qt::WA_NativeWindow) yes Evaluation Count:40 | yes Evaluation Count:8967 |
evaluated: !parent->internalWinId() yes Evaluation Count:4 | yes Evaluation Count:36 |
executed: } Execution Count:103 | 4-8967 |
464 | && !testAttribute(Qt::WA_DontCreateNativeAncestors)) { evaluated: !testAttribute(Qt::WA_DontCreateNativeAncestors) yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
465 | | - |
466 | | - |
467 | | - |
468 | d->createWinId(window); | - |
469 | | - |
470 | qt_noop(); | - |
471 | qt_noop(); | - |
472 | return; executed: return; Execution Count:2 | 2 |
473 | } | - |
474 | } | - |
475 | | - |
476 | | - |
477 | static int paintOnScreenEnv = -1; | - |
478 | if (paintOnScreenEnv == -1) evaluated: paintOnScreenEnv == -1 yes Evaluation Count:94 | yes Evaluation Count:11547 |
| 94-11547 |
479 | paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 ? 1 : 0; partially evaluated: qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 no Evaluation Count:0 | yes Evaluation Count:94 |
executed: paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 ? 1 : 0; Execution Count:94 | 0-94 |
480 | if (paintOnScreenEnv == 1) partially evaluated: paintOnScreenEnv == 1 no Evaluation Count:0 | yes Evaluation Count:11641 |
| 0-11641 |
481 | setAttribute(Qt::WA_PaintOnScreen); never executed: setAttribute(Qt::WA_PaintOnScreen); | 0 |
482 | | - |
483 | if (QApplicationPrivate::testAttribute(Qt::AA_NativeWindows)) partially evaluated: QApplicationPrivate::testAttribute(Qt::AA_NativeWindows) no Evaluation Count:0 | yes Evaluation Count:11641 |
| 0-11641 |
484 | setAttribute(Qt::WA_NativeWindow); never executed: setAttribute(Qt::WA_NativeWindow); | 0 |
485 | d->updateIsOpaque(); | - |
486 | | - |
487 | setAttribute(Qt::WA_WState_Created); | - |
488 | d->create_sys(window, initializeWindow, destroyOldWindow); | - |
489 | | - |
490 | | - |
491 | if (isWindow() && windowType() != Qt::Desktop) { evaluated: isWindow() yes Evaluation Count:2636 | yes Evaluation Count:9005 |
evaluated: windowType() != Qt::Desktop yes Evaluation Count:2504 | yes Evaluation Count:132 |
| 132-9005 |
492 | d->topData()->backingStoreTracker.destroy(); | - |
493 | if (hasBackingStoreSupport()) partially evaluated: hasBackingStoreSupport() yes Evaluation Count:2504 | no Evaluation Count:0 |
| 0-2504 |
494 | d->topData()->backingStoreTracker.create(this); executed: d->topData()->backingStoreTracker.create(this); Execution Count:2504 | 2504 |
495 | } executed: } Execution Count:2504 | 2504 |
496 | | - |
497 | d->setModal_sys(); | - |
498 | | - |
499 | if (!isWindow() && parentWidget() && parentWidget()->testAttribute(Qt::WA_DropSiteRegistered)) evaluated: !isWindow() yes Evaluation Count:9005 | yes Evaluation Count:2636 |
partially evaluated: parentWidget() yes Evaluation Count:9005 | no Evaluation Count:0 |
evaluated: parentWidget()->testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:1904 | yes Evaluation Count:7101 |
| 0-9005 |
500 | setAttribute(Qt::WA_DropSiteRegistered, true); executed: setAttribute(Qt::WA_DropSiteRegistered, true); Execution Count:1904 | 1904 |
501 | | - |
502 | | - |
503 | | - |
504 | | - |
505 | | - |
506 | | - |
507 | | - |
508 | if (testAttribute(Qt::WA_SetWindowIcon)) partially evaluated: testAttribute(Qt::WA_SetWindowIcon) no Evaluation Count:0 | yes Evaluation Count:11641 |
| 0-11641 |
509 | d->setWindowIcon_sys(); never executed: d->setWindowIcon_sys(); | 0 |
510 | | - |
511 | if (isWindow() && !d->topData()->iconText.isEmpty()) evaluated: isWindow() yes Evaluation Count:2636 | yes Evaluation Count:9005 |
partially evaluated: !d->topData()->iconText.isEmpty() no Evaluation Count:0 | yes Evaluation Count:2636 |
| 0-9005 |
512 | d->setWindowIconText_helper(d->topData()->iconText); never executed: d->setWindowIconText_helper(d->topData()->iconText); | 0 |
513 | if (isWindow() && !d->topData()->caption.isEmpty()) evaluated: isWindow() yes Evaluation Count:2636 | yes Evaluation Count:9005 |
evaluated: !d->topData()->caption.isEmpty() yes Evaluation Count:128 | yes Evaluation Count:2508 |
| 128-9005 |
514 | d->setWindowTitle_helper(d->topData()->caption); executed: d->setWindowTitle_helper(d->topData()->caption); Execution Count:128 | 128 |
515 | if (windowType() != Qt::Desktop) { evaluated: windowType() != Qt::Desktop yes Evaluation Count:11509 | yes Evaluation Count:132 |
| 132-11509 |
516 | d->updateSystemBackground(); | - |
517 | | - |
518 | if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon)) evaluated: isWindow() yes Evaluation Count:2504 | yes Evaluation Count:9005 |
partially evaluated: !testAttribute(Qt::WA_SetWindowIcon) yes Evaluation Count:2504 | no Evaluation Count:0 |
| 0-9005 |
519 | d->setWindowIcon_sys(); executed: d->setWindowIcon_sys(); Execution Count:2504 | 2504 |
520 | } executed: } Execution Count:11509 | 11509 |
521 | | - |
522 | | - |
523 | | - |
524 | | - |
525 | | - |
526 | | - |
527 | d->updateFrameStrut(); | - |
528 | } executed: } Execution Count:11641 | 11641 |
529 | QWidget::~QWidget() | - |
530 | { | - |
531 | QWidgetPrivate * const d = d_func(); | - |
532 | d->data.in_destructor = true; | - |
533 | | - |
534 | | - |
535 | | - |
536 | | - |
537 | | - |
538 | | - |
539 | | - |
540 | for (QForeachContainer<__typeof__(d->gestureContext.keys())> _container_(d->gestureContext.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (Qt::GestureType type = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
541 | ungrabGesture(type); executed: ungrabGesture(type); Execution Count:5414 | 5414 |
542 | | - |
543 | | - |
544 | | - |
545 | d->registerDropSite(false); | - |
546 | | - |
547 | | - |
548 | | - |
549 | for (int i = 0; i < d->actions.size(); ++i) { evaluated: i < d->actions.size() yes Evaluation Count:3290 | yes Evaluation Count:41486 |
| 3290-41486 |
550 | QActionPrivate *apriv = d->actions.at(i)->d_func(); | - |
551 | apriv->widgets.removeAll(this); | - |
552 | } executed: } Execution Count:3290 | 3290 |
553 | d->actions.clear(); | - |
554 | | - |
555 | | - |
556 | | - |
557 | | - |
558 | | - |
559 | if (!QApplicationPrivate::is_app_closing && testAttribute(Qt::WA_GrabbedShortcut)) evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:41270 | yes Evaluation Count:216 |
evaluated: testAttribute(Qt::WA_GrabbedShortcut) yes Evaluation Count:1479 | yes Evaluation Count:39791 |
| 216-41270 |
560 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence()); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence()); Execution Count:1479 | 1479 |
561 | | - |
562 | | - |
563 | | - |
564 | delete d->layout; | - |
565 | d->layout = 0; | - |
566 | | - |
567 | | - |
568 | qt_noop(); | - |
569 | qt_noop(); | - |
570 | | - |
571 | if (d->focus_next != this) { evaluated: d->focus_next != this yes Evaluation Count:36280 | yes Evaluation Count:5206 |
| 5206-36280 |
572 | d->focus_next->d_func()->focus_prev = d->focus_prev; | - |
573 | d->focus_prev->d_func()->focus_next = d->focus_next; | - |
574 | d->focus_next = d->focus_prev = 0; | - |
575 | } executed: } Execution Count:36280 | 36280 |
576 | | - |
577 | | - |
578 | if (true) { partially evaluated: true yes Evaluation Count:41486 | no Evaluation Count:0 |
| 0-41486 |
579 | | - |
580 | const QWidget* w = this; | - |
581 | while (w->d_func()->extra && w->d_func()->extra->focus_proxy) evaluated: w->d_func()->extra yes Evaluation Count:18077 | yes Evaluation Count:29703 |
evaluated: w->d_func()->extra->focus_proxy yes Evaluation Count:6294 | yes Evaluation Count:11783 |
| 6294-29703 |
582 | w = w->d_func()->extra->focus_proxy; executed: w = w->d_func()->extra->focus_proxy; Execution Count:6294 | 6294 |
583 | QWidget *window = w->window(); | - |
584 | QWExtra *e = window ? window->d_func()->extra : 0; partially evaluated: window yes Evaluation Count:41486 | no Evaluation Count:0 |
| 0-41486 |
585 | if (!e || !e->proxyWidget) evaluated: !e yes Evaluation Count:10225 | yes Evaluation Count:31261 |
evaluated: !e->proxyWidget yes Evaluation Count:31257 | yes Evaluation Count:4 |
| 4-31261 |
586 | | - |
587 | clearFocus(); executed: clearFocus(); Execution Count:41482 | 41482 |
588 | } else { executed: } Execution Count:41486 | 41486 |
589 | | - |
590 | } | 0 |
591 | | - |
592 | d->setDirtyOpaqueRegion(); | - |
593 | | - |
594 | if (isWindow() && isVisible() && internalWinId()) { evaluated: isWindow() yes Evaluation Count:5206 | yes Evaluation Count:36280 |
evaluated: isVisible() yes Evaluation Count:2096 | yes Evaluation Count:3110 |
partially evaluated: internalWinId() yes Evaluation Count:2096 | no Evaluation Count:0 |
| 0-36280 |
595 | if (true) { partially evaluated: true yes Evaluation Count:2096 | no Evaluation Count:0 |
| 0-2096 |
596 | d->close_helper(QWidgetPrivate::CloseNoEvent); | - |
597 | } else { executed: } Execution Count:2096 | 2096 |
598 | | - |
599 | if (true) { | 0 |
600 | hide(); | - |
601 | } else { | 0 |
602 | | - |
603 | } | 0 |
604 | } | - |
605 | } | - |
606 | | - |
607 | | - |
608 | | - |
609 | | - |
610 | | - |
611 | | - |
612 | else if (isVisible()) { evaluated: isVisible() yes Evaluation Count:619 | yes Evaluation Count:38771 |
| 619-38771 |
613 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - |
614 | } executed: } Execution Count:619 | 619 |
615 | | - |
616 | if (QWidgetBackingStore *bs = d->maybeBackingStore()) { evaluated: QWidgetBackingStore *bs = d->maybeBackingStore() yes Evaluation Count:19169 | yes Evaluation Count:22317 |
| 19169-22317 |
617 | bs->removeDirtyWidget(this); | - |
618 | if (testAttribute(Qt::WA_StaticContents)) evaluated: testAttribute(Qt::WA_StaticContents) yes Evaluation Count:3 | yes Evaluation Count:19166 |
| 3-19166 |
619 | bs->removeStaticWidget(this); executed: bs->removeStaticWidget(this); Execution Count:3 | 3 |
620 | } executed: } Execution Count:19169 | 19169 |
621 | | - |
622 | delete d->needsFlush; | - |
623 | d->needsFlush = 0; | - |
624 | | - |
625 | | - |
626 | | - |
627 | bool blocked = d->blockSig; | - |
628 | d->blockSig = 0; | - |
629 | | - |
630 | if (d->isSignalConnected(0)) { evaluated: d->isSignalConnected(0) yes Evaluation Count:3688 | yes Evaluation Count:37798 |
| 3688-37798 |
631 | if (true) { partially evaluated: true yes Evaluation Count:3688 | no Evaluation Count:0 |
| 0-3688 |
632 | destroyed(this); | - |
633 | } else { executed: } Execution Count:3688 | 3688 |
634 | | - |
635 | | - |
636 | QMessageLogger("kernel/qwidget.cpp", 1451, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); | - |
637 | qt_noop(); | - |
638 | } | 0 |
639 | } | - |
640 | | - |
641 | if (d->declarativeData) { partially evaluated: d->declarativeData no Evaluation Count:0 | yes Evaluation Count:41486 |
| 0-41486 |
642 | QAbstractDeclarativeData::destroyed(d->declarativeData, this); | - |
643 | d->declarativeData = 0; | - |
644 | } | 0 |
645 | | - |
646 | d->blockSig = blocked; | - |
647 | if (!d->children.isEmpty()) evaluated: !d->children.isEmpty() yes Evaluation Count:18909 | yes Evaluation Count:22577 |
| 18909-22577 |
648 | d->deleteChildren(); executed: d->deleteChildren(); Execution Count:18909 | 18909 |
649 | | - |
650 | QApplication::removePostedEvents(this); | - |
651 | | - |
652 | if (true) { partially evaluated: true yes Evaluation Count:41486 | no Evaluation Count:0 |
| 0-41486 |
653 | destroy(); | - |
654 | } else { executed: } Execution Count:41486 | 41486 |
655 | | - |
656 | } | 0 |
657 | --QWidgetPrivate::instanceCounter; | - |
658 | | - |
659 | if (QWidgetPrivate::allWidgets) evaluated: QWidgetPrivate::allWidgets yes Evaluation Count:41270 | yes Evaluation Count:216 |
| 216-41270 |
660 | QWidgetPrivate::allWidgets->remove(this); executed: QWidgetPrivate::allWidgets->remove(this); Execution Count:41270 | 41270 |
661 | | - |
662 | if (true) { partially evaluated: true yes Evaluation Count:41486 | no Evaluation Count:0 |
| 0-41486 |
663 | QEvent e(QEvent::Destroy); | - |
664 | QCoreApplication::sendEvent(this, &e); | - |
665 | } else { executed: } Execution Count:41486 | 41486 |
666 | | - |
667 | } | 0 |
668 | } | - |
669 | | - |
670 | int QWidgetPrivate::instanceCounter = 0; | - |
671 | int QWidgetPrivate::maxInstances = 0; | - |
672 | | - |
673 | void QWidgetPrivate::setWinId(WId id) | - |
674 | { | - |
675 | QWidget * const q = q_func(); | - |
676 | | - |
677 | | - |
678 | | - |
679 | | - |
680 | | - |
681 | bool userDesktopWidget = qt_desktopWidget != 0 && qt_desktopWidget != q && q->windowType() == Qt::Desktop; evaluated: qt_desktopWidget != 0 yes Evaluation Count:82270 | yes Evaluation Count:13506 |
evaluated: qt_desktopWidget != q yes Evaluation Count:82164 | yes Evaluation Count:106 |
evaluated: q->windowType() == Qt::Desktop yes Evaluation Count:176 | yes Evaluation Count:81988 |
| 106-82270 |
682 | if (mapper && data.winid && !userDesktopWidget) { evaluated: mapper yes Evaluation Count:95146 | yes Evaluation Count:630 |
evaluated: data.winid yes Evaluation Count:2526 | yes Evaluation Count:92620 |
evaluated: !userDesktopWidget yes Evaluation Count:2502 | yes Evaluation Count:24 |
| 24-95146 |
683 | mapper->remove(data.winid); | - |
684 | } executed: } Execution Count:2502 | 2502 |
685 | | - |
686 | const WId oldWinId = data.winid; | - |
687 | | - |
688 | data.winid = id; | - |
689 | | - |
690 | | - |
691 | | - |
692 | if (mapper && id && !userDesktopWidget) { evaluated: mapper yes Evaluation Count:95146 | yes Evaluation Count:630 |
evaluated: id yes Evaluation Count:2674 | yes Evaluation Count:92472 |
evaluated: !userDesktopWidget yes Evaluation Count:2651 | yes Evaluation Count:23 |
| 23-95146 |
693 | mapper->insert(data.winid, q); | - |
694 | } executed: } Execution Count:2651 | 2651 |
695 | | - |
696 | if(oldWinId != id) { evaluated: oldWinId != id yes Evaluation Count:5347 | yes Evaluation Count:90429 |
| 5347-90429 |
697 | QEvent e(QEvent::WinIdChange); | - |
698 | QCoreApplication::sendEvent(q, &e); | - |
699 | } executed: } Execution Count:5347 | 5347 |
700 | } executed: } Execution Count:95776 | 95776 |
701 | | - |
702 | void QWidgetPrivate::createTLExtra() | - |
703 | { | - |
704 | if (!extra) evaluated: !extra yes Evaluation Count:2795 | yes Evaluation Count:40984 |
| 2795-40984 |
705 | createExtra(); executed: createExtra(); Execution Count:2795 | 2795 |
706 | if (!extra->topextra) { evaluated: !extra->topextra yes Evaluation Count:3525 | yes Evaluation Count:40254 |
| 3525-40254 |
707 | QTLWExtra* x = extra->topextra = new QTLWExtra; | - |
708 | x->icon = 0; | - |
709 | x->backingStore = 0; | - |
710 | x->sharedPainter = 0; | - |
711 | x->incw = x->inch = 0; | - |
712 | x->basew = x->baseh = 0; | - |
713 | x->frameStrut.setCoords(0, 0, 0, 0); | - |
714 | x->normalGeometry = QRect(0,0,-1,-1); | - |
715 | x->savedFlags = 0; | - |
716 | x->opacity = 255; | - |
717 | x->posIncludesFrame = 0; | - |
718 | x->sizeAdjusted = false; | - |
719 | x->inTopLevelResize = false; | - |
720 | x->inRepaint = false; | - |
721 | x->embedded = 0; | - |
722 | | - |
723 | | - |
724 | | - |
725 | createTLSysExtra(); | - |
726 | | - |
727 | | - |
728 | | - |
729 | | - |
730 | } executed: } Execution Count:3525 | 3525 |
731 | } executed: } Execution Count:43779 | 43779 |
732 | | - |
733 | | - |
734 | | - |
735 | | - |
736 | | - |
737 | | - |
738 | void QWidgetPrivate::createExtra() | - |
739 | { | - |
740 | if (!extra) { evaluated: !extra yes Evaluation Count:17278 | yes Evaluation Count:21339 |
| 17278-21339 |
741 | extra = new QWExtra; | - |
742 | extra->glContext = 0; | - |
743 | extra->topextra = 0; | - |
744 | | - |
745 | extra->proxyWidget = 0; | - |
746 | | - |
747 | | - |
748 | extra->curs = 0; | - |
749 | | - |
750 | extra->minw = 0; | - |
751 | extra->minh = 0; | - |
752 | extra->maxw = ((1<<24)-1); | - |
753 | extra->maxh = ((1<<24)-1); | - |
754 | extra->customDpiX = 0; | - |
755 | extra->customDpiY = 0; | - |
756 | extra->explicitMinSize = 0; | - |
757 | extra->explicitMaxSize = 0; | - |
758 | extra->autoFillBackground = 0; | - |
759 | extra->nativeChildrenForced = 0; | - |
760 | extra->inRenderWithPainter = 0; | - |
761 | extra->hasMask = 0; | - |
762 | createSysExtra(); | - |
763 | | - |
764 | | - |
765 | | - |
766 | | - |
767 | } executed: } Execution Count:17278 | 17278 |
768 | } executed: } Execution Count:38617 | 38617 |
769 | | - |
770 | | - |
771 | | - |
772 | | - |
773 | | - |
774 | | - |
775 | | - |
776 | void QWidgetPrivate::deleteExtra() | - |
777 | { | - |
778 | if (extra) { partially evaluated: extra yes Evaluation Count:16507 | no Evaluation Count:0 |
| 0-16507 |
779 | | - |
780 | delete extra->curs; | - |
781 | | - |
782 | deleteSysExtra(); | - |
783 | | - |
784 | | - |
785 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style)) evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style) yes Evaluation Count:2377 | yes Evaluation Count:14130 |
| 2377-14130 |
786 | proxy->deref(); executed: proxy->deref(); Execution Count:2377 | 2377 |
787 | | - |
788 | if (extra->topextra) { evaluated: extra->topextra yes Evaluation Count:3482 | yes Evaluation Count:13025 |
| 3482-13025 |
789 | deleteTLSysExtra(); | - |
790 | | - |
791 | delete extra->topextra->icon; | - |
792 | delete extra->topextra; | - |
793 | } executed: } Execution Count:3482 | 3482 |
794 | delete extra; | - |
795 | | - |
796 | extra = 0; | - |
797 | } executed: } Execution Count:16507 | 16507 |
798 | } executed: } Execution Count:16507 | 16507 |
799 | | - |
800 | | - |
801 | | - |
802 | | - |
803 | | - |
804 | | - |
805 | bool QWidgetPrivate::isOverlapped(const QRect &rect) const | - |
806 | { | - |
807 | const QWidget * const q = q_func(); | - |
808 | | - |
809 | const QWidget *w = q; | - |
810 | QRect r = rect; | - |
811 | while (w) { partially evaluated: w yes Evaluation Count:37493 | no Evaluation Count:0 |
| 0-37493 |
812 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:14789 | yes Evaluation Count:22704 |
| 14789-22704 |
813 | return false; executed: return false; Execution Count:14789 | 14789 |
814 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - |
815 | bool above = false; | - |
816 | for (int i = 0; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:124422 | yes Evaluation Count:22699 |
| 22699-124422 |
817 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - |
818 | if (!sibling || !sibling->isVisible() || sibling->isWindow()) evaluated: !sibling yes Evaluation Count:30631 | yes Evaluation Count:93791 |
evaluated: !sibling->isVisible() yes Evaluation Count:13062 | yes Evaluation Count:80729 |
partially evaluated: sibling->isWindow() no Evaluation Count:0 | yes Evaluation Count:80729 |
| 0-93791 |
819 | continue; executed: continue; Execution Count:43693 | 43693 |
820 | if (!above) { evaluated: !above yes Evaluation Count:32843 | yes Evaluation Count:47886 |
| 32843-47886 |
821 | above = (sibling == w); | - |
822 | continue; executed: continue; Execution Count:32843 | 32843 |
823 | } | - |
824 | | - |
825 | if (qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r)) { evaluated: qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r) yes Evaluation Count:5 | yes Evaluation Count:47881 |
| 5-47881 |
826 | const QWExtra *siblingExtra = sibling->d_func()->extra; | - |
827 | if (siblingExtra && siblingExtra->hasMask && !sibling->d_func()->graphicsEffect partially evaluated: siblingExtra yes Evaluation Count:5 | no Evaluation Count:0 |
evaluated: siblingExtra->hasMask yes Evaluation Count:1 | yes Evaluation Count:4 |
partially evaluated: !sibling->d_func()->graphicsEffect yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-5 |
828 | && !siblingExtra->mask.translated(sibling->data->crect.topLeft()).intersects(r)) { partially evaluated: !siblingExtra->mask.translated(sibling->data->crect.topLeft()).intersects(r) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
829 | continue; never executed: continue; | 0 |
830 | } | - |
831 | return true; executed: return true; Execution Count:5 | 5 |
832 | } | - |
833 | } executed: } Execution Count:47881 | 47881 |
834 | w = w->parentWidget(); | - |
835 | r.translate(pd->data.crect.topLeft()); | - |
836 | } executed: } Execution Count:22699 | 22699 |
837 | return false; never executed: return false; | 0 |
838 | } | - |
839 | | - |
840 | void QWidgetPrivate::syncBackingStore() | - |
841 | { | - |
842 | if (paintOnScreen()) { evaluated: paintOnScreen() yes Evaluation Count:6 | yes Evaluation Count:8226 |
| 6-8226 |
843 | repaint_sys(dirty); | - |
844 | dirty = QRegion(); | - |
845 | } else if (QWidgetBackingStore *bs = maybeBackingStore()) { executed: } Execution Count:6 partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:8226 | no Evaluation Count:0 |
| 0-8226 |
846 | bs->sync(); | - |
847 | } executed: } Execution Count:8226 | 8226 |
848 | } | - |
849 | | - |
850 | void QWidgetPrivate::syncBackingStore(const QRegion ®ion) | - |
851 | { | - |
852 | if (paintOnScreen()) evaluated: paintOnScreen() yes Evaluation Count:7 | yes Evaluation Count:3358 |
| 7-3358 |
853 | repaint_sys(region); executed: repaint_sys(region); Execution Count:7 | 7 |
854 | else if (QWidgetBackingStore *bs = maybeBackingStore()) { partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:3358 | no Evaluation Count:0 |
| 0-3358 |
855 | bs->sync(q_func(), region); | - |
856 | } executed: } Execution Count:3358 | 3358 |
857 | } | - |
858 | | - |
859 | void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) | - |
860 | { | - |
861 | QWidget * const q = q_func(); | - |
862 | | - |
863 | if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->updatesEnabled()) evaluated: enable yes Evaluation Count:53560 | yes Evaluation Count:13772 |
evaluated: !q->isWindow() yes Evaluation Count:52578 | yes Evaluation Count:982 |
partially evaluated: q->parentWidget() yes Evaluation Count:52578 | no Evaluation Count:0 |
partially evaluated: !q->parentWidget()->updatesEnabled() no Evaluation Count:0 | yes Evaluation Count:52578 |
| 0-53560 |
864 | return; | 0 |
865 | | - |
866 | if (enable != q->testAttribute(Qt::WA_UpdatesDisabled)) evaluated: enable != q->testAttribute(Qt::WA_UpdatesDisabled) yes Evaluation Count:40424 | yes Evaluation Count:26908 |
| 26908-40424 |
867 | return; executed: return; Execution Count:40424 | 40424 |
868 | | - |
869 | q->setAttribute(Qt::WA_UpdatesDisabled, !enable); | - |
870 | if (enable) evaluated: enable yes Evaluation Count:13217 | yes Evaluation Count:13691 |
| 13217-13691 |
871 | q->update(); executed: q->update(); Execution Count:13217 | 13217 |
872 | | - |
873 | Qt::WidgetAttribute attribute = enable ? Qt::WA_ForceUpdatesDisabled : Qt::WA_UpdatesDisabled; evaluated: enable yes Evaluation Count:13217 | yes Evaluation Count:13691 |
| 13217-13691 |
874 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:35439 | yes Evaluation Count:26908 |
| 26908-35439 |
875 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
876 | if (w && !w->isWindow() && !w->testAttribute(attribute)) evaluated: w yes Evaluation Count:24750 | yes Evaluation Count:10689 |
evaluated: !w->isWindow() yes Evaluation Count:24540 | yes Evaluation Count:210 |
evaluated: !w->testAttribute(attribute) yes Evaluation Count:24488 | yes Evaluation Count:52 |
| 52-24750 |
877 | w->d_func()->setUpdatesEnabled_helper(enable); executed: w->d_func()->setUpdatesEnabled_helper(enable); Execution Count:24488 | 24488 |
878 | } executed: } Execution Count:35439 | 35439 |
879 | } executed: } Execution Count:26908 | 26908 |
880 | void QWidgetPrivate::propagatePaletteChange() | - |
881 | { | - |
882 | QWidget * const q = q_func(); | - |
883 | | - |
884 | | - |
885 | if (!q->parentWidget() && extra && extra->proxyWidget) { evaluated: !q->parentWidget() yes Evaluation Count:1337 | yes Evaluation Count:20379 |
evaluated: extra yes Evaluation Count:205 | yes Evaluation Count:1132 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:205 |
| 0-20379 |
886 | QGraphicsProxyWidget *p = extra->proxyWidget; | - |
887 | inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve(); | - |
888 | } else | 0 |
889 | | - |
890 | if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { evaluated: q->isWindow() yes Evaluation Count:1352 | yes Evaluation Count:20364 |
partially evaluated: !q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:1352 | no Evaluation Count:0 |
| 0-20364 |
891 | inheritedPaletteResolveMask = 0; | - |
892 | } executed: } Execution Count:1352 | 1352 |
893 | int mask = data.pal.resolve() | inheritedPaletteResolveMask; | - |
894 | | - |
895 | QEvent pc(QEvent::PaletteChange); | - |
896 | QApplication::sendEvent(q, &pc); | - |
897 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:4050 | yes Evaluation Count:21716 |
| 4050-21716 |
898 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
899 | if (w && !w->testAttribute(Qt::WA_StyleSheet) evaluated: w yes Evaluation Count:2753 | yes Evaluation Count:1297 |
partially evaluated: !w->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:2753 | no Evaluation Count:0 |
| 0-2753 |
900 | && (!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))) { evaluated: !w->isWindow() yes Evaluation Count:2635 | yes Evaluation Count:118 |
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation) no Evaluation Count:0 | yes Evaluation Count:118 |
| 0-2635 |
901 | QWidgetPrivate *wd = w->d_func(); | - |
902 | wd->inheritedPaletteResolveMask = mask; | - |
903 | wd->resolvePalette(); | - |
904 | } executed: } Execution Count:2635 | 2635 |
905 | } executed: } Execution Count:4050 | 4050 |
906 | } executed: } Execution Count:21716 | 21716 |
907 | | - |
908 | | - |
909 | | - |
910 | | - |
911 | QRect QWidgetPrivate::clipRect() const | - |
912 | { | - |
913 | const QWidget * const q = q_func(); | - |
914 | const QWidget * w = q; | - |
915 | if (!w->isVisible()) evaluated: !w->isVisible() yes Evaluation Count:565 | yes Evaluation Count:44665 |
| 565-44665 |
916 | return QRect(); executed: return QRect(); Execution Count:565 | 565 |
917 | QRect r = effectiveRectFor(q->rect()); | - |
918 | int ox = 0; | - |
919 | int oy = 0; | - |
920 | while (w partially evaluated: w yes Evaluation Count:100295 | no Evaluation Count:0 |
| 0-100295 |
921 | && w->isVisible() evaluated: w->isVisible() yes Evaluation Count:100289 | yes Evaluation Count:6 |
| 6-100289 |
922 | && !w->isWindow() evaluated: !w->isWindow() yes Evaluation Count:55630 | yes Evaluation Count:44659 |
| 44659-55630 |
923 | && w->parentWidget()) { partially evaluated: w->parentWidget() yes Evaluation Count:55630 | no Evaluation Count:0 |
| 0-55630 |
924 | ox -= w->x(); | - |
925 | oy -= w->y(); | - |
926 | w = w->parentWidget(); | - |
927 | r &= QRect(ox, oy, w->width(), w->height()); | - |
928 | } executed: } Execution Count:55630 | 55630 |
929 | return r; executed: return r; Execution Count:44665 | 44665 |
930 | } | - |
931 | | - |
932 | | - |
933 | | - |
934 | | - |
935 | QRegion QWidgetPrivate::clipRegion() const | - |
936 | { | - |
937 | const QWidget * const q = q_func(); | - |
938 | if (!q->isVisible()) never evaluated: !q->isVisible() | 0 |
939 | return QRegion(); never executed: return QRegion(); | 0 |
940 | QRegion r(q->rect()); | - |
941 | const QWidget * w = q; | - |
942 | const QWidget *ignoreUpTo; | - |
943 | int ox = 0; | - |
944 | int oy = 0; | - |
945 | while (w | 0 |
946 | && w->isVisible() never evaluated: w->isVisible() | 0 |
947 | && !w->isWindow() never evaluated: !w->isWindow() | 0 |
948 | && w->parentWidget()) { never evaluated: w->parentWidget() | 0 |
949 | ox -= w->x(); | - |
950 | oy -= w->y(); | - |
951 | ignoreUpTo = w; | - |
952 | w = w->parentWidget(); | - |
953 | r &= QRegion(ox, oy, w->width(), w->height()); | - |
954 | | - |
955 | int i = 0; | - |
956 | while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo)) never evaluated: w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo) | 0 |
957 | ; | 0 |
958 | for ( ; i < w->d_func()->children.size(); ++i) { never evaluated: i < w->d_func()->children.size() | 0 |
959 | if(QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) { never evaluated: QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i)) | 0 |
960 | if(sibling->isVisible() && !sibling->isWindow()) { never evaluated: sibling->isVisible() never evaluated: !sibling->isWindow() | 0 |
961 | QRect siblingRect(ox+sibling->x(), oy+sibling->y(), | - |
962 | sibling->width(), sibling->height()); | - |
963 | if (qRectIntersects(siblingRect, q->rect())) never evaluated: qRectIntersects(siblingRect, q->rect()) | 0 |
964 | r -= QRegion(siblingRect); never executed: r -= QRegion(siblingRect); | 0 |
965 | } | 0 |
966 | } | 0 |
967 | } | 0 |
968 | } | 0 |
969 | return r; never executed: return r; | 0 |
970 | } | - |
971 | | - |
972 | void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion ®ion) | - |
973 | { | - |
974 | | - |
975 | | - |
976 | | - |
977 | QPaintEngine *paintEngine = paintDevice->paintEngine(); | - |
978 | | - |
979 | | - |
980 | | - |
981 | | - |
982 | | - |
983 | | - |
984 | | - |
985 | paintEngine->d_func()->systemClip = region; | - |
986 | | - |
987 | } executed: } Execution Count:32844 | 32844 |
988 | | - |
989 | | - |
990 | void QWidgetPrivate::invalidateGraphicsEffectsRecursively() | - |
991 | { | - |
992 | QWidget * const q = q_func(); | - |
993 | QWidget *w = q; | - |
994 | do { | - |
995 | if (w->graphicsEffect()) { evaluated: w->graphicsEffect() yes Evaluation Count:7 | yes Evaluation Count:845095 |
| 7-845095 |
996 | QWidgetEffectSourcePrivate *sourced = | - |
997 | static_cast<QWidgetEffectSourcePrivate *>(w->graphicsEffect()->source()->d_func()); | - |
998 | if (!sourced->updateDueToGraphicsEffect) partially evaluated: !sourced->updateDueToGraphicsEffect yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
999 | w->graphicsEffect()->source()->d_func()->invalidateCache(); executed: w->graphicsEffect()->source()->d_func()->invalidateCache(); Execution Count:7 | 7 |
1000 | } executed: } Execution Count:7 | 7 |
1001 | w = w->parentWidget(); | - |
1002 | } while (w); executed: } Execution Count:845102 evaluated: w yes Evaluation Count:505134 | yes Evaluation Count:339968 |
| 339968-845102 |
1003 | } executed: } Execution Count:339968 | 339968 |
1004 | | - |
1005 | | - |
1006 | void QWidgetPrivate::setDirtyOpaqueRegion() | - |
1007 | { | - |
1008 | QWidget * const q = q_func(); | - |
1009 | | - |
1010 | dirtyOpaqueChildren = true; | - |
1011 | | - |
1012 | | - |
1013 | invalidateGraphicsEffectsRecursively(); | - |
1014 | | - |
1015 | | - |
1016 | if (q->isWindow()) evaluated: q->isWindow() yes Evaluation Count:29108 | yes Evaluation Count:181145 |
| 29108-181145 |
1017 | return; executed: return; Execution Count:29108 | 29108 |
1018 | | - |
1019 | QWidget *parent = q->parentWidget(); | - |
1020 | if (!parent) partially evaluated: !parent no Evaluation Count:0 | yes Evaluation Count:181145 |
| 0-181145 |
1021 | return; | 0 |
1022 | | - |
1023 | | - |
1024 | QWidgetPrivate *pd = parent->d_func(); | - |
1025 | if (!pd->dirtyOpaqueChildren) evaluated: !pd->dirtyOpaqueChildren yes Evaluation Count:2448 | yes Evaluation Count:178697 |
| 2448-178697 |
1026 | pd->setDirtyOpaqueRegion(); executed: pd->setDirtyOpaqueRegion(); Execution Count:2448 | 2448 |
1027 | } executed: } Execution Count:181145 | 181145 |
1028 | | - |
1029 | const QRegion &QWidgetPrivate::getOpaqueChildren() const | - |
1030 | { | - |
1031 | if (!dirtyOpaqueChildren) evaluated: !dirtyOpaqueChildren yes Evaluation Count:8365 | yes Evaluation Count:8054 |
| 8054-8365 |
1032 | return opaqueChildren; executed: return opaqueChildren; Execution Count:8365 | 8365 |
1033 | | - |
1034 | QWidgetPrivate *that = const_cast<QWidgetPrivate*>(this); | - |
1035 | that->opaqueChildren = QRegion(); | - |
1036 | | - |
1037 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:20952 | yes Evaluation Count:8054 |
| 8054-20952 |
1038 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
1039 | if (!child || !child->isVisible() || child->isWindow()) evaluated: !child yes Evaluation Count:6723 | yes Evaluation Count:14229 |
evaluated: !child->isVisible() yes Evaluation Count:4654 | yes Evaluation Count:9575 |
evaluated: child->isWindow() yes Evaluation Count:13 | yes Evaluation Count:9562 |
| 13-14229 |
1040 | continue; executed: continue; Execution Count:11390 | 11390 |
1041 | | - |
1042 | const QPoint offset = child->geometry().topLeft(); | - |
1043 | QWidgetPrivate *childd = child->d_func(); | - |
1044 | QRegion r = childd->isOpaque ? child->rect() : childd->getOpaqueChildren(); evaluated: childd->isOpaque yes Evaluation Count:3695 | yes Evaluation Count:5867 |
| 3695-5867 |
1045 | if (childd->extra && childd->extra->hasMask) evaluated: childd->extra yes Evaluation Count:5754 | yes Evaluation Count:3808 |
evaluated: childd->extra->hasMask yes Evaluation Count:13 | yes Evaluation Count:5741 |
| 13-5754 |
1046 | r &= childd->extra->mask; executed: r &= childd->extra->mask; Execution Count:13 | 13 |
1047 | if (r.isEmpty()) evaluated: r.isEmpty() yes Evaluation Count:3486 | yes Evaluation Count:6076 |
| 3486-6076 |
1048 | continue; executed: continue; Execution Count:3486 | 3486 |
1049 | r.translate(offset); | - |
1050 | that->opaqueChildren += r; | - |
1051 | } executed: } Execution Count:6076 | 6076 |
1052 | | - |
1053 | that->opaqueChildren &= q_func()->rect(); | - |
1054 | that->dirtyOpaqueChildren = false; | - |
1055 | | - |
1056 | return that->opaqueChildren; executed: return that->opaqueChildren; Execution Count:8054 | 8054 |
1057 | } | - |
1058 | | - |
1059 | void QWidgetPrivate::subtractOpaqueChildren(QRegion &source, const QRect &clipRect) const | - |
1060 | { | - |
1061 | if (children.isEmpty() || clipRect.isEmpty()) evaluated: children.isEmpty() yes Evaluation Count:16311 | yes Evaluation Count:10420 |
evaluated: clipRect.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:10417 |
| 3-16311 |
1062 | return; executed: return; Execution Count:16314 | 16314 |
1063 | | - |
1064 | const QRegion &r = getOpaqueChildren(); | - |
1065 | if (!r.isEmpty()) evaluated: !r.isEmpty() yes Evaluation Count:6056 | yes Evaluation Count:4361 |
| 4361-6056 |
1066 | source -= (r & clipRect); executed: source -= (r & clipRect); Execution Count:6056 | 6056 |
1067 | } executed: } Execution Count:10417 | 10417 |
1068 | | - |
1069 | | - |
1070 | void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirtySiblingsAbove, | - |
1071 | bool alsoNonOpaque) const | - |
1072 | { | - |
1073 | const QWidget * const q = q_func(); | - |
1074 | static int disableSubtractOpaqueSiblings = qgetenv("QT_NO_SUBTRACTOPAQUESIBLINGS").toInt(); | - |
1075 | if (disableSubtractOpaqueSiblings || q->isWindow()) partially evaluated: disableSubtractOpaqueSiblings no Evaluation Count:0 | yes Evaluation Count:13746 |
evaluated: q->isWindow() yes Evaluation Count:1477 | yes Evaluation Count:12269 |
| 0-13746 |
1076 | return; executed: return; Execution Count:1477 | 1477 |
1077 | | - |
1078 | | - |
1079 | | - |
1080 | | - |
1081 | | - |
1082 | | - |
1083 | QRect clipBoundingRect; | - |
1084 | bool dirtyClipBoundingRect = true; | - |
1085 | | - |
1086 | QRegion parentClip; | - |
1087 | bool dirtyParentClip = true; | - |
1088 | | - |
1089 | QPoint parentOffset = data.crect.topLeft(); | - |
1090 | | - |
1091 | const QWidget *w = q; | - |
1092 | | - |
1093 | while (w) { partially evaluated: w yes Evaluation Count:33819 | no Evaluation Count:0 |
| 0-33819 |
1094 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:11980 | yes Evaluation Count:21839 |
| 11980-21839 |
1095 | break; executed: break; Execution Count:11980 | 11980 |
1096 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - |
1097 | const int myIndex = pd->children.indexOf(const_cast<QWidget *>(w)); | - |
1098 | const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->data->crect); | - |
1099 | for (int i = myIndex + 1; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:31052 | yes Evaluation Count:21550 |
| 21550-31052 |
1100 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - |
1101 | if (!sibling || !sibling->isVisible() || sibling->isWindow()) evaluated: !sibling yes Evaluation Count:13155 | yes Evaluation Count:17897 |
evaluated: !sibling->isVisible() yes Evaluation Count:4675 | yes Evaluation Count:13222 |
evaluated: sibling->isWindow() yes Evaluation Count:13 | yes Evaluation Count:13209 |
| 13-17897 |
1102 | continue; executed: continue; Execution Count:17843 | 17843 |
1103 | | - |
1104 | const QRect siblingGeometry = sibling->d_func()->effectiveRectFor(sibling->data->crect); | - |
1105 | if (!qRectIntersects(siblingGeometry, widgetGeometry)) evaluated: !qRectIntersects(siblingGeometry, widgetGeometry) yes Evaluation Count:12584 | yes Evaluation Count:625 |
| 625-12584 |
1106 | continue; executed: continue; Execution Count:12584 | 12584 |
1107 | | - |
1108 | if (dirtyClipBoundingRect) { evaluated: dirtyClipBoundingRect yes Evaluation Count:585 | yes Evaluation Count:40 |
| 40-585 |
1109 | clipBoundingRect = sourceRegion.boundingRect(); | - |
1110 | dirtyClipBoundingRect = false; | - |
1111 | } executed: } Execution Count:585 | 585 |
1112 | | - |
1113 | if (!qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset))) evaluated: !qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset)) yes Evaluation Count:86 | yes Evaluation Count:539 |
| 86-539 |
1114 | continue; executed: continue; Execution Count:86 | 86 |
1115 | | - |
1116 | if (dirtyParentClip) { evaluated: dirtyParentClip yes Evaluation Count:524 | yes Evaluation Count:15 |
| 15-524 |
1117 | parentClip = sourceRegion.translated(parentOffset); | - |
1118 | dirtyParentClip = false; | - |
1119 | } executed: } Execution Count:524 | 524 |
1120 | | - |
1121 | const QPoint siblingPos(sibling->data->crect.topLeft()); | - |
1122 | const QRect siblingClipRect(sibling->d_func()->clipRect()); | - |
1123 | QRegion siblingDirty(parentClip); | - |
1124 | siblingDirty &= (siblingClipRect.translated(siblingPos)); | - |
1125 | const bool hasMask = sibling->d_func()->extra && sibling->d_func()->extra->hasMask evaluated: sibling->d_func()->extra yes Evaluation Count:491 | yes Evaluation Count:48 |
partially evaluated: sibling->d_func()->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:491 |
| 0-491 |
1126 | && !sibling->d_func()->graphicsEffect; never evaluated: !sibling->d_func()->graphicsEffect | 0 |
1127 | if (hasMask) partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:539 |
| 0-539 |
1128 | siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); never executed: siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); | 0 |
1129 | if (siblingDirty.isEmpty()) evaluated: siblingDirty.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:536 |
| 3-536 |
1130 | continue; executed: continue; Execution Count:3 | 3 |
1131 | | - |
1132 | if (sibling->d_func()->isOpaque || alsoNonOpaque) { evaluated: sibling->d_func()->isOpaque yes Evaluation Count:377 | yes Evaluation Count:159 |
partially evaluated: alsoNonOpaque no Evaluation Count:0 | yes Evaluation Count:159 |
| 0-377 |
1133 | if (hasMask) { partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:377 |
| 0-377 |
1134 | siblingDirty.translate(-parentOffset); | - |
1135 | sourceRegion -= siblingDirty; | - |
1136 | } else { | 0 |
1137 | sourceRegion -= siblingGeometry.translated(-parentOffset); | - |
1138 | } executed: } Execution Count:377 | 377 |
1139 | } else { | - |
1140 | if (hasDirtySiblingsAbove) evaluated: hasDirtySiblingsAbove yes Evaluation Count:28 | yes Evaluation Count:131 |
| 28-131 |
1141 | *hasDirtySiblingsAbove = true; executed: *hasDirtySiblingsAbove = true; Execution Count:28 | 28 |
1142 | if (sibling->d_func()->children.isEmpty()) evaluated: sibling->d_func()->children.isEmpty() yes Evaluation Count:28 | yes Evaluation Count:131 |
| 28-131 |
1143 | continue; executed: continue; Execution Count:28 | 28 |
1144 | QRegion opaqueSiblingChildren(sibling->d_func()->getOpaqueChildren()); | - |
1145 | opaqueSiblingChildren.translate(-parentOffset + siblingPos); | - |
1146 | sourceRegion -= opaqueSiblingChildren; | - |
1147 | } executed: } Execution Count:131 | 131 |
1148 | if (sourceRegion.isEmpty()) evaluated: sourceRegion.isEmpty() yes Evaluation Count:289 | yes Evaluation Count:219 |
| 219-289 |
1149 | return; executed: return; Execution Count:289 | 289 |
1150 | | - |
1151 | dirtyClipBoundingRect = true; | - |
1152 | dirtyParentClip = true; | - |
1153 | } executed: } Execution Count:219 | 219 |
1154 | | - |
1155 | w = w->parentWidget(); | - |
1156 | parentOffset += pd->data.crect.topLeft(); | - |
1157 | dirtyParentClip = true; | - |
1158 | } executed: } Execution Count:21550 | 21550 |
1159 | } executed: } Execution Count:11980 | 11980 |
1160 | | - |
1161 | void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const | - |
1162 | { | - |
1163 | const QWidget * const q = q_func(); | - |
1164 | | - |
1165 | const QWidget *w = q; | - |
1166 | QPoint offset; | - |
1167 | | - |
1168 | | - |
1169 | if (graphicsEffect) { partially evaluated: graphicsEffect no Evaluation Count:0 | yes Evaluation Count:9602 |
| 0-9602 |
1170 | w = q->parentWidget(); | - |
1171 | offset -= data.crect.topLeft(); | - |
1172 | } | 0 |
1173 | | - |
1174 | | - |
1175 | while (w) { partially evaluated: w yes Evaluation Count:26227 | no Evaluation Count:0 |
| 0-26227 |
1176 | const QWidgetPrivate *wd = w->d_func(); | - |
1177 | if (wd->extra && wd->extra->hasMask) evaluated: wd->extra yes Evaluation Count:21259 | yes Evaluation Count:4968 |
evaluated: wd->extra->hasMask yes Evaluation Count:27 | yes Evaluation Count:21232 |
| 27-21259 |
1178 | region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask; executed: region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask; Execution Count:27 evaluated: (w != q) yes Evaluation Count:16 | yes Evaluation Count:11 |
| 11-27 |
1179 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:9602 | yes Evaluation Count:16625 |
| 9602-16625 |
1180 | return; executed: return; Execution Count:9602 | 9602 |
1181 | offset -= wd->data.crect.topLeft(); | - |
1182 | w = w->parentWidget(); | - |
1183 | } executed: } Execution Count:16625 | 16625 |
1184 | } | 0 |
1185 | | - |
1186 | bool QWidgetPrivate::paintOnScreen() const | - |
1187 | { | - |
1188 | | - |
1189 | | - |
1190 | | - |
1191 | const QWidget * const q = q_func(); | - |
1192 | if (q->testAttribute(Qt::WA_PaintOnScreen) evaluated: q->testAttribute(Qt::WA_PaintOnScreen) yes Evaluation Count:20 | yes Evaluation Count:176523 |
| 20-176523 |
1193 | || (!q->isWindow() && q->window()->testAttribute(Qt::WA_PaintOnScreen))) { evaluated: !q->isWindow() yes Evaluation Count:137568 | yes Evaluation Count:38955 |
evaluated: q->window()->testAttribute(Qt::WA_PaintOnScreen) yes Evaluation Count:15 | yes Evaluation Count:137553 |
| 15-137568 |
1194 | return true; executed: return true; Execution Count:35 | 35 |
1195 | } | - |
1196 | | - |
1197 | return !qt_enable_backingstore; executed: return !qt_enable_backingstore; Execution Count:176508 | 176508 |
1198 | | - |
1199 | } | - |
1200 | | - |
1201 | void QWidgetPrivate::updateIsOpaque() | - |
1202 | { | - |
1203 | | - |
1204 | setDirtyOpaqueRegion(); | - |
1205 | | - |
1206 | | - |
1207 | if (graphicsEffect) { evaluated: graphicsEffect yes Evaluation Count:6 | yes Evaluation Count:94442 |
| 6-94442 |
1208 | | - |
1209 | setOpaque(false); | - |
1210 | return; executed: return; Execution Count:6 | 6 |
1211 | } | - |
1212 | | - |
1213 | | - |
1214 | QWidget * const q = q_func(); | - |
1215 | | - |
1216 | | - |
1217 | | - |
1218 | | - |
1219 | | - |
1220 | | - |
1221 | | - |
1222 | if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) { evaluated: q->testAttribute(Qt::WA_OpaquePaintEvent) yes Evaluation Count:11501 | yes Evaluation Count:82941 |
evaluated: q->testAttribute(Qt::WA_PaintOnScreen) yes Evaluation Count:283 | yes Evaluation Count:82658 |
| 283-82941 |
1223 | setOpaque(true); | - |
1224 | return; executed: return; Execution Count:11784 | 11784 |
1225 | } | - |
1226 | | - |
1227 | const QPalette &pal = q->palette(); | - |
1228 | | - |
1229 | if (q->autoFillBackground()) { evaluated: q->autoFillBackground() yes Evaluation Count:21143 | yes Evaluation Count:61515 |
| 21143-61515 |
1230 | const QBrush &autoFillBrush = pal.brush(q->backgroundRole()); | - |
1231 | if (autoFillBrush.style() != Qt::NoBrush && autoFillBrush.isOpaque()) { partially evaluated: autoFillBrush.style() != Qt::NoBrush yes Evaluation Count:21143 | no Evaluation Count:0 |
evaluated: autoFillBrush.isOpaque() yes Evaluation Count:21128 | yes Evaluation Count:15 |
| 0-21143 |
1232 | setOpaque(true); | - |
1233 | return; executed: return; Execution Count:21128 | 21128 |
1234 | } | - |
1235 | } executed: } Execution Count:15 | 15 |
1236 | | - |
1237 | if (q->isWindow() && !q->testAttribute(Qt::WA_NoSystemBackground)) { evaluated: q->isWindow() yes Evaluation Count:5006 | yes Evaluation Count:56524 |
evaluated: !q->testAttribute(Qt::WA_NoSystemBackground) yes Evaluation Count:4991 | yes Evaluation Count:15 |
| 15-56524 |
1238 | const QBrush &windowBrush = q->palette().brush(QPalette::Window); | - |
1239 | if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) { partially evaluated: windowBrush.style() != Qt::NoBrush yes Evaluation Count:4991 | no Evaluation Count:0 |
evaluated: windowBrush.isOpaque() yes Evaluation Count:4985 | yes Evaluation Count:6 |
| 0-4991 |
1240 | setOpaque(true); | - |
1241 | return; executed: return; Execution Count:4985 | 4985 |
1242 | } | - |
1243 | } executed: } Execution Count:6 | 6 |
1244 | setOpaque(false); | - |
1245 | } executed: } Execution Count:56545 | 56545 |
1246 | | - |
1247 | void QWidgetPrivate::setOpaque(bool opaque) | - |
1248 | { | - |
1249 | if (isOpaque != opaque) { evaluated: isOpaque != opaque yes Evaluation Count:28363 | yes Evaluation Count:73914 |
| 28363-73914 |
1250 | isOpaque = opaque; | - |
1251 | updateIsTranslucent(); | - |
1252 | } executed: } Execution Count:28363 | 28363 |
1253 | } executed: } Execution Count:102277 | 102277 |
1254 | | - |
1255 | void QWidgetPrivate::updateIsTranslucent() | - |
1256 | { | - |
1257 | QWidget * const q = q_func(); | - |
1258 | if (QWindow *window = q->windowHandle()) { evaluated: QWindow *window = q->windowHandle() yes Evaluation Count:10 | yes Evaluation Count:28357 |
| 10-28357 |
1259 | QSurfaceFormat format = window->format(); | - |
1260 | const int oldAlpha = format.alphaBufferSize(); | - |
1261 | const int newAlpha = q->testAttribute(Qt::WA_TranslucentBackground)? 8 : 0; partially evaluated: q->testAttribute(Qt::WA_TranslucentBackground) no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
1262 | if (oldAlpha != newAlpha) { partially evaluated: oldAlpha != newAlpha yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
1263 | format.setAlphaBufferSize(newAlpha); | - |
1264 | window->setFormat(format); | - |
1265 | } executed: } Execution Count:10 | 10 |
1266 | } executed: } Execution Count:10 | 10 |
1267 | } executed: } Execution Count:28367 | 28367 |
1268 | | - |
1269 | static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush) | - |
1270 | { | - |
1271 | qt_noop(); | - |
1272 | | - |
1273 | if (brush.style() == Qt::TexturePattern) { evaluated: brush.style() == Qt::TexturePattern yes Evaluation Count:4 | yes Evaluation Count:8673 |
| 4-8673 |
1274 | | - |
1275 | | - |
1276 | | - |
1277 | | - |
1278 | | - |
1279 | | - |
1280 | | - |
1281 | { | - |
1282 | const QRect rect(rgn.boundingRect()); | - |
1283 | painter->setClipRegion(rgn); | - |
1284 | painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); | - |
1285 | } | - |
1286 | | - |
1287 | | - |
1288 | } else if (brush.gradient() evaluated: brush.gradient() yes Evaluation Count:4 | yes Evaluation Count:8669 |
executed: } Execution Count:4 | 4-8669 |
1289 | && brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode) { partially evaluated: brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1290 | painter->save(); | - |
1291 | painter->setClipRegion(rgn); | - |
1292 | painter->fillRect(0, 0, painter->device()->width(), painter->device()->height(), brush); | - |
1293 | painter->restore(); | - |
1294 | } else { | 0 |
1295 | const QVector<QRect> &rects = rgn.rects(); | - |
1296 | for (int i = 0; i < rects.size(); ++i) evaluated: i < rects.size() yes Evaluation Count:15879 | yes Evaluation Count:8673 |
| 8673-15879 |
1297 | painter->fillRect(rects.at(i), brush); executed: painter->fillRect(rects.at(i), brush); Execution Count:15879 | 15879 |
1298 | } executed: } Execution Count:8673 | 8673 |
1299 | } | - |
1300 | | - |
1301 | void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int flags) const | - |
1302 | { | - |
1303 | const QWidget * const q = q_func(); | - |
1304 | | - |
1305 | | - |
1306 | bool resetBrushOrigin = false; | - |
1307 | QPointF oldBrushOrigin; | - |
1308 | | - |
1309 | QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent); | - |
1310 | if (scrollArea && scrollArea->viewport() == q) { evaluated: scrollArea yes Evaluation Count:4783 | yes Evaluation Count:3896 |
evaluated: scrollArea->viewport() == q yes Evaluation Count:4780 | yes Evaluation Count:3 |
| 3-4783 |
1311 | QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr.data(); | - |
1312 | QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate); | - |
1313 | oldBrushOrigin = painter->brushOrigin(); | - |
1314 | resetBrushOrigin = true; | - |
1315 | painter->setBrushOrigin(-priv->contentsOffset()); | - |
1316 | | - |
1317 | } executed: } Execution Count:4780 | 4780 |
1318 | | - |
1319 | | - |
1320 | const QBrush autoFillBrush = q->palette().brush(q->backgroundRole()); | - |
1321 | | - |
1322 | if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.isOpaque())) { evaluated: (flags & DrawAsRoot) yes Evaluation Count:3471 | yes Evaluation Count:5208 |
evaluated: q->autoFillBackground() yes Evaluation Count:39 | yes Evaluation Count:3432 |
partially evaluated: autoFillBrush.isOpaque() yes Evaluation Count:39 | no Evaluation Count:0 |
| 0-5208 |
1323 | const QBrush bg = q->palette().brush(QPalette::Window); | - |
1324 | if (!(flags & DontSetCompositionMode)) { evaluated: !(flags & DontSetCompositionMode) yes Evaluation Count:3360 | yes Evaluation Count:72 |
| 72-3360 |
1325 | | - |
1326 | QPainter::CompositionMode oldMode = painter->compositionMode(); | - |
1327 | painter->setCompositionMode(QPainter::CompositionMode_Source); | - |
1328 | fillRegion(painter, rgn, bg); | - |
1329 | painter->setCompositionMode(oldMode); | - |
1330 | } else { executed: } Execution Count:3360 | 3360 |
1331 | fillRegion(painter, rgn, bg); | - |
1332 | } executed: } Execution Count:72 | 72 |
1333 | } | - |
1334 | | - |
1335 | if (q->autoFillBackground()) evaluated: q->autoFillBackground() yes Evaluation Count:5245 | yes Evaluation Count:3434 |
| 3434-5245 |
1336 | fillRegion(painter, rgn, autoFillBrush); executed: fillRegion(painter, rgn, autoFillBrush); Execution Count:5245 | 5245 |
1337 | | - |
1338 | if (q->testAttribute(Qt::WA_StyledBackground)) { evaluated: q->testAttribute(Qt::WA_StyledBackground) yes Evaluation Count:4 | yes Evaluation Count:8675 |
| 4-8675 |
1339 | painter->setClipRegion(rgn); | - |
1340 | QStyleOption opt; | - |
1341 | opt.initFrom(q); | - |
1342 | q->style()->drawPrimitive(QStyle::PE_Widget, &opt, painter, q); | - |
1343 | } executed: } Execution Count:4 | 4 |
1344 | | - |
1345 | | - |
1346 | if (resetBrushOrigin) evaluated: resetBrushOrigin yes Evaluation Count:4780 | yes Evaluation Count:3899 |
| 3899-4780 |
1347 | painter->setBrushOrigin(oldBrushOrigin); executed: painter->setBrushOrigin(oldBrushOrigin); Execution Count:4780 | 4780 |
1348 | | - |
1349 | } executed: } Execution Count:8679 | 8679 |
1350 | extern QWidget *qt_button_down; | - |
1351 | | - |
1352 | | - |
1353 | void QWidgetPrivate::deactivateWidgetCleanup() | - |
1354 | { | - |
1355 | QWidget * const q = q_func(); | - |
1356 | | - |
1357 | if (QApplication::activeWindow() == q) evaluated: QApplication::activeWindow() == q yes Evaluation Count:1343 | yes Evaluation Count:47759 |
| 1343-47759 |
1358 | QApplication::setActiveWindow(0); executed: QApplication::setActiveWindow(0); Execution Count:1343 | 1343 |
1359 | | - |
1360 | if (q == qt_button_down) partially evaluated: q == qt_button_down no Evaluation Count:0 | yes Evaluation Count:49102 |
| 0-49102 |
1361 | qt_button_down = 0; never executed: qt_button_down = 0; | 0 |
1362 | } executed: } Execution Count:49102 | 49102 |
1363 | QWidget *QWidget::find(WId id) | - |
1364 | { | - |
1365 | return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0; never executed: return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0; | 0 |
1366 | } | - |
1367 | WId QWidget::winId() const | - |
1368 | { | - |
1369 | if (!testAttribute(Qt::WA_WState_Created) || !internalWinId()) { evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:19 | yes Evaluation Count:43 |
evaluated: !internalWinId() yes Evaluation Count:2 | yes Evaluation Count:41 |
| 2-43 |
1370 | | - |
1371 | | - |
1372 | | - |
1373 | QWidget *that = const_cast<QWidget*>(this); | - |
1374 | that->setAttribute(Qt::WA_NativeWindow); | - |
1375 | that->d_func()->createWinId(); | - |
1376 | return that->data->winid; executed: return that->data->winid; Execution Count:21 | 21 |
1377 | } | - |
1378 | return data->winid; executed: return data->winid; Execution Count:41 | 41 |
1379 | } | - |
1380 | | - |
1381 | | - |
1382 | void QWidgetPrivate::createWinId(WId winid) | - |
1383 | { | - |
1384 | QWidget * const q = q_func(); | - |
1385 | | - |
1386 | | - |
1387 | | - |
1388 | | - |
1389 | const bool forceNativeWindow = q->testAttribute(Qt::WA_NativeWindow); | - |
1390 | if (!q->testAttribute(Qt::WA_WState_Created) || (forceNativeWindow && !q->internalWinId())) { evaluated: !q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:108 | yes Evaluation Count:13 |
evaluated: forceNativeWindow yes Evaluation Count:11 | yes Evaluation Count:2 |
evaluated: !q->internalWinId() yes Evaluation Count:9 | yes Evaluation Count:2 |
| 2-108 |
1391 | if (!q->isWindow()) { evaluated: !q->isWindow() yes Evaluation Count:30 | yes Evaluation Count:87 |
| 30-87 |
1392 | QWidget *parent = q->parentWidget(); | - |
1393 | QWidgetPrivate *pd = parent->d_func(); | - |
1394 | if (forceNativeWindow && !q->testAttribute(Qt::WA_DontCreateNativeAncestors)) evaluated: forceNativeWindow yes Evaluation Count:29 | yes Evaluation Count:1 |
evaluated: !q->testAttribute(Qt::WA_DontCreateNativeAncestors) yes Evaluation Count:28 | yes Evaluation Count:1 |
| 1-29 |
1395 | parent->setAttribute(Qt::WA_NativeWindow); executed: parent->setAttribute(Qt::WA_NativeWindow); Execution Count:28 | 28 |
1396 | if (!parent->internalWinId()) { evaluated: !parent->internalWinId() yes Evaluation Count:12 | yes Evaluation Count:18 |
| 12-18 |
1397 | pd->createWinId(); | - |
1398 | } executed: } Execution Count:12 | 12 |
1399 | | - |
1400 | for (int i = 0; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:47 | yes Evaluation Count:30 |
| 30-47 |
1401 | QWidget *w = qobject_cast<QWidget *>(pd->children.at(i)); | - |
1402 | if (w && !w->isWindow() && (!w->testAttribute(Qt::WA_WState_Created) evaluated: w yes Evaluation Count:46 | yes Evaluation Count:1 |
partially evaluated: !w->isWindow() yes Evaluation Count:46 | no Evaluation Count:0 |
evaluated: !w->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:26 | yes Evaluation Count:20 |
| 0-46 |
1403 | || (!w->internalWinId() && w->testAttribute(Qt::WA_NativeWindow)))) { evaluated: !w->internalWinId() yes Evaluation Count:14 | yes Evaluation Count:6 |
evaluated: w->testAttribute(Qt::WA_NativeWindow) yes Evaluation Count:12 | yes Evaluation Count:2 |
| 2-14 |
1404 | if (w!=q) { evaluated: w!=q yes Evaluation Count:8 | yes Evaluation Count:30 |
| 8-30 |
1405 | w->create(); | - |
1406 | } else { executed: } Execution Count:8 | 8 |
1407 | w->create(winid); | - |
1408 | | - |
1409 | | - |
1410 | if (winid) partially evaluated: winid no Evaluation Count:0 | yes Evaluation Count:30 |
| 0-30 |
1411 | w->raise(); never executed: w->raise(); | 0 |
1412 | } executed: } Execution Count:30 | 30 |
1413 | } | - |
1414 | } executed: } Execution Count:47 | 47 |
1415 | } else { executed: } Execution Count:30 | 30 |
1416 | q->create(); | - |
1417 | } executed: } Execution Count:87 | 87 |
1418 | } | - |
1419 | } executed: } Execution Count:121 | 121 |
1420 | void QWidget::createWinId() | - |
1421 | { | - |
1422 | QWidgetPrivate * const d = d_func(); | - |
1423 | | - |
1424 | | - |
1425 | | - |
1426 | | - |
1427 | d->createWinId(); | - |
1428 | } executed: } Execution Count:77 | 77 |
1429 | WId QWidget::effectiveWinId() const | - |
1430 | { | - |
1431 | const WId id = internalWinId(); | - |
1432 | if (id || !testAttribute(Qt::WA_WState_Created)) evaluated: id yes Evaluation Count:112 | yes Evaluation Count:376 |
evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2 | yes Evaluation Count:374 |
| 2-376 |
1433 | return id; executed: return id; Execution Count:114 | 114 |
1434 | if (const QWidget *realParent = nativeParentWidget()) partially evaluated: const QWidget *realParent = nativeParentWidget() yes Evaluation Count:374 | no Evaluation Count:0 |
| 0-374 |
1435 | return realParent->internalWinId(); executed: return realParent->internalWinId(); Execution Count:374 | 374 |
1436 | return 0; never executed: return 0; | 0 |
1437 | } | - |
1438 | QString QWidget::styleSheet() const | - |
1439 | { | - |
1440 | const QWidgetPrivate * const d = d_func(); | - |
1441 | if (!d->extra) evaluated: !d->extra yes Evaluation Count:42809 | yes Evaluation Count:7923 |
| 7923-42809 |
1442 | return QString(); executed: return QString(); Execution Count:42809 | 42809 |
1443 | return d->extra->styleSheet; executed: return d->extra->styleSheet; Execution Count:7923 | 7923 |
1444 | } | - |
1445 | | - |
1446 | void QWidget::setStyleSheet(const QString& styleSheet) | - |
1447 | { | - |
1448 | QWidgetPrivate * const d = d_func(); | - |
1449 | d->createExtra(); | - |
1450 | | - |
1451 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(d->extra->style); | - |
1452 | d->extra->styleSheet = styleSheet; | - |
1453 | if (styleSheet.isEmpty()) { evaluated: styleSheet.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:399 |
| 2-399 |
1454 | if (!proxy) partially evaluated: !proxy no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1455 | return; | 0 |
1456 | | - |
1457 | d->inheritStyle(); | - |
1458 | return; executed: return; Execution Count:2 | 2 |
1459 | } | - |
1460 | | - |
1461 | if (proxy) { partially evaluated: proxy no Evaluation Count:0 | yes Evaluation Count:399 |
| 0-399 |
1462 | proxy->repolish(this); | - |
1463 | return; | 0 |
1464 | } | - |
1465 | | - |
1466 | if (testAttribute(Qt::WA_SetStyle)) { evaluated: testAttribute(Qt::WA_SetStyle) yes Evaluation Count:384 | yes Evaluation Count:15 |
| 15-384 |
1467 | d->setStyle_helper(new QStyleSheetStyle(d->extra->style), true); | - |
1468 | } else { executed: } Execution Count:384 | 384 |
1469 | d->setStyle_helper(new QStyleSheetStyle(0), true); | - |
1470 | } executed: } Execution Count:15 | 15 |
1471 | } | - |
1472 | | - |
1473 | | - |
1474 | | - |
1475 | | - |
1476 | | - |
1477 | | - |
1478 | | - |
1479 | QStyle *QWidget::style() const | - |
1480 | { | - |
1481 | const QWidgetPrivate * const d = d_func(); | - |
1482 | | - |
1483 | if (d->extra && d->extra->style) evaluated: d->extra yes Evaluation Count:622411 | yes Evaluation Count:918752 |
evaluated: d->extra->style yes Evaluation Count:53624 | yes Evaluation Count:568787 |
| 53624-918752 |
1484 | return d->extra->style; executed: return d->extra->style; Execution Count:53624 | 53624 |
1485 | return QApplication::style(); executed: return QApplication::style(); Execution Count:1487539 | 1487539 |
1486 | } | - |
1487 | void QWidget::setStyle(QStyle *style) | - |
1488 | { | - |
1489 | QWidgetPrivate * const d = d_func(); | - |
1490 | setAttribute(Qt::WA_SetStyle, style != 0); | - |
1491 | d->createExtra(); | - |
1492 | | - |
1493 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style)) { partially evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style) no Evaluation Count:0 | yes Evaluation Count:450 |
| 0-450 |
1494 | | - |
1495 | | - |
1496 | proxy->ref(); | - |
1497 | d->setStyle_helper(style, false); | - |
1498 | } else if (qobject_cast<QStyleSheetStyle *>(d->extra->style) || !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()) { partially evaluated: qobject_cast<QStyleSheetStyle *>(d->extra->style) no Evaluation Count:0 | yes Evaluation Count:450 |
partially evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() no Evaluation Count:0 | yes Evaluation Count:450 |
| 0-450 |
1499 | | - |
1500 | d->setStyle_helper(new QStyleSheetStyle(style), true); | - |
1501 | } else | 0 |
1502 | | - |
1503 | d->setStyle_helper(style, false); executed: d->setStyle_helper(style, false); Execution Count:450 | 450 |
1504 | } | - |
1505 | | - |
1506 | void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool | - |
1507 | | - |
1508 | | - |
1509 | | - |
1510 | ) | - |
1511 | { | - |
1512 | QWidget * const q = q_func(); | - |
1513 | QStyle *oldStyle = q->style(); | - |
1514 | | - |
1515 | QPointer<QStyle> origStyle; | - |
1516 | { | - |
1517 | createExtra(); | - |
1518 | | - |
1519 | | - |
1520 | origStyle = extra->style.data(); | - |
1521 | | - |
1522 | extra->style = newStyle; | - |
1523 | } | - |
1524 | | - |
1525 | | - |
1526 | if (q->windowType() != Qt::Desktop) { partially evaluated: q->windowType() != Qt::Desktop yes Evaluation Count:2844 | no Evaluation Count:0 |
| 0-2844 |
1527 | if (polished) { evaluated: polished yes Evaluation Count:814 | yes Evaluation Count:2030 |
| 814-2030 |
1528 | oldStyle->unpolish(q); | - |
1529 | | - |
1530 | | - |
1531 | | - |
1532 | | - |
1533 | q->style()->polish(q); | - |
1534 | | - |
1535 | | - |
1536 | | - |
1537 | | - |
1538 | } executed: } Execution Count:814 | 814 |
1539 | } executed: } Execution Count:2844 | 2844 |
1540 | | - |
1541 | if (propagate) { evaluated: propagate yes Evaluation Count:2394 | yes Evaluation Count:450 |
| 450-2394 |
1542 | | - |
1543 | const QObjectList childrenList = children; | - |
1544 | for (int i = 0; i < childrenList.size(); ++i) { evaluated: i < childrenList.size() yes Evaluation Count:2764 | yes Evaluation Count:2394 |
| 2394-2764 |
1545 | QWidget *c = qobject_cast<QWidget*>(childrenList.at(i)); | - |
1546 | if (c) evaluated: c yes Evaluation Count:1977 | yes Evaluation Count:787 |
| 787-1977 |
1547 | c->d_func()->inheritStyle(); executed: c->d_func()->inheritStyle(); Execution Count:1977 | 1977 |
1548 | } executed: } Execution Count:2764 | 2764 |
1549 | } executed: } Execution Count:2394 | 2394 |
1550 | | - |
1551 | | - |
1552 | if (!qobject_cast<QStyleSheetStyle*>(newStyle)) { evaluated: !qobject_cast<QStyleSheetStyle*>(newStyle) yes Evaluation Count:465 | yes Evaluation Count:2379 |
| 465-2379 |
1553 | if (const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data())) { evaluated: const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data()) yes Evaluation Count:2 | yes Evaluation Count:463 |
| 2-463 |
1554 | cssStyle->clearWidgetFont(q); | - |
1555 | } executed: } Execution Count:2 | 2 |
1556 | } executed: } Execution Count:465 | 465 |
1557 | | - |
1558 | | - |
1559 | QEvent e(QEvent::StyleChange); | - |
1560 | QApplication::sendEvent(q, &e); | - |
1561 | | - |
1562 | | - |
1563 | | - |
1564 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data())) evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data()) yes Evaluation Count:2 | yes Evaluation Count:2842 |
| 2-2842 |
1565 | proxy->deref(); executed: proxy->deref(); Execution Count:2 | 2 |
1566 | | - |
1567 | } executed: } Execution Count:2844 | 2844 |
1568 | | - |
1569 | | - |
1570 | void QWidgetPrivate::inheritStyle() | - |
1571 | { | - |
1572 | | - |
1573 | QWidget * const q = q_func(); | - |
1574 | | - |
1575 | QStyleSheetStyle *proxy = extra ? qobject_cast<QStyleSheetStyle *>(extra->style) : 0; evaluated: extra yes Evaluation Count:732 | yes Evaluation Count:42787 |
| 732-42787 |
1576 | | - |
1577 | if (!q->styleSheet().isEmpty()) { partially evaluated: !q->styleSheet().isEmpty() no Evaluation Count:0 | yes Evaluation Count:43519 |
| 0-43519 |
1578 | qt_noop(); | - |
1579 | proxy->repolish(q); | - |
1580 | return; | 0 |
1581 | } | - |
1582 | | - |
1583 | QStyle *origStyle = proxy ? proxy->base : (extra ? (QStyle*)extra->style : 0); evaluated: proxy yes Evaluation Count:2 | yes Evaluation Count:43517 |
| 2-43517 |
1584 | QWidget *parent = q->parentWidget(); | - |
1585 | QStyle *parentStyle = (parent && parent->d_func()->extra) ? (QStyle*)parent->d_func()->extra->style : 0; evaluated: parent yes Evaluation Count:42949 | yes Evaluation Count:570 |
evaluated: parent->d_func()->extra yes Evaluation Count:5018 | yes Evaluation Count:37931 |
| 570-42949 |
1586 | | - |
1587 | | - |
1588 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() || qobject_cast<QStyleSheetStyle *>(parentStyle)) { evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() yes Evaluation Count:13 | yes Evaluation Count:43506 |
evaluated: qobject_cast<QStyleSheetStyle *>(parentStyle) yes Evaluation Count:1980 | yes Evaluation Count:41526 |
| 13-43506 |
1589 | QStyle *newStyle = parentStyle; | - |
1590 | if (q->testAttribute(Qt::WA_SetStyle)) partially evaluated: q->testAttribute(Qt::WA_SetStyle) no Evaluation Count:0 | yes Evaluation Count:1993 |
| 0-1993 |
1591 | newStyle = new QStyleSheetStyle(origStyle); never executed: newStyle = new QStyleSheetStyle(origStyle); | 0 |
1592 | else if (QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle)) evaluated: QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle) yes Evaluation Count:1980 | yes Evaluation Count:13 |
| 13-1980 |
1593 | newProxy->ref(); executed: newProxy->ref(); Execution Count:1980 | 1980 |
1594 | | - |
1595 | setStyle_helper(newStyle, true); | - |
1596 | return; executed: return; Execution Count:1993 | 1993 |
1597 | } | - |
1598 | | - |
1599 | | - |
1600 | | - |
1601 | if (origStyle == (extra ? (QStyle*)extra->style : 0)) evaluated: origStyle == (extra ? (QStyle*)extra->style : 0) yes Evaluation Count:41524 | yes Evaluation Count:2 |
evaluated: extra yes Evaluation Count:342 | yes Evaluation Count:41184 |
| 2-41524 |
1602 | return; executed: return; Execution Count:41524 | 41524 |
1603 | | - |
1604 | | - |
1605 | | - |
1606 | | - |
1607 | if (!q->testAttribute(Qt::WA_SetStyle)) partially evaluated: !q->testAttribute(Qt::WA_SetStyle) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1608 | origStyle = 0; executed: origStyle = 0; Execution Count:2 | 2 |
1609 | | - |
1610 | setStyle_helper(origStyle, true); | - |
1611 | | - |
1612 | } executed: } Execution Count:2 | 2 |
1613 | Qt::WindowModality QWidget::windowModality() const | - |
1614 | { | - |
1615 | return static_cast<Qt::WindowModality>(data->window_modality); executed: return static_cast<Qt::WindowModality>(data->window_modality); Execution Count:2738 | 2738 |
1616 | } | - |
1617 | | - |
1618 | void QWidget::setWindowModality(Qt::WindowModality windowModality) | - |
1619 | { | - |
1620 | data->window_modality = windowModality; | - |
1621 | | - |
1622 | setAttribute(Qt::WA_ShowModal, (data->window_modality != Qt::NonModal)); | - |
1623 | setAttribute(Qt::WA_SetWindowModality, true); | - |
1624 | } executed: } Execution Count:4 | 4 |
1625 | bool QWidget::isMinimized() const | - |
1626 | { return data->window_state & Qt::WindowMinimized; } executed: return data->window_state & Qt::WindowMinimized; Execution Count:43322 | 43322 |
1627 | void QWidget::showMinimized() | - |
1628 | { | - |
1629 | bool isMin = isMinimized(); | - |
1630 | if (isMin && isVisible()) evaluated: isMin yes Evaluation Count:3 | yes Evaluation Count:51 |
evaluated: isVisible() yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-51 |
1631 | return; executed: return; Execution Count:1 | 1 |
1632 | | - |
1633 | ensurePolished(); | - |
1634 | | - |
1635 | if (!isMin) evaluated: !isMin yes Evaluation Count:51 | yes Evaluation Count:2 |
| 2-51 |
1636 | setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); executed: setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); Execution Count:51 | 51 |
1637 | setVisible(true); | - |
1638 | } executed: } Execution Count:53 | 53 |
1639 | bool QWidget::isMaximized() const | - |
1640 | { return data->window_state & Qt::WindowMaximized; } executed: return data->window_state & Qt::WindowMaximized; Execution Count:30302 | 30302 |
1641 | Qt::WindowStates QWidget::windowState() const | - |
1642 | { | - |
1643 | return Qt::WindowStates(data->window_state); executed: return Qt::WindowStates(data->window_state); Execution Count:37347 | 37347 |
1644 | } | - |
1645 | void QWidget::overrideWindowState(Qt::WindowStates newstate) | - |
1646 | { | - |
1647 | QWindowStateChangeEvent e(Qt::WindowStates(data->window_state), true); | - |
1648 | data->window_state = newstate; | - |
1649 | QApplication::sendEvent(this, &e); | - |
1650 | } executed: } Execution Count:1918 | 1918 |
1651 | bool QWidget::isFullScreen() const | - |
1652 | { return data->window_state & Qt::WindowFullScreen; } executed: return data->window_state & Qt::WindowFullScreen; Execution Count:26 | 26 |
1653 | void QWidget::showFullScreen() | - |
1654 | { | - |
1655 | ensurePolished(); | - |
1656 | | - |
1657 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized)) | - |
1658 | | Qt::WindowFullScreen); | - |
1659 | setVisible(true); | - |
1660 | activateWindow(); | - |
1661 | } executed: } Execution Count:18 | 18 |
1662 | void QWidget::showMaximized() | - |
1663 | { | - |
1664 | ensurePolished(); | - |
1665 | | - |
1666 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | - |
1667 | | Qt::WindowMaximized); | - |
1668 | setVisible(true); | - |
1669 | } executed: } Execution Count:83 | 83 |
1670 | void QWidget::showNormal() | - |
1671 | { | - |
1672 | ensurePolished(); | - |
1673 | | - |
1674 | setWindowState(windowState() & ~(Qt::WindowMinimized | - |
1675 | | Qt::WindowMaximized | - |
1676 | | Qt::WindowFullScreen)); | - |
1677 | setVisible(true); | - |
1678 | } executed: } Execution Count:92 | 92 |
1679 | bool QWidget::isEnabledTo(const QWidget *ancestor) const | - |
1680 | { | - |
1681 | const QWidget * w = this; | - |
1682 | while (!w->testAttribute(Qt::WA_ForceDisabled) evaluated: !w->testAttribute(Qt::WA_ForceDisabled) yes Evaluation Count:5 | yes Evaluation Count:2 |
| 2-5 |
1683 | && !w->isWindow() partially evaluated: !w->isWindow() yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
1684 | && w->parentWidget() partially evaluated: w->parentWidget() yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
1685 | && w->parentWidget() != ancestor) evaluated: w->parentWidget() != ancestor yes Evaluation Count:2 | yes Evaluation Count:3 |
| 2-3 |
1686 | w = w->parentWidget(); executed: w = w->parentWidget(); Execution Count:2 | 2 |
1687 | return !w->testAttribute(Qt::WA_ForceDisabled); executed: return !w->testAttribute(Qt::WA_ForceDisabled); Execution Count:5 | 5 |
1688 | } | - |
1689 | void QWidget::addAction(QAction *action) | - |
1690 | { | - |
1691 | insertAction(0, action); | - |
1692 | } executed: } Execution Count:2656 | 2656 |
1693 | | - |
1694 | | - |
1695 | | - |
1696 | | - |
1697 | | - |
1698 | | - |
1699 | void QWidget::addActions(QList<QAction*> actions) | - |
1700 | { | - |
1701 | for(int i = 0; i < actions.count(); i++) evaluated: i < actions.count() yes Evaluation Count:997 | yes Evaluation Count:162 |
| 162-997 |
1702 | insertAction(0, actions.at(i)); executed: insertAction(0, actions.at(i)); Execution Count:997 | 997 |
1703 | } executed: } Execution Count:162 | 162 |
1704 | void QWidget::insertAction(QAction *before, QAction *action) | - |
1705 | { | - |
1706 | if(!action) { partially evaluated: !action no Evaluation Count:0 | yes Evaluation Count:3653 |
| 0-3653 |
1707 | QMessageLogger("kernel/qwidget.cpp", 2952, __PRETTY_FUNCTION__).warning("QWidget::insertAction: Attempt to insert null action"); | - |
1708 | return; | 0 |
1709 | } | - |
1710 | | - |
1711 | QWidgetPrivate * const d = d_func(); | - |
1712 | if(d->actions.contains(action)) partially evaluated: d->actions.contains(action) no Evaluation Count:0 | yes Evaluation Count:3653 |
| 0-3653 |
1713 | removeAction(action); never executed: removeAction(action); | 0 |
1714 | | - |
1715 | int pos = d->actions.indexOf(before); | - |
1716 | if (pos < 0) { partially evaluated: pos < 0 yes Evaluation Count:3653 | no Evaluation Count:0 |
| 0-3653 |
1717 | before = 0; | - |
1718 | pos = d->actions.size(); | - |
1719 | } executed: } Execution Count:3653 | 3653 |
1720 | d->actions.insert(pos, action); | - |
1721 | | - |
1722 | QActionPrivate *apriv = action->d_func(); | - |
1723 | apriv->widgets.append(this); | - |
1724 | | - |
1725 | QActionEvent e(QEvent::ActionAdded, action, before); | - |
1726 | QApplication::sendEvent(this, &e); | - |
1727 | } executed: } Execution Count:3653 | 3653 |
1728 | void QWidget::insertActions(QAction *before, QList<QAction*> actions) | - |
1729 | { | - |
1730 | for(int i = 0; i < actions.count(); ++i) never evaluated: i < actions.count() | 0 |
1731 | insertAction(before, actions.at(i)); never executed: insertAction(before, actions.at(i)); | 0 |
1732 | } | 0 |
1733 | | - |
1734 | | - |
1735 | | - |
1736 | | - |
1737 | | - |
1738 | void QWidget::removeAction(QAction *action) | - |
1739 | { | - |
1740 | if (!action) partially evaluated: !action no Evaluation Count:0 | yes Evaluation Count:372 |
| 0-372 |
1741 | return; | 0 |
1742 | | - |
1743 | QWidgetPrivate * const d = d_func(); | - |
1744 | | - |
1745 | QActionPrivate *apriv = action->d_func(); | - |
1746 | apriv->widgets.removeAll(this); | - |
1747 | | - |
1748 | if (d->actions.removeAll(action)) { evaluated: d->actions.removeAll(action) yes Evaluation Count:363 | yes Evaluation Count:9 |
| 9-363 |
1749 | QActionEvent e(QEvent::ActionRemoved, action); | - |
1750 | QApplication::sendEvent(this, &e); | - |
1751 | } executed: } Execution Count:363 | 363 |
1752 | } executed: } Execution Count:372 | 372 |
1753 | | - |
1754 | | - |
1755 | | - |
1756 | | - |
1757 | | - |
1758 | | - |
1759 | QList<QAction*> QWidget::actions() const | - |
1760 | { | - |
1761 | const QWidgetPrivate * const d = d_func(); | - |
1762 | return d->actions; executed: return d->actions; Execution Count:766 | 766 |
1763 | } | - |
1764 | void QWidget::setEnabled(bool enable) | - |
1765 | { | - |
1766 | QWidgetPrivate * const d = d_func(); | - |
1767 | setAttribute(Qt::WA_ForceDisabled, !enable); | - |
1768 | d->setEnabled_helper(enable); | - |
1769 | } executed: } Execution Count:7270 | 7270 |
1770 | | - |
1771 | void QWidgetPrivate::setEnabled_helper(bool enable) | - |
1772 | { | - |
1773 | QWidget * const q = q_func(); | - |
1774 | | - |
1775 | if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->isEnabled()) evaluated: enable yes Evaluation Count:44239 | yes Evaluation Count:3604 |
evaluated: !q->isWindow() yes Evaluation Count:44154 | yes Evaluation Count:85 |
partially evaluated: q->parentWidget() yes Evaluation Count:44154 | no Evaluation Count:0 |
evaluated: !q->parentWidget()->isEnabled() yes Evaluation Count:1 | yes Evaluation Count:44153 |
| 0-44239 |
1776 | return; executed: return; Execution Count:1 | 1 |
1777 | | - |
1778 | if (enable != q->testAttribute(Qt::WA_Disabled)) evaluated: enable != q->testAttribute(Qt::WA_Disabled) yes Evaluation Count:44827 | yes Evaluation Count:3015 |
| 3015-44827 |
1779 | return; executed: return; Execution Count:44827 | 44827 |
1780 | | - |
1781 | q->setAttribute(Qt::WA_Disabled, !enable); | - |
1782 | updateSystemBackground(); | - |
1783 | | - |
1784 | if (!enable && q->window()->focusWidget() == q) { evaluated: !enable yes Evaluation Count:1900 | yes Evaluation Count:1115 |
evaluated: q->window()->focusWidget() == q yes Evaluation Count:91 | yes Evaluation Count:1809 |
| 91-1900 |
1785 | bool parentIsEnabled = (!q->parentWidget() || q->parentWidget()->isEnabled()); evaluated: !q->parentWidget() yes Evaluation Count:1 | yes Evaluation Count:90 |
evaluated: q->parentWidget()->isEnabled() yes Evaluation Count:89 | yes Evaluation Count:1 |
| 1-90 |
1786 | if (!parentIsEnabled || !q->focusNextChild()) evaluated: !parentIsEnabled yes Evaluation Count:1 | yes Evaluation Count:90 |
evaluated: !q->focusNextChild() yes Evaluation Count:89 | yes Evaluation Count:1 |
| 1-90 |
1787 | q->clearFocus(); executed: q->clearFocus(); Execution Count:90 | 90 |
1788 | } executed: } Execution Count:91 | 91 |
1789 | | - |
1790 | Qt::WidgetAttribute attribute = enable ? Qt::WA_ForceDisabled : Qt::WA_Disabled; evaluated: enable yes Evaluation Count:1115 | yes Evaluation Count:1900 |
| 1115-1900 |
1791 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:474 | yes Evaluation Count:3015 |
| 474-3015 |
1792 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
1793 | if (w && !w->testAttribute(attribute)) evaluated: w yes Evaluation Count:263 | yes Evaluation Count:211 |
evaluated: !w->testAttribute(attribute) yes Evaluation Count:251 | yes Evaluation Count:12 |
| 12-263 |
1794 | w->d_func()->setEnabled_helper(enable); executed: w->d_func()->setEnabled_helper(enable); Execution Count:251 | 251 |
1795 | } executed: } Execution Count:474 | 474 |
1796 | if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { evaluated: q->testAttribute(Qt::WA_SetCursor) yes Evaluation Count:16 | yes Evaluation Count:2999 |
evaluated: q->isWindow() yes Evaluation Count:65 | yes Evaluation Count:2934 |
| 16-2999 |
1797 | | - |
1798 | | - |
1799 | qt_qpa_set_cursor(q, false); | - |
1800 | } executed: } Execution Count:81 | 81 |
1801 | | - |
1802 | | - |
1803 | | - |
1804 | | - |
1805 | | - |
1806 | if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { evaluated: q->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:43 | yes Evaluation Count:2972 |
partially evaluated: q->hasFocus() no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-2972 |
1807 | QWidget *focusWidget = effectiveFocusWidget(); | - |
1808 | | - |
1809 | if (enable) { | 0 |
1810 | if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) never evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) | 0 |
1811 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | 0 |
1812 | } else { | 0 |
1813 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
1814 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
1815 | } | 0 |
1816 | } | - |
1817 | | - |
1818 | QEvent e(QEvent::EnabledChange); | - |
1819 | QApplication::sendEvent(q, &e); | - |
1820 | } executed: } Execution Count:3015 | 3015 |
1821 | bool QWidget::acceptDrops() const | - |
1822 | { | - |
1823 | return testAttribute(Qt::WA_AcceptDrops); executed: return testAttribute(Qt::WA_AcceptDrops); Execution Count:2531 | 2531 |
1824 | } | - |
1825 | | - |
1826 | void QWidget::setAcceptDrops(bool on) | - |
1827 | { | - |
1828 | setAttribute(Qt::WA_AcceptDrops, on); | - |
1829 | | - |
1830 | } executed: } Execution Count:6487 | 6487 |
1831 | void QWidget::setDisabled(bool disable) | - |
1832 | { | - |
1833 | setEnabled(!disable); | - |
1834 | } executed: } Execution Count:14 | 14 |
1835 | QRect QWidget::frameGeometry() const | - |
1836 | { | - |
1837 | const QWidgetPrivate * const d = d_func(); | - |
1838 | if (isWindow() && ! (windowType() == Qt::Popup)) { evaluated: isWindow() yes Evaluation Count:1330 | yes Evaluation Count:39 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:547 | yes Evaluation Count:783 |
| 39-1330 |
1839 | QRect fs = d->frameStrut(); | - |
1840 | return QRect(data->crect.x() - fs.left(), | 547 |
1841 | data->crect.y() - fs.top(), | 547 |
1842 | data->crect.width() + fs.left() + fs.right(), | 547 |
1843 | data->crect.height() + fs.top() + fs.bottom()); executed: return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); Execution Count:547 | 547 |
1844 | } | - |
1845 | return data->crect; executed: return data->crect; Execution Count:822 | 822 |
1846 | } | - |
1847 | int QWidget::x() const | - |
1848 | { | - |
1849 | const QWidgetPrivate * const d = d_func(); | - |
1850 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:881 | yes Evaluation Count:55792 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:872 | yes Evaluation Count:9 |
| 9-55792 |
1851 | return data->crect.x() - d->frameStrut().left(); executed: return data->crect.x() - d->frameStrut().left(); Execution Count:872 | 872 |
1852 | return data->crect.x(); executed: return data->crect.x(); Execution Count:55801 | 55801 |
1853 | } | - |
1854 | int QWidget::y() const | - |
1855 | { | - |
1856 | const QWidgetPrivate * const d = d_func(); | - |
1857 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:873 | yes Evaluation Count:55733 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:871 | yes Evaluation Count:2 |
| 2-55733 |
1858 | return data->crect.y() - d->frameStrut().top(); executed: return data->crect.y() - d->frameStrut().top(); Execution Count:871 | 871 |
1859 | return data->crect.y(); executed: return data->crect.y(); Execution Count:55735 | 55735 |
1860 | } | - |
1861 | QPoint QWidget::pos() const | - |
1862 | { | - |
1863 | const QWidgetPrivate * const d = d_func(); | - |
1864 | QPoint result = data->crect.topLeft(); | - |
1865 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:4521 | yes Evaluation Count:11974 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:4407 | yes Evaluation Count:114 |
| 114-11974 |
1866 | if (!d->maybeTopData() || !d->maybeTopData()->posIncludesFrame) evaluated: !d->maybeTopData() yes Evaluation Count:533 | yes Evaluation Count:3874 |
evaluated: !d->maybeTopData()->posIncludesFrame yes Evaluation Count:3548 | yes Evaluation Count:326 |
| 326-3874 |
1867 | result -= d->frameStrut().topLeft(); executed: result -= d->frameStrut().topLeft(); Execution Count:4081 | 4081 |
1868 | return result; executed: return result; Execution Count:16495 | 16495 |
1869 | } | - |
1870 | QRect QWidget::normalGeometry() const | - |
1871 | { | - |
1872 | const QWidgetPrivate * const d = d_func(); | - |
1873 | if (!d->extra || !d->extra->topextra) evaluated: !d->extra yes Evaluation Count:1 | yes Evaluation Count:15 |
partially evaluated: !d->extra->topextra no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
1874 | return QRect(); executed: return QRect(); Execution Count:1 | 1 |
1875 | | - |
1876 | if (!isMaximized() && !isFullScreen()) evaluated: !isMaximized() yes Evaluation Count:10 | yes Evaluation Count:5 |
evaluated: !isFullScreen() yes Evaluation Count:9 | yes Evaluation Count:1 |
| 1-10 |
1877 | return geometry(); executed: return geometry(); Execution Count:9 | 9 |
1878 | | - |
1879 | return d->topData()->normalGeometry; executed: return d->topData()->normalGeometry; Execution Count:6 | 6 |
1880 | } | - |
1881 | QRect QWidget::childrenRect() const | - |
1882 | { | - |
1883 | const QWidgetPrivate * const d = d_func(); | - |
1884 | QRect r(0, 0, 0, 0); | - |
1885 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:496 | yes Evaluation Count:919 |
| 496-919 |
1886 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
1887 | if (w && !w->isWindow() && !w->isHidden()) evaluated: w yes Evaluation Count:491 | yes Evaluation Count:5 |
evaluated: !w->isWindow() yes Evaluation Count:486 | yes Evaluation Count:5 |
partially evaluated: !w->isHidden() yes Evaluation Count:486 | no Evaluation Count:0 |
| 0-491 |
1888 | r |= w->geometry(); executed: r |= w->geometry(); Execution Count:486 | 486 |
1889 | } executed: } Execution Count:496 | 496 |
1890 | return r; executed: return r; Execution Count:919 | 919 |
1891 | } | - |
1892 | QRegion QWidget::childrenRegion() const | - |
1893 | { | - |
1894 | const QWidgetPrivate * const d = d_func(); | - |
1895 | QRegion r; | - |
1896 | for (int i = 0; i < d->children.size(); ++i) { never evaluated: i < d->children.size() | 0 |
1897 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
1898 | if (w && !w->isWindow() && !w->isHidden()) { never evaluated: !w->isWindow() never evaluated: !w->isHidden() | 0 |
1899 | QRegion mask = w->mask(); | - |
1900 | if (mask.isEmpty()) never evaluated: mask.isEmpty() | 0 |
1901 | r |= w->geometry(); never executed: r |= w->geometry(); | 0 |
1902 | else | - |
1903 | r |= mask.translated(w->pos()); never executed: r |= mask.translated(w->pos()); | 0 |
1904 | } | - |
1905 | } | 0 |
1906 | return r; never executed: return r; | 0 |
1907 | } | - |
1908 | QSize QWidget::minimumSize() const | - |
1909 | { | - |
1910 | const QWidgetPrivate * const d = d_func(); | - |
1911 | return d->extra ? QSize(d->extra->minw, d->extra->minh) : QSize(0, 0); executed: return d->extra ? QSize(d->extra->minw, d->extra->minh) : QSize(0, 0); Execution Count:84850 | 84850 |
1912 | } | - |
1913 | QSize QWidget::maximumSize() const | - |
1914 | { | - |
1915 | const QWidgetPrivate * const d = d_func(); | - |
1916 | return d->extra ? QSize(d->extra->maxw, d->extra->maxh) | 85377 |
1917 | : QSize(((1<<24)-1), ((1<<24)-1)); executed: return d->extra ? QSize(d->extra->maxw, d->extra->maxh) : QSize(((1<<24)-1), ((1<<24)-1)); Execution Count:85377 | 85377 |
1918 | } | - |
1919 | QSize QWidget::sizeIncrement() const | - |
1920 | { | - |
1921 | const QWidgetPrivate * const d = d_func(); | - |
1922 | return (d->extra && d->extra->topextra) | 0 |
1923 | ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) | 0 |
1924 | : QSize(0, 0); never executed: return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0); | 0 |
1925 | } | - |
1926 | QSize QWidget::baseSize() const | - |
1927 | { | - |
1928 | const QWidgetPrivate * const d = d_func(); | - |
1929 | return (d->extra != 0 && d->extra->topextra != 0) | 0 |
1930 | ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) | 0 |
1931 | : QSize(0, 0); never executed: return (d->extra != 0 && d->extra->topextra != 0) ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) : QSize(0, 0); | 0 |
1932 | } | - |
1933 | | - |
1934 | bool QWidgetPrivate::setMinimumSize_helper(int &minw, int &minh) | - |
1935 | { | - |
1936 | QWidget * const q = q_func(); | - |
1937 | | - |
1938 | int mw = minw, mh = minh; | - |
1939 | if (mw == ((1<<24)-1)) evaluated: mw == ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:8166 |
| 2-8166 |
1940 | mw = 0; executed: mw = 0; Execution Count:2 | 2 |
1941 | if (mh == ((1<<24)-1)) evaluated: mh == ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:8167 |
| 1-8167 |
1942 | mh = 0; executed: mh = 0; Execution Count:1 | 1 |
1943 | if (minw > ((1<<24)-1) || minh > ((1<<24)-1)) { evaluated: minw > ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:8166 |
evaluated: minh > ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:8164 |
| 2-8166 |
1944 | QMessageLogger("kernel/qwidget.cpp", 3593, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) " | - |
1945 | "The largest allowed size is (%d,%d)", | - |
1946 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - |
1947 | ((1<<24)-1)); | - |
1948 | minw = mw = qMin<int>(minw, ((1<<24)-1)); | - |
1949 | minh = mh = qMin<int>(minh, ((1<<24)-1)); | - |
1950 | } executed: } Execution Count:4 | 4 |
1951 | if (minw < 0 || minh < 0) { evaluated: minw < 0 yes Evaluation Count:2 | yes Evaluation Count:8166 |
evaluated: minh < 0 yes Evaluation Count:2 | yes Evaluation Count:8164 |
| 2-8166 |
1952 | QMessageLogger("kernel/qwidget.cpp", 3601, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) Negative sizes (%d,%d) " | - |
1953 | "are not possible", | - |
1954 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), minw, minh); | - |
1955 | minw = mw = qMax(minw, 0); | - |
1956 | minh = mh = qMax(minh, 0); | - |
1957 | } executed: } Execution Count:4 | 4 |
1958 | createExtra(); | - |
1959 | if (extra->minw == mw && extra->minh == mh) evaluated: extra->minw == mw yes Evaluation Count:3273 | yes Evaluation Count:4895 |
evaluated: extra->minh == mh yes Evaluation Count:3050 | yes Evaluation Count:223 |
| 223-4895 |
1960 | return false; executed: return false; Execution Count:3050 | 3050 |
1961 | extra->minw = mw; | - |
1962 | extra->minh = mh; | - |
1963 | extra->explicitMinSize = (mw ? Qt::Horizontal : 0) | (mh ? Qt::Vertical : 0); evaluated: mw yes Evaluation Count:4270 | yes Evaluation Count:848 |
| 848-4270 |
1964 | return true; executed: return true; Execution Count:5118 | 5118 |
1965 | } | - |
1966 | void QWidget::setMinimumSize(int minw, int minh) | - |
1967 | { | - |
1968 | QWidgetPrivate * const d = d_func(); | - |
1969 | if (!d->setMinimumSize_helper(minw, minh)) evaluated: !d->setMinimumSize_helper(minw, minh) yes Evaluation Count:2932 | yes Evaluation Count:2973 |
| 2932-2973 |
1970 | return; executed: return; Execution Count:2932 | 2932 |
1971 | | - |
1972 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:692 | yes Evaluation Count:2281 |
| 692-2281 |
1973 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:692 | 692 |
1974 | if (minw > width() || minh > height()) { evaluated: minw > width() yes Evaluation Count:68 | yes Evaluation Count:2905 |
evaluated: minh > height() yes Evaluation Count:41 | yes Evaluation Count:2864 |
| 41-2905 |
1975 | bool resized = testAttribute(Qt::WA_Resized); | - |
1976 | bool maximized = isMaximized(); | - |
1977 | resize(qMax(minw,width()), qMax(minh,height())); | - |
1978 | setAttribute(Qt::WA_Resized, resized); | - |
1979 | if (maximized) partially evaluated: maximized no Evaluation Count:0 | yes Evaluation Count:109 |
| 0-109 |
1980 | data->window_state = data->window_state | Qt::WindowMaximized; never executed: data->window_state = data->window_state | Qt::WindowMaximized; | 0 |
1981 | } executed: } Execution Count:109 | 109 |
1982 | | - |
1983 | if (d->extra) { partially evaluated: d->extra yes Evaluation Count:2973 | no Evaluation Count:0 |
| 0-2973 |
1984 | if (d->extra->proxyWidget) partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:2973 |
| 0-2973 |
1985 | d->extra->proxyWidget->setMinimumSize(minw, minh); never executed: d->extra->proxyWidget->setMinimumSize(minw, minh); | 0 |
1986 | } executed: } Execution Count:2973 | 2973 |
1987 | | - |
1988 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - |
1989 | } executed: } Execution Count:2973 | 2973 |
1990 | | - |
1991 | bool QWidgetPrivate::setMaximumSize_helper(int &maxw, int &maxh) | - |
1992 | { | - |
1993 | QWidget * const q = q_func(); | - |
1994 | if (maxw > ((1<<24)-1) || maxh > ((1<<24)-1)) { evaluated: maxw > ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:4898 |
evaluated: maxh > ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:4897 |
| 1-4898 |
1995 | QMessageLogger("kernel/qwidget.cpp", 3653, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) " | - |
1996 | "The largest allowed size is (%d,%d)", | - |
1997 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - |
1998 | ((1<<24)-1)); | - |
1999 | maxw = qMin<int>(maxw, ((1<<24)-1)); | - |
2000 | maxh = qMin<int>(maxh, ((1<<24)-1)); | - |
2001 | } executed: } Execution Count:2 | 2 |
2002 | if (maxw < 0 || maxh < 0) { evaluated: maxw < 0 yes Evaluation Count:1 | yes Evaluation Count:4898 |
evaluated: maxh < 0 yes Evaluation Count:1 | yes Evaluation Count:4897 |
| 1-4898 |
2003 | QMessageLogger("kernel/qwidget.cpp", 3661, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) Negative sizes (%d,%d) " | - |
2004 | "are not possible", | - |
2005 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), maxw, maxh); | - |
2006 | maxw = qMax(maxw, 0); | - |
2007 | maxh = qMax(maxh, 0); | - |
2008 | } executed: } Execution Count:2 | 2 |
2009 | createExtra(); | - |
2010 | if (extra->maxw == maxw && extra->maxh == maxh) evaluated: extra->maxw == maxw yes Evaluation Count:1395 | yes Evaluation Count:3504 |
evaluated: extra->maxh == maxh yes Evaluation Count:1254 | yes Evaluation Count:141 |
| 141-3504 |
2011 | return false; executed: return false; Execution Count:1254 | 1254 |
2012 | extra->maxw = maxw; | - |
2013 | extra->maxh = maxh; | - |
2014 | extra->explicitMaxSize = (maxw != ((1<<24)-1) ? Qt::Horizontal : 0) | evaluated: maxw != ((1<<24)-1) yes Evaluation Count:3570 | yes Evaluation Count:75 |
| 75-3570 |
2015 | (maxh != ((1<<24)-1) ? Qt::Vertical : 0); | - |
2016 | return true; executed: return true; Execution Count:3645 | 3645 |
2017 | } | - |
2018 | void QWidget::setMaximumSize(int maxw, int maxh) | - |
2019 | { | - |
2020 | QWidgetPrivate * const d = d_func(); | - |
2021 | if (!d->setMaximumSize_helper(maxw, maxh)) evaluated: !d->setMaximumSize_helper(maxw, maxh) yes Evaluation Count:1136 | yes Evaluation Count:1500 |
| 1136-1500 |
2022 | return; executed: return; Execution Count:1136 | 1136 |
2023 | | - |
2024 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:198 | yes Evaluation Count:1302 |
| 198-1302 |
2025 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:198 | 198 |
2026 | if (maxw < width() || maxh < height()) { evaluated: maxw < width() yes Evaluation Count:53 | yes Evaluation Count:1447 |
evaluated: maxh < height() yes Evaluation Count:79 | yes Evaluation Count:1368 |
| 53-1447 |
2027 | bool resized = testAttribute(Qt::WA_Resized); | - |
2028 | resize(qMin(maxw,width()), qMin(maxh,height())); | - |
2029 | setAttribute(Qt::WA_Resized, resized); | - |
2030 | } executed: } Execution Count:132 | 132 |
2031 | | - |
2032 | | - |
2033 | if (d->extra) { partially evaluated: d->extra yes Evaluation Count:1500 | no Evaluation Count:0 |
| 0-1500 |
2034 | if (d->extra->proxyWidget) partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1500 |
| 0-1500 |
2035 | d->extra->proxyWidget->setMaximumSize(maxw, maxh); never executed: d->extra->proxyWidget->setMaximumSize(maxw, maxh); | 0 |
2036 | } executed: } Execution Count:1500 | 1500 |
2037 | | - |
2038 | | - |
2039 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - |
2040 | } executed: } Execution Count:1500 | 1500 |
2041 | | - |
2042 | | - |
2043 | | - |
2044 | | - |
2045 | | - |
2046 | | - |
2047 | | - |
2048 | void QWidget::setSizeIncrement(int w, int h) | - |
2049 | { | - |
2050 | QWidgetPrivate * const d = d_func(); | - |
2051 | d->createTLExtra(); | - |
2052 | QTLWExtra* x = d->topData(); | - |
2053 | if (x->incw == w && x->inch == h) never evaluated: x->incw == w never evaluated: x->inch == h | 0 |
2054 | return; | 0 |
2055 | x->incw = w; | - |
2056 | x->inch = h; | - |
2057 | if (isWindow()) never evaluated: isWindow() | 0 |
2058 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 |
2059 | } | 0 |
2060 | | - |
2061 | | - |
2062 | | - |
2063 | | - |
2064 | | - |
2065 | | - |
2066 | | - |
2067 | void QWidget::setBaseSize(int basew, int baseh) | - |
2068 | { | - |
2069 | QWidgetPrivate * const d = d_func(); | - |
2070 | d->createTLExtra(); | - |
2071 | QTLWExtra* x = d->topData(); | - |
2072 | if (x->basew == basew && x->baseh == baseh) never evaluated: x->basew == basew never evaluated: x->baseh == baseh | 0 |
2073 | return; | 0 |
2074 | x->basew = basew; | - |
2075 | x->baseh = baseh; | - |
2076 | if (isWindow()) never evaluated: isWindow() | 0 |
2077 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 |
2078 | } | 0 |
2079 | void QWidget::setFixedSize(const QSize & s) | - |
2080 | { | - |
2081 | setFixedSize(s.width(), s.height()); | - |
2082 | } executed: } Execution Count:1295 | 1295 |
2083 | void QWidget::setFixedSize(int w, int h) | - |
2084 | { | - |
2085 | QWidgetPrivate * const d = d_func(); | - |
2086 | bool minSizeSet = d->setMinimumSize_helper(w, h); | - |
2087 | bool maxSizeSet = d->setMaximumSize_helper(w, h); | - |
2088 | if (!minSizeSet && !maxSizeSet) evaluated: !minSizeSet yes Evaluation Count:118 | yes Evaluation Count:2145 |
partially evaluated: !maxSizeSet yes Evaluation Count:118 | no Evaluation Count:0 |
| 0-2145 |
2089 | return; executed: return; Execution Count:118 | 118 |
2090 | | - |
2091 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:993 | yes Evaluation Count:1152 |
| 993-1152 |
2092 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:993 | 993 |
2093 | else | - |
2094 | d->updateGeometry_helper(true); executed: d->updateGeometry_helper(true); Execution Count:1152 | 1152 |
2095 | | - |
2096 | if (w != ((1<<24)-1) || h != ((1<<24)-1)) partially evaluated: w != ((1<<24)-1) yes Evaluation Count:2145 | no Evaluation Count:0 |
never evaluated: h != ((1<<24)-1) | 0-2145 |
2097 | resize(w, h); executed: resize(w, h); Execution Count:2145 | 2145 |
2098 | } executed: } Execution Count:2145 | 2145 |
2099 | | - |
2100 | void QWidget::setMinimumWidth(int w) | - |
2101 | { | - |
2102 | QWidgetPrivate * const d = d_func(); | - |
2103 | d->createExtra(); | - |
2104 | uint expl = d->extra->explicitMinSize | (w ? Qt::Horizontal : 0); | - |
2105 | setMinimumSize(w, minimumSize().height()); | - |
2106 | d->extra->explicitMinSize = expl; | - |
2107 | } executed: } Execution Count:1723 | 1723 |
2108 | | - |
2109 | void QWidget::setMinimumHeight(int h) | - |
2110 | { | - |
2111 | QWidgetPrivate * const d = d_func(); | - |
2112 | d->createExtra(); | - |
2113 | uint expl = d->extra->explicitMinSize | (h ? Qt::Vertical : 0); | - |
2114 | setMinimumSize(minimumSize().width(), h); | - |
2115 | d->extra->explicitMinSize = expl; | - |
2116 | } executed: } Execution Count:478 | 478 |
2117 | | - |
2118 | void QWidget::setMaximumWidth(int w) | - |
2119 | { | - |
2120 | QWidgetPrivate * const d = d_func(); | - |
2121 | d->createExtra(); | - |
2122 | uint expl = d->extra->explicitMaxSize | (w == ((1<<24)-1) ? 0 : Qt::Horizontal); | - |
2123 | setMaximumSize(w, maximumSize().height()); | - |
2124 | d->extra->explicitMaxSize = expl; | - |
2125 | } executed: } Execution Count:528 | 528 |
2126 | | - |
2127 | void QWidget::setMaximumHeight(int h) | - |
2128 | { | - |
2129 | QWidgetPrivate * const d = d_func(); | - |
2130 | d->createExtra(); | - |
2131 | uint expl = d->extra->explicitMaxSize | (h == ((1<<24)-1) ? 0 : Qt::Vertical); | - |
2132 | setMaximumSize(maximumSize().width(), h); | - |
2133 | d->extra->explicitMaxSize = expl; | - |
2134 | } executed: } Execution Count:448 | 448 |
2135 | void QWidget::setFixedWidth(int w) | - |
2136 | { | - |
2137 | QWidgetPrivate * const d = d_func(); | - |
2138 | d->createExtra(); | - |
2139 | uint explMin = d->extra->explicitMinSize | Qt::Horizontal; | - |
2140 | uint explMax = d->extra->explicitMaxSize | Qt::Horizontal; | - |
2141 | setMinimumSize(w, minimumSize().height()); | - |
2142 | setMaximumSize(w, maximumSize().height()); | - |
2143 | d->extra->explicitMinSize = explMin; | - |
2144 | d->extra->explicitMaxSize = explMax; | - |
2145 | } executed: } Execution Count:6 | 6 |
2146 | void QWidget::setFixedHeight(int h) | - |
2147 | { | - |
2148 | QWidgetPrivate * const d = d_func(); | - |
2149 | d->createExtra(); | - |
2150 | uint explMin = d->extra->explicitMinSize | Qt::Vertical; | - |
2151 | uint explMax = d->extra->explicitMaxSize | Qt::Vertical; | - |
2152 | setMinimumSize(minimumSize().width(), h); | - |
2153 | setMaximumSize(maximumSize().width(), h); | - |
2154 | d->extra->explicitMinSize = explMin; | - |
2155 | d->extra->explicitMaxSize = explMax; | - |
2156 | } executed: } Execution Count:83 | 83 |
2157 | QPoint QWidget::mapTo(const QWidget * parent, const QPoint & pos) const | - |
2158 | { | - |
2159 | QPoint p = pos; | - |
2160 | if (parent) { partially evaluated: parent yes Evaluation Count:173505 | no Evaluation Count:0 |
| 0-173505 |
2161 | const QWidget * w = this; | - |
2162 | while (w != parent) { evaluated: w != parent yes Evaluation Count:233280 | yes Evaluation Count:173505 |
| 173505-233280 |
2163 | qt_noop(); | - |
2164 | | - |
2165 | p = w->mapToParent(p); | - |
2166 | w = w->parentWidget(); | - |
2167 | } executed: } Execution Count:233280 | 233280 |
2168 | } executed: } Execution Count:173505 | 173505 |
2169 | return p; executed: return p; Execution Count:173505 | 173505 |
2170 | } | - |
2171 | QPoint QWidget::mapFrom(const QWidget * parent, const QPoint & pos) const | - |
2172 | { | - |
2173 | QPoint p(pos); | - |
2174 | if (parent) { partially evaluated: parent yes Evaluation Count:478 | no Evaluation Count:0 |
| 0-478 |
2175 | const QWidget * w = this; | - |
2176 | while (w != parent) { evaluated: w != parent yes Evaluation Count:924 | yes Evaluation Count:478 |
| 478-924 |
2177 | qt_noop(); | - |
2178 | | - |
2179 | | - |
2180 | p = w->mapFromParent(p); | - |
2181 | w = w->parentWidget(); | - |
2182 | } executed: } Execution Count:924 | 924 |
2183 | } executed: } Execution Count:478 | 478 |
2184 | return p; executed: return p; Execution Count:478 | 478 |
2185 | } | - |
2186 | QPoint QWidget::mapToParent(const QPoint &pos) const | - |
2187 | { | - |
2188 | return pos + data->crect.topLeft(); executed: return pos + data->crect.topLeft(); Execution Count:234794 | 234794 |
2189 | } | - |
2190 | QPoint QWidget::mapFromParent(const QPoint &pos) const | - |
2191 | { | - |
2192 | return pos - data->crect.topLeft(); executed: return pos - data->crect.topLeft(); Execution Count:2082 | 2082 |
2193 | } | - |
2194 | QWidget *QWidget::window() const | - |
2195 | { | - |
2196 | QWidget *w = (QWidget *)this; | - |
2197 | QWidget *p = w->parentWidget(); | - |
2198 | while (!w->isWindow() && p) { evaluated: !w->isWindow() yes Evaluation Count:2754977 | yes Evaluation Count:2280468 |
evaluated: p yes Evaluation Count:2681019 | yes Evaluation Count:73958 |
| 73958-2754977 |
2199 | w = p; | - |
2200 | p = p->parentWidget(); | - |
2201 | } executed: } Execution Count:2681019 | 2681019 |
2202 | return w; executed: return w; Execution Count:2354426 | 2354426 |
2203 | } | - |
2204 | QWidget *QWidget::nativeParentWidget() const | - |
2205 | { | - |
2206 | QWidget *parent = parentWidget(); | - |
2207 | while (parent && !parent->internalWinId()) evaluated: parent yes Evaluation Count:44872 | yes Evaluation Count:2546 |
evaluated: !parent->internalWinId() yes Evaluation Count:18451 | yes Evaluation Count:26421 |
| 2546-44872 |
2208 | parent = parent->parentWidget(); executed: parent = parent->parentWidget(); Execution Count:18451 | 18451 |
2209 | return parent; executed: return parent; Execution Count:28967 | 28967 |
2210 | } | - |
2211 | QPalette::ColorRole QWidget::backgroundRole() const | - |
2212 | { | - |
2213 | | - |
2214 | const QWidget *w = this; | - |
2215 | do { | - |
2216 | QPalette::ColorRole role = w->d_func()->bg_role; | - |
2217 | if (role != QPalette::NoRole) evaluated: role != QPalette::NoRole yes Evaluation Count:59568 | yes Evaluation Count:53329 |
| 53329-59568 |
2218 | return role; executed: return role; Execution Count:59568 | 59568 |
2219 | if (w->isWindow() || w->windowType() == Qt::SubWindow) evaluated: w->isWindow() yes Evaluation Count:19144 | yes Evaluation Count:34185 |
partially evaluated: w->windowType() == Qt::SubWindow no Evaluation Count:0 | yes Evaluation Count:34185 |
| 0-34185 |
2220 | break; executed: break; Execution Count:19144 | 19144 |
2221 | w = w->parentWidget(); | - |
2222 | } while (w); partially evaluated: w yes Evaluation Count:34185 | no Evaluation Count:0 |
executed: } Execution Count:34185 | 0-34185 |
2223 | return QPalette::Window; executed: return QPalette::Window; Execution Count:19144 | 19144 |
2224 | } | - |
2225 | void QWidget::setBackgroundRole(QPalette::ColorRole role) | - |
2226 | { | - |
2227 | QWidgetPrivate * const d = d_func(); | - |
2228 | d->bg_role = role; | - |
2229 | d->updateSystemBackground(); | - |
2230 | d->propagatePaletteChange(); | - |
2231 | d->updateIsOpaque(); | - |
2232 | } executed: } Execution Count:17372 | 17372 |
2233 | QPalette::ColorRole QWidget::foregroundRole() const | - |
2234 | { | - |
2235 | const QWidgetPrivate * const d = d_func(); | - |
2236 | QPalette::ColorRole rl = QPalette::ColorRole(d->fg_role); | - |
2237 | if (rl != QPalette::NoRole) evaluated: rl != QPalette::NoRole yes Evaluation Count:1593 | yes Evaluation Count:25069 |
| 1593-25069 |
2238 | return rl; executed: return rl; Execution Count:1593 | 1593 |
2239 | QPalette::ColorRole role = QPalette::WindowText; | - |
2240 | switch (backgroundRole()) { | - |
2241 | case QPalette::Button: | - |
2242 | role = QPalette::ButtonText; | - |
2243 | break; executed: break; Execution Count:1747 | 1747 |
2244 | case QPalette::Base: | - |
2245 | role = QPalette::Text; | - |
2246 | break; executed: break; Execution Count:14280 | 14280 |
2247 | case QPalette::Dark: | - |
2248 | case QPalette::Shadow: | - |
2249 | role = QPalette::Light; | - |
2250 | break; | 0 |
2251 | case QPalette::Highlight: | - |
2252 | role = QPalette::HighlightedText; | - |
2253 | break; executed: break; Execution Count:84 | 84 |
2254 | case QPalette::ToolTipBase: | - |
2255 | role = QPalette::ToolTipText; | - |
2256 | break; | 0 |
2257 | default: | - |
2258 | ; | - |
2259 | } executed: } Execution Count:8958 | 8958 |
2260 | return role; executed: return role; Execution Count:25069 | 25069 |
2261 | } | - |
2262 | void QWidget::setForegroundRole(QPalette::ColorRole role) | - |
2263 | { | - |
2264 | QWidgetPrivate * const d = d_func(); | - |
2265 | d->fg_role = role; | - |
2266 | d->updateSystemBackground(); | - |
2267 | d->propagatePaletteChange(); | - |
2268 | } executed: } Execution Count:4060 | 4060 |
2269 | const QPalette &QWidget::palette() const | - |
2270 | { | - |
2271 | if (!isEnabled()) { evaluated: !isEnabled() yes Evaluation Count:1392 | yes Evaluation Count:532929 |
| 1392-532929 |
2272 | data->pal.setCurrentColorGroup(QPalette::Disabled); | - |
2273 | } else if ((!isVisible() || isActiveWindow()) evaluated: !isVisible() yes Evaluation Count:356466 | yes Evaluation Count:176463 |
evaluated: isActiveWindow() yes Evaluation Count:97357 | yes Evaluation Count:79106 |
executed: } Execution Count:1392 | 1392-356466 |
2274 | | - |
2275 | | - |
2276 | | - |
2277 | ) { | - |
2278 | data->pal.setCurrentColorGroup(QPalette::Active); | - |
2279 | } else { executed: } Execution Count:453823 | 453823 |
2280 | | - |
2281 | | - |
2282 | | - |
2283 | | - |
2284 | | - |
2285 | | - |
2286 | data->pal.setCurrentColorGroup(QPalette::Inactive); | - |
2287 | } executed: } Execution Count:79106 | 79106 |
2288 | return data->pal; executed: return data->pal; Execution Count:534321 | 534321 |
2289 | } | - |
2290 | | - |
2291 | void QWidget::setPalette(const QPalette &palette) | - |
2292 | { | - |
2293 | QWidgetPrivate * const d = d_func(); | - |
2294 | setAttribute(Qt::WA_SetPalette, palette.resolve() != 0); | - |
2295 | | - |
2296 | | - |
2297 | | - |
2298 | | - |
2299 | | - |
2300 | QPalette naturalPalette = d->naturalWidgetPalette(d->inheritedPaletteResolveMask); | - |
2301 | QPalette resolvedPalette = palette.resolve(naturalPalette); | - |
2302 | d->setPalette_helper(resolvedPalette); | - |
2303 | } executed: } Execution Count:3188 | 3188 |
2304 | QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const | - |
2305 | { | - |
2306 | const QWidget * const q = q_func(); | - |
2307 | QPalette naturalPalette = QApplication::palette(q); | - |
2308 | if (!q->testAttribute(Qt::WA_StyleSheet) evaluated: !q->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:45800 | yes Evaluation Count:1971 |
| 1971-45800 |
2309 | && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) evaluated: !q->isWindow() yes Evaluation Count:43564 | yes Evaluation Count:2236 |
evaluated: q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:682 | yes Evaluation Count:1554 |
| 682-43564 |
2310 | | - |
2311 | || (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:415 | yes Evaluation Count:1139 |
evaluated: extra->proxyWidget yes Evaluation Count:21 | yes Evaluation Count:394 |
| 21-1139 |
2312 | | - |
2313 | )) { | - |
2314 | if (QWidget *p = q->parentWidget()) { evaluated: QWidget *p = q->parentWidget() yes Evaluation Count:44246 | yes Evaluation Count:21 |
| 21-44246 |
2315 | if (!p->testAttribute(Qt::WA_StyleSheet)) { evaluated: !p->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:43855 | yes Evaluation Count:391 |
| 391-43855 |
2316 | if (!naturalPalette.isCopyOf(QApplication::palette())) { evaluated: !naturalPalette.isCopyOf(QApplication::palette()) yes Evaluation Count:4 | yes Evaluation Count:43851 |
| 4-43851 |
2317 | QPalette inheritedPalette = p->palette(); | - |
2318 | inheritedPalette.resolve(inheritedMask); | - |
2319 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - |
2320 | } else { executed: } Execution Count:4 | 4 |
2321 | naturalPalette = p->palette(); | - |
2322 | } executed: } Execution Count:43851 | 43851 |
2323 | } | - |
2324 | } executed: } Execution Count:44246 | 44246 |
2325 | | - |
2326 | else if (extra && extra->proxyWidget) { partially evaluated: extra yes Evaluation Count:21 | no Evaluation Count:0 |
partially evaluated: extra->proxyWidget yes Evaluation Count:21 | no Evaluation Count:0 |
| 0-21 |
2327 | QPalette inheritedPalette = extra->proxyWidget->palette(); | - |
2328 | inheritedPalette.resolve(inheritedMask); | - |
2329 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - |
2330 | } executed: } Execution Count:21 | 21 |
2331 | | - |
2332 | } | - |
2333 | naturalPalette.resolve(0); | - |
2334 | return naturalPalette; executed: return naturalPalette; Execution Count:47771 | 47771 |
2335 | } | - |
2336 | void QWidgetPrivate::resolvePalette() | - |
2337 | { | - |
2338 | QPalette naturalPalette = naturalWidgetPalette(inheritedPaletteResolveMask); | - |
2339 | QPalette resolvedPalette = data.pal.resolve(naturalPalette); | - |
2340 | setPalette_helper(resolvedPalette); | - |
2341 | } executed: } Execution Count:44583 | 44583 |
2342 | | - |
2343 | void QWidgetPrivate::setPalette_helper(const QPalette &palette) | - |
2344 | { | - |
2345 | QWidget * const q = q_func(); | - |
2346 | if (data.pal == palette && data.pal.resolve() == palette.resolve()) evaluated: data.pal == palette yes Evaluation Count:47500 | yes Evaluation Count:271 |
evaluated: data.pal.resolve() == palette.resolve() yes Evaluation Count:47487 | yes Evaluation Count:13 |
| 13-47500 |
2347 | return; executed: return; Execution Count:47487 | 47487 |
2348 | data.pal = palette; | - |
2349 | updateSystemBackground(); | - |
2350 | propagatePaletteChange(); | - |
2351 | updateIsOpaque(); | - |
2352 | q->update(); | - |
2353 | updateIsOpaque(); | - |
2354 | } executed: } Execution Count:284 | 284 |
2355 | void QWidget::setFont(const QFont &font) | - |
2356 | { | - |
2357 | QWidgetPrivate * const d = d_func(); | - |
2358 | | - |
2359 | | - |
2360 | const QStyleSheetStyle* style; | - |
2361 | if (d->extra && (style = qobject_cast<const QStyleSheetStyle*>(d->extra->style))) { evaluated: d->extra yes Evaluation Count:390 | yes Evaluation Count:93 |
partially evaluated: (style = qobject_cast<const QStyleSheetStyle*>(d->extra->style)) no Evaluation Count:0 | yes Evaluation Count:390 |
| 0-390 |
2362 | style->saveWidgetFont(this, font); | - |
2363 | } | 0 |
2364 | | - |
2365 | | - |
2366 | setAttribute(Qt::WA_SetFont, font.resolve() != 0); | - |
2367 | | - |
2368 | | - |
2369 | | - |
2370 | | - |
2371 | | - |
2372 | QFont naturalFont = d->naturalWidgetFont(d->inheritedFontResolveMask); | - |
2373 | QFont resolvedFont = font.resolve(naturalFont); | - |
2374 | d->setFont_helper(resolvedFont); | - |
2375 | } executed: } Execution Count:483 | 483 |
2376 | QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const | - |
2377 | { | - |
2378 | const QWidget * const q = q_func(); | - |
2379 | QFont naturalFont = QApplication::font(q); | - |
2380 | if (!q->testAttribute(Qt::WA_StyleSheet) evaluated: !q->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:42530 | yes Evaluation Count:16 |
| 16-42530 |
2381 | && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) evaluated: !q->isWindow() yes Evaluation Count:40674 | yes Evaluation Count:1856 |
evaluated: q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:343 | yes Evaluation Count:1513 |
| 343-40674 |
2382 | | - |
2383 | || (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:400 | yes Evaluation Count:1113 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:400 |
| 0-1113 |
2384 | | - |
2385 | )) { | - |
2386 | if (QWidget *p = q->parentWidget()) { partially evaluated: QWidget *p = q->parentWidget() yes Evaluation Count:41017 | no Evaluation Count:0 |
| 0-41017 |
2387 | if (!p->testAttribute(Qt::WA_StyleSheet)) { evaluated: !p->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:41013 | yes Evaluation Count:4 |
| 4-41013 |
2388 | if (!naturalFont.isCopyOf(QApplication::font())) { evaluated: !naturalFont.isCopyOf(QApplication::font()) yes Evaluation Count:4 | yes Evaluation Count:41009 |
| 4-41009 |
2389 | QFont inheritedFont = p->font(); | - |
2390 | inheritedFont.resolve(inheritedMask); | - |
2391 | naturalFont = inheritedFont.resolve(naturalFont); | - |
2392 | } else { executed: } Execution Count:4 | 4 |
2393 | naturalFont = p->font(); | - |
2394 | } executed: } Execution Count:41009 | 41009 |
2395 | } | - |
2396 | } executed: } Execution Count:41017 | 41017 |
2397 | | - |
2398 | else if (extra && extra->proxyWidget) { never evaluated: extra->proxyWidget | 0 |
2399 | QFont inheritedFont = extra->proxyWidget->font(); | - |
2400 | inheritedFont.resolve(inheritedMask); | - |
2401 | naturalFont = inheritedFont.resolve(naturalFont); | - |
2402 | } | 0 |
2403 | | - |
2404 | } | - |
2405 | naturalFont.resolve(0); | - |
2406 | return naturalFont; executed: return naturalFont; Execution Count:42546 | 42546 |
2407 | } | - |
2408 | void QWidgetPrivate::resolveFont() | - |
2409 | { | - |
2410 | QFont naturalFont = naturalWidgetFont(inheritedFontResolveMask); | - |
2411 | QFont resolvedFont = data.fnt.resolve(naturalFont); | - |
2412 | setFont_helper(resolvedFont); | - |
2413 | } executed: } Execution Count:42063 | 42063 |
2414 | void QWidgetPrivate::updateFont(const QFont &font) | - |
2415 | { | - |
2416 | QWidget * const q = q_func(); | - |
2417 | | - |
2418 | const QStyleSheetStyle* cssStyle; | - |
2419 | cssStyle = extra ? qobject_cast<const QStyleSheetStyle*>(extra->style) : 0; evaluated: extra yes Evaluation Count:143 | yes Evaluation Count:264 |
| 143-264 |
2420 | | - |
2421 | | - |
2422 | data.fnt = QFont(font, q); | - |
2423 | | - |
2424 | | - |
2425 | | - |
2426 | | - |
2427 | | - |
2428 | | - |
2429 | if (!q->parentWidget() && extra && extra->proxyWidget) { evaluated: !q->parentWidget() yes Evaluation Count:35 | yes Evaluation Count:372 |
evaluated: extra yes Evaluation Count:22 | yes Evaluation Count:13 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-372 |
2430 | QGraphicsProxyWidget *p = extra->proxyWidget; | - |
2431 | inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve(); | - |
2432 | } else | 0 |
2433 | | - |
2434 | if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { evaluated: q->isWindow() yes Evaluation Count:35 | yes Evaluation Count:372 |
partially evaluated: !q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:35 | no Evaluation Count:0 |
| 0-372 |
2435 | inheritedFontResolveMask = 0; | - |
2436 | } executed: } Execution Count:35 | 35 |
2437 | uint newMask = data.fnt.resolve() | inheritedFontResolveMask; | - |
2438 | | - |
2439 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:335 | yes Evaluation Count:407 |
| 335-407 |
2440 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
2441 | if (w) { evaluated: w yes Evaluation Count:192 | yes Evaluation Count:143 |
| 143-192 |
2442 | if (0) { partially evaluated: 0 no Evaluation Count:0 | yes Evaluation Count:192 |
| 0-192 |
2443 | | - |
2444 | } else if (w->testAttribute(Qt::WA_StyleSheet)) { evaluated: w->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:8 | yes Evaluation Count:184 |
| 0-184 |
2445 | | - |
2446 | if (cssStyle) partially evaluated: cssStyle no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2447 | cssStyle->updateStyleSheetFont(w); never executed: cssStyle->updateStyleSheetFont(w); | 0 |
2448 | | - |
2449 | } else if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))) { evaluated: !w->isWindow() yes Evaluation Count:157 | yes Evaluation Count:27 |
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation) no Evaluation Count:0 | yes Evaluation Count:27 |
executed: } Execution Count:8 | 0-157 |
2450 | | - |
2451 | QWidgetPrivate *wd = w->d_func(); | - |
2452 | wd->inheritedFontResolveMask = newMask; | - |
2453 | wd->resolveFont(); | - |
2454 | } executed: } Execution Count:157 | 157 |
2455 | } | - |
2456 | } executed: } Execution Count:335 | 335 |
2457 | | - |
2458 | | - |
2459 | if (cssStyle) { partially evaluated: cssStyle no Evaluation Count:0 | yes Evaluation Count:407 |
| 0-407 |
2460 | cssStyle->updateStyleSheetFont(q); | - |
2461 | } | 0 |
2462 | | - |
2463 | | - |
2464 | QEvent e(QEvent::FontChange); | - |
2465 | QApplication::sendEvent(q, &e); | - |
2466 | } executed: } Execution Count:407 | 407 |
2467 | | - |
2468 | void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction) | - |
2469 | { | - |
2470 | QWidget * const q = q_func(); | - |
2471 | | - |
2472 | if ( (direction == Qt::RightToLeft) == q->testAttribute(Qt::WA_RightToLeft)) evaluated: (direction == Qt::RightToLeft) == q->testAttribute(Qt::WA_RightToLeft) yes Evaluation Count:50321 | yes Evaluation Count:425 |
| 425-50321 |
2473 | return; executed: return; Execution Count:50321 | 50321 |
2474 | q->setAttribute(Qt::WA_RightToLeft, (direction == Qt::RightToLeft)); | - |
2475 | if (!children.isEmpty()) { evaluated: !children.isEmpty() yes Evaluation Count:273 | yes Evaluation Count:152 |
| 152-273 |
2476 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:1164 | yes Evaluation Count:273 |
| 273-1164 |
2477 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
2478 | if (w && !w->isWindow() && !w->testAttribute(Qt::WA_SetLayoutDirection)) evaluated: w yes Evaluation Count:359 | yes Evaluation Count:805 |
evaluated: !w->isWindow() yes Evaluation Count:226 | yes Evaluation Count:133 |
evaluated: !w->testAttribute(Qt::WA_SetLayoutDirection) yes Evaluation Count:225 | yes Evaluation Count:1 |
| 1-805 |
2479 | w->d_func()->setLayoutDirection_helper(direction); executed: w->d_func()->setLayoutDirection_helper(direction); Execution Count:225 | 225 |
2480 | } executed: } Execution Count:1164 | 1164 |
2481 | } executed: } Execution Count:273 | 273 |
2482 | QEvent e(QEvent::LayoutDirectionChange); | - |
2483 | QApplication::sendEvent(q, &e); | - |
2484 | } executed: } Execution Count:425 | 425 |
2485 | | - |
2486 | void QWidgetPrivate::resolveLayoutDirection() | - |
2487 | { | - |
2488 | const QWidget * const q = q_func(); | - |
2489 | if (!q->testAttribute(Qt::WA_SetLayoutDirection)) partially evaluated: !q->testAttribute(Qt::WA_SetLayoutDirection) yes Evaluation Count:49548 | no Evaluation Count:0 |
| 0-49548 |
2490 | setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); executed: setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); Execution Count:49548 | 49548 |
2491 | } executed: } Execution Count:49548 | 49548 |
2492 | void QWidget::setLayoutDirection(Qt::LayoutDirection direction) | - |
2493 | { | - |
2494 | QWidgetPrivate * const d = d_func(); | - |
2495 | | - |
2496 | if (direction == Qt::LayoutDirectionAuto) { partially evaluated: direction == Qt::LayoutDirectionAuto no Evaluation Count:0 | yes Evaluation Count:678 |
| 0-678 |
2497 | unsetLayoutDirection(); | - |
2498 | return; | 0 |
2499 | } | - |
2500 | | - |
2501 | setAttribute(Qt::WA_SetLayoutDirection); | - |
2502 | d->setLayoutDirection_helper(direction); | - |
2503 | } executed: } Execution Count:678 | 678 |
2504 | | - |
2505 | Qt::LayoutDirection QWidget::layoutDirection() const | - |
2506 | { | - |
2507 | return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight; executed: return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight; Execution Count:648267 | 648267 |
2508 | } | - |
2509 | | - |
2510 | void QWidget::unsetLayoutDirection() | - |
2511 | { | - |
2512 | QWidgetPrivate * const d = d_func(); | - |
2513 | setAttribute(Qt::WA_SetLayoutDirection, false); | - |
2514 | d->resolveLayoutDirection(); | - |
2515 | } executed: } Execution Count:2 | 2 |
2516 | QCursor QWidget::cursor() const | - |
2517 | { | - |
2518 | const QWidgetPrivate * const d = d_func(); | - |
2519 | if (testAttribute(Qt::WA_SetCursor)) evaluated: testAttribute(Qt::WA_SetCursor) yes Evaluation Count:341 | yes Evaluation Count:3530 |
| 341-3530 |
2520 | return (d->extra && d->extra->curs) | 341 |
2521 | ? *d->extra->curs | 341 |
2522 | : QCursor(Qt::ArrowCursor); executed: return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor); Execution Count:341 | 341 |
2523 | if (isWindow() || !parentWidget()) evaluated: isWindow() yes Evaluation Count:3513 | yes Evaluation Count:17 |
partially evaluated: !parentWidget() no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-3513 |
2524 | return QCursor(Qt::ArrowCursor); executed: return QCursor(Qt::ArrowCursor); Execution Count:3513 | 3513 |
2525 | return parentWidget()->cursor(); executed: return parentWidget()->cursor(); Execution Count:17 | 17 |
2526 | } | - |
2527 | | - |
2528 | void QWidget::setCursor(const QCursor &cursor) | - |
2529 | { | - |
2530 | QWidgetPrivate * const d = d_func(); | - |
2531 | | - |
2532 | | - |
2533 | if (cursor.shape() != Qt::ArrowCursor evaluated: cursor.shape() != Qt::ArrowCursor yes Evaluation Count:2486 | yes Evaluation Count:163 |
| 163-2486 |
2534 | || (d->extra && d->extra->curs)) evaluated: d->extra yes Evaluation Count:73 | yes Evaluation Count:90 |
evaluated: d->extra->curs yes Evaluation Count:49 | yes Evaluation Count:24 |
| 24-90 |
2535 | | - |
2536 | { | - |
2537 | d->createExtra(); | - |
2538 | QCursor *newCursor = new QCursor(cursor); | - |
2539 | delete d->extra->curs; | - |
2540 | d->extra->curs = newCursor; | - |
2541 | } executed: } Execution Count:2535 | 2535 |
2542 | setAttribute(Qt::WA_SetCursor); | - |
2543 | d->setCursor_sys(cursor); | - |
2544 | | - |
2545 | QEvent event(QEvent::CursorChange); | - |
2546 | QApplication::sendEvent(this, &event); | - |
2547 | } executed: } Execution Count:2649 | 2649 |
2548 | | - |
2549 | void QWidget::unsetCursor() | - |
2550 | { | - |
2551 | QWidgetPrivate * const d = d_func(); | - |
2552 | if (d->extra) { evaluated: d->extra yes Evaluation Count:118 | yes Evaluation Count:20 |
| 20-118 |
2553 | delete d->extra->curs; | - |
2554 | d->extra->curs = 0; | - |
2555 | } executed: } Execution Count:118 | 118 |
2556 | if (!isWindow()) evaluated: !isWindow() yes Evaluation Count:68 | yes Evaluation Count:70 |
| 68-70 |
2557 | setAttribute(Qt::WA_SetCursor, false); executed: setAttribute(Qt::WA_SetCursor, false); Execution Count:68 | 68 |
2558 | d->unsetCursor_sys(); | - |
2559 | | - |
2560 | QEvent event(QEvent::CursorChange); | - |
2561 | QApplication::sendEvent(this, &event); | - |
2562 | } executed: } Execution Count:138 | 138 |
2563 | void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, | - |
2564 | const QRegion &sourceRegion, RenderFlags renderFlags) | - |
2565 | { | - |
2566 | d_func()->render(target, targetOffset, sourceRegion, renderFlags, false); | - |
2567 | } executed: } Execution Count:90 | 90 |
2568 | void QWidget::render(QPainter *painter, const QPoint &targetOffset, | - |
2569 | const QRegion &sourceRegion, RenderFlags renderFlags) | - |
2570 | { | - |
2571 | if (!painter) { partially evaluated: !painter no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
2572 | QMessageLogger("kernel/qwidget.cpp", 4680, __PRETTY_FUNCTION__).warning("QWidget::render: Null pointer to painter"); | - |
2573 | return; | 0 |
2574 | } | - |
2575 | | - |
2576 | if (!painter->isActive()) { partially evaluated: !painter->isActive() no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
2577 | QMessageLogger("kernel/qwidget.cpp", 4685, __PRETTY_FUNCTION__).warning("QWidget::render: Cannot render with an inactive painter"); | - |
2578 | return; | 0 |
2579 | } | - |
2580 | | - |
2581 | const qreal opacity = painter->opacity(); | - |
2582 | if (qFuzzyIsNull(opacity)) partially evaluated: qFuzzyIsNull(opacity) no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
2583 | return; | 0 |
2584 | | - |
2585 | QWidgetPrivate * const d = d_func(); | - |
2586 | const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter; evaluated: d->extra yes Evaluation Count:24 | yes Evaluation Count:2 |
partially evaluated: d->extra->inRenderWithPainter no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
2587 | const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags) partially evaluated: !inRenderWithPainter yes Evaluation Count:26 | no Evaluation Count:0 |
| 0-26 |
2588 | : sourceRegion; | - |
2589 | if (toBePainted.isEmpty()) partially evaluated: toBePainted.isEmpty() no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
2590 | return; | 0 |
2591 | | - |
2592 | if (!d->extra) partially evaluated: !d->extra no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
2593 | d->createExtra(); never executed: d->createExtra(); | 0 |
2594 | d->extra->inRenderWithPainter = true; | - |
2595 | | - |
2596 | | - |
2597 | | - |
2598 | | - |
2599 | QPaintEngine *engine = painter->paintEngine(); | - |
2600 | qt_noop(); | - |
2601 | QPaintEnginePrivate *enginePriv = engine->d_func(); | - |
2602 | qt_noop(); | - |
2603 | QPaintDevice *target = engine->paintDevice(); | - |
2604 | qt_noop(); | - |
2605 | | - |
2606 | | - |
2607 | if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) { partially evaluated: !inRenderWithPainter yes Evaluation Count:26 | no Evaluation Count:0 |
evaluated: opacity < 1.0 yes Evaluation Count:2 | yes Evaluation Count:24 |
partially evaluated: (target->devType() == QInternal::Printer) no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-26 |
2608 | d->render_helper(painter, targetOffset, toBePainted, renderFlags); | - |
2609 | d->extra->inRenderWithPainter = false; | - |
2610 | return; executed: return; Execution Count:2 | 2 |
2611 | } | - |
2612 | | - |
2613 | | - |
2614 | QPainter *oldPainter = d->sharedPainter(); | - |
2615 | d->setSharedPainter(painter); | - |
2616 | | - |
2617 | | - |
2618 | const QTransform oldTransform = enginePriv->systemTransform; | - |
2619 | const QRegion oldSystemClip = enginePriv->systemClip; | - |
2620 | const QRegion oldSystemViewport = enginePriv->systemViewport; | - |
2621 | | - |
2622 | | - |
2623 | if (painter->hasClipping()) { evaluated: painter->hasClipping() yes Evaluation Count:2 | yes Evaluation Count:22 |
| 2-22 |
2624 | const QRegion painterClip = painter->deviceTransform().map(painter->clipRegion()); | - |
2625 | enginePriv->setSystemViewport(oldSystemClip.isEmpty() ? painterClip : oldSystemClip & painterClip); | - |
2626 | } else { executed: } Execution Count:2 | 2 |
2627 | enginePriv->setSystemViewport(oldSystemClip); | - |
2628 | } executed: } Execution Count:22 | 22 |
2629 | | - |
2630 | render(target, targetOffset, toBePainted, renderFlags); | - |
2631 | | - |
2632 | | - |
2633 | enginePriv->systemClip = oldSystemClip; | - |
2634 | enginePriv->setSystemViewport(oldSystemViewport); | - |
2635 | enginePriv->setSystemTransform(oldTransform); | - |
2636 | | - |
2637 | | - |
2638 | d->setSharedPainter(oldPainter); | - |
2639 | | - |
2640 | | - |
2641 | d->extra->inRenderWithPainter = false; | - |
2642 | } executed: } Execution Count:24 | 24 |
2643 | | - |
2644 | static void sendResizeEvents(QWidget *target) | - |
2645 | { | - |
2646 | QResizeEvent e(target->size(), QSize()); | - |
2647 | QApplication::sendEvent(target, &e); | - |
2648 | | - |
2649 | const QObjectList children = target->children(); | - |
2650 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:73 | yes Evaluation Count:64 |
| 64-73 |
2651 | QWidget *child = static_cast<QWidget*>(children.at(i)); | - |
2652 | if (child->isWidgetType() && !child->isWindow() && child->testAttribute(Qt::WA_PendingResizeEvent)) evaluated: child->isWidgetType() yes Evaluation Count:56 | yes Evaluation Count:17 |
partially evaluated: !child->isWindow() yes Evaluation Count:56 | no Evaluation Count:0 |
evaluated: child->testAttribute(Qt::WA_PendingResizeEvent) yes Evaluation Count:55 | yes Evaluation Count:1 |
| 0-56 |
2653 | sendResizeEvents(child); executed: sendResizeEvents(child); Execution Count:55 | 55 |
2654 | } executed: } Execution Count:73 | 73 |
2655 | } executed: } Execution Count:64 | 64 |
2656 | QPixmap QWidget::grab(const QRect &rectangle) | - |
2657 | { | - |
2658 | QWidgetPrivate * const d = d_func(); | - |
2659 | if (testAttribute(Qt::WA_PendingResizeEvent) || !testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_PendingResizeEvent) yes Evaluation Count:6 | yes Evaluation Count:48 |
evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:3 | yes Evaluation Count:45 |
| 3-48 |
2660 | sendResizeEvents(this); executed: sendResizeEvents(this); Execution Count:9 | 9 |
2661 | | - |
2662 | const QWidget::RenderFlags renderFlags = QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask; | - |
2663 | | - |
2664 | const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren; | - |
2665 | QRect r(rectangle); | - |
2666 | if (r.width() < 0 || r.height() < 0) { evaluated: r.width() < 0 yes Evaluation Count:47 | yes Evaluation Count:7 |
partially evaluated: r.height() < 0 no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-47 |
2667 | | - |
2668 | | - |
2669 | r = d->prepareToRender(QRegion(), renderFlags).boundingRect(); | - |
2670 | r.setTopLeft(rectangle.topLeft()); | - |
2671 | } executed: } Execution Count:47 | 47 |
2672 | | - |
2673 | if (!r.intersects(rect())) evaluated: !r.intersects(rect()) yes Evaluation Count:4 | yes Evaluation Count:50 |
| 4-50 |
2674 | return QPixmap(); executed: return QPixmap(); Execution Count:4 | 4 |
2675 | | - |
2676 | QPixmap res(r.size()); | - |
2677 | if (!d->isOpaque) evaluated: !d->isOpaque yes Evaluation Count:5 | yes Evaluation Count:45 |
| 5-45 |
2678 | res.fill(Qt::transparent); executed: res.fill(Qt::transparent); Execution Count:5 | 5 |
2679 | render(&res, QPoint(), QRegion(r), renderFlags); | - |
2680 | | - |
2681 | d->dirtyOpaqueChildren = oldDirtyOpaqueChildren; | - |
2682 | return res; executed: return res; Execution Count:50 | 50 |
2683 | } | - |
2684 | QGraphicsEffect *QWidget::graphicsEffect() const | - |
2685 | { | - |
2686 | const QWidgetPrivate * const d = d_func(); | - |
2687 | return d->graphicsEffect; executed: return d->graphicsEffect; Execution Count:845122 | 845122 |
2688 | } | - |
2689 | void QWidget::setGraphicsEffect(QGraphicsEffect *effect) | - |
2690 | { | - |
2691 | QWidgetPrivate * const d = d_func(); | - |
2692 | if (d->graphicsEffect == effect) partially evaluated: d->graphicsEffect == effect no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
2693 | return; | 0 |
2694 | | - |
2695 | if (d->graphicsEffect) { evaluated: d->graphicsEffect yes Evaluation Count:3 | yes Evaluation Count:4 |
| 3-4 |
2696 | d->invalidateBuffer(rect()); | - |
2697 | delete d->graphicsEffect; | - |
2698 | d->graphicsEffect = 0; | - |
2699 | } executed: } Execution Count:3 | 3 |
2700 | | - |
2701 | if (effect) { evaluated: effect yes Evaluation Count:6 | yes Evaluation Count:1 |
| 1-6 |
2702 | | - |
2703 | QGraphicsEffectSourcePrivate *sourced = new QWidgetEffectSourcePrivate(this); | - |
2704 | QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced); | - |
2705 | d->graphicsEffect = effect; | - |
2706 | effect->d_func()->setGraphicsEffectSource(source); | - |
2707 | update(); | - |
2708 | } executed: } Execution Count:6 | 6 |
2709 | | - |
2710 | d->updateIsOpaque(); | - |
2711 | } executed: } Execution Count:7 | 7 |
2712 | | - |
2713 | | - |
2714 | bool QWidgetPrivate::isAboutToShow() const | - |
2715 | { | - |
2716 | if (data.in_show) evaluated: data.in_show yes Evaluation Count:2 | yes Evaluation Count:29 |
| 2-29 |
2717 | return true; executed: return true; Execution Count:2 | 2 |
2718 | | - |
2719 | const QWidget * const q = q_func(); | - |
2720 | if (q->isHidden()) evaluated: q->isHidden() yes Evaluation Count:28 | yes Evaluation Count:1 |
| 1-28 |
2721 | return false; executed: return false; Execution Count:28 | 28 |
2722 | | - |
2723 | | - |
2724 | QWidget *parent = q->parentWidget(); | - |
2725 | return parent ? parent->d_func()->isAboutToShow() : false; executed: return parent ? parent->d_func()->isAboutToShow() : false; Execution Count:1 | 1 |
2726 | } | - |
2727 | | - |
2728 | QRegion QWidgetPrivate::prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags) | - |
2729 | { | - |
2730 | QWidget * const q = q_func(); | - |
2731 | const bool isVisible = q->isVisible(); | - |
2732 | | - |
2733 | | - |
2734 | if (!isVisible && !isAboutToShow()) { evaluated: !isVisible yes Evaluation Count:30 | yes Evaluation Count:107 |
evaluated: !isAboutToShow() yes Evaluation Count:28 | yes Evaluation Count:2 |
| 2-107 |
2735 | QWidget *topLevel = q->window(); | - |
2736 | (void)topLevel->d_func()->topData(); | - |
2737 | topLevel->ensurePolished(); | - |
2738 | | - |
2739 | | - |
2740 | | - |
2741 | QWidget *widget = q; | - |
2742 | QWidgetList hiddenWidgets; | - |
2743 | while (widget) { evaluated: widget yes Evaluation Count:29 | yes Evaluation Count:28 |
| 28-29 |
2744 | if (widget->isHidden()) { evaluated: widget->isHidden() yes Evaluation Count:28 | yes Evaluation Count:1 |
| 1-28 |
2745 | widget->setAttribute(Qt::WA_WState_Hidden, false); | - |
2746 | hiddenWidgets.append(widget); | - |
2747 | if (!widget->isWindow() && widget->parentWidget()->d_func()->layout) partially evaluated: !widget->isWindow() no Evaluation Count:0 | yes Evaluation Count:28 |
never evaluated: widget->parentWidget()->d_func()->layout | 0-28 |
2748 | widget->d_func()->updateGeometry_helper(true); never executed: widget->d_func()->updateGeometry_helper(true); | 0 |
2749 | } executed: } Execution Count:28 | 28 |
2750 | widget = widget->parentWidget(); | - |
2751 | } executed: } Execution Count:29 | 29 |
2752 | | - |
2753 | | - |
2754 | if (topLevel->d_func()->layout) evaluated: topLevel->d_func()->layout yes Evaluation Count:2 | yes Evaluation Count:26 |
| 2-26 |
2755 | topLevel->d_func()->layout->activate(); executed: topLevel->d_func()->layout->activate(); Execution Count:2 | 2 |
2756 | | - |
2757 | | - |
2758 | QTLWExtra *topLevelExtra = topLevel->d_func()->maybeTopData(); | - |
2759 | if (topLevelExtra && !topLevelExtra->sizeAdjusted partially evaluated: topLevelExtra yes Evaluation Count:28 | no Evaluation Count:0 |
evaluated: !topLevelExtra->sizeAdjusted yes Evaluation Count:27 | yes Evaluation Count:1 |
| 0-28 |
2760 | && !topLevel->testAttribute(Qt::WA_Resized)) { evaluated: !topLevel->testAttribute(Qt::WA_Resized) yes Evaluation Count:3 | yes Evaluation Count:24 |
| 3-24 |
2761 | topLevel->adjustSize(); | - |
2762 | topLevel->setAttribute(Qt::WA_Resized, false); | - |
2763 | } executed: } Execution Count:3 | 3 |
2764 | | - |
2765 | | - |
2766 | topLevel->d_func()->activateChildLayoutsRecursively(); | - |
2767 | | - |
2768 | | - |
2769 | for (int i = 0; i < hiddenWidgets.size(); ++i) { evaluated: i < hiddenWidgets.size() yes Evaluation Count:28 | yes Evaluation Count:28 |
| 28 |
2770 | QWidget *widget = hiddenWidgets.at(i); | - |
2771 | widget->setAttribute(Qt::WA_WState_Hidden); | - |
2772 | if (!widget->isWindow() && widget->parentWidget()->d_func()->layout) partially evaluated: !widget->isWindow() no Evaluation Count:0 | yes Evaluation Count:28 |
never evaluated: widget->parentWidget()->d_func()->layout | 0-28 |
2773 | widget->parentWidget()->d_func()->layout->invalidate(); never executed: widget->parentWidget()->d_func()->layout->invalidate(); | 0 |
2774 | } executed: } Execution Count:28 | 28 |
2775 | } else if (isVisible) { evaluated: isVisible yes Evaluation Count:107 | yes Evaluation Count:2 |
executed: } Execution Count:28 | 2-107 |
2776 | q->window()->d_func()->sendPendingMoveAndResizeEvents(true, true); | - |
2777 | } executed: } Execution Count:107 | 107 |
2778 | | - |
2779 | | - |
2780 | QRegion toBePainted = !region.isEmpty() ? region : QRegion(q->rect()); evaluated: !region.isEmpty() yes Evaluation Count:58 | yes Evaluation Count:79 |
| 58-79 |
2781 | if (!(renderFlags & QWidget::IgnoreMask) && extra && extra->hasMask) evaluated: !(renderFlags & QWidget::IgnoreMask) yes Evaluation Count:40 | yes Evaluation Count:97 |
evaluated: extra yes Evaluation Count:37 | yes Evaluation Count:3 |
partially evaluated: extra->hasMask no Evaluation Count:0 | yes Evaluation Count:37 |
| 0-97 |
2782 | toBePainted &= extra->mask; never executed: toBePainted &= extra->mask; | 0 |
2783 | return toBePainted; executed: return toBePainted; Execution Count:137 | 137 |
2784 | } | - |
2785 | | - |
2786 | void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &toBePainted, | - |
2787 | QWidget::RenderFlags renderFlags) | - |
2788 | { | - |
2789 | qt_noop(); | - |
2790 | qt_noop(); | - |
2791 | | - |
2792 | QWidget * const q = q_func(); | - |
2793 | | - |
2794 | const QTransform originalTransform = painter->worldTransform(); | - |
2795 | const bool useDeviceCoordinates = originalTransform.isScaling(); | - |
2796 | if (!useDeviceCoordinates) { partially evaluated: !useDeviceCoordinates yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2797 | | - |
2798 | | - |
2799 | const QRect rect = toBePainted.boundingRect(); | - |
2800 | const QSize size = rect.size(); | - |
2801 | if (size.isNull()) partially evaluated: size.isNull() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2802 | return; | 0 |
2803 | | - |
2804 | QPixmap pixmap(size); | - |
2805 | if (!(renderFlags & QWidget::DrawWindowBackground) || !isOpaque) partially evaluated: !(renderFlags & QWidget::DrawWindowBackground) no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: !isOpaque no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2806 | pixmap.fill(Qt::transparent); never executed: pixmap.fill(Qt::transparent); | 0 |
2807 | q->render(&pixmap, QPoint(), toBePainted, renderFlags); | - |
2808 | | - |
2809 | const bool restore = !(painter->renderHints() & QPainter::SmoothPixmapTransform); | - |
2810 | painter->setRenderHints(QPainter::SmoothPixmapTransform, true); | - |
2811 | | - |
2812 | painter->drawPixmap(targetOffset, pixmap); | - |
2813 | | - |
2814 | if (restore) partially evaluated: restore yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2815 | painter->setRenderHints(QPainter::SmoothPixmapTransform, false); executed: painter->setRenderHints(QPainter::SmoothPixmapTransform, false); Execution Count:2 | 2 |
2816 | | - |
2817 | | - |
2818 | } else { executed: } Execution Count:2 | 2 |
2819 | | - |
2820 | QTransform transform = originalTransform; | - |
2821 | transform.translate(targetOffset.x(), targetOffset.y()); | - |
2822 | | - |
2823 | QPaintDevice *device = painter->device(); | - |
2824 | qt_noop(); | - |
2825 | | - |
2826 | | - |
2827 | const QRectF rect(toBePainted.boundingRect()); | - |
2828 | QRect deviceRect = transform.mapRect(QRectF(0, 0, rect.width(), rect.height())).toAlignedRect(); | - |
2829 | deviceRect &= QRect(0, 0, device->width(), device->height()); | - |
2830 | | - |
2831 | QPixmap pixmap(deviceRect.size()); | - |
2832 | pixmap.fill(Qt::transparent); | - |
2833 | | - |
2834 | | - |
2835 | QPainter pixmapPainter(&pixmap); | - |
2836 | pixmapPainter.setRenderHints(painter->renderHints()); | - |
2837 | transform *= QTransform::fromTranslate(-deviceRect.x(), -deviceRect.y()); | - |
2838 | pixmapPainter.setTransform(transform); | - |
2839 | | - |
2840 | q->render(&pixmapPainter, QPoint(), toBePainted, renderFlags); | - |
2841 | pixmapPainter.end(); | - |
2842 | | - |
2843 | | - |
2844 | painter->setTransform(QTransform()); | - |
2845 | painter->drawPixmap(deviceRect.topLeft(), pixmap); | - |
2846 | painter->setTransform(originalTransform); | - |
2847 | } | 0 |
2848 | | - |
2849 | } | - |
2850 | | - |
2851 | void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, | - |
2852 | QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - |
2853 | { | - |
2854 | if (rgn.isEmpty()) evaluated: rgn.isEmpty() yes Evaluation Count:849 | yes Evaluation Count:18502 |
| 849-18502 |
2855 | return; executed: return; Execution Count:849 | 849 |
2856 | QWidget * const q = q_func(); | - |
2857 | | - |
2858 | if (graphicsEffect && graphicsEffect->isEnabled()) { partially evaluated: graphicsEffect no Evaluation Count:0 | yes Evaluation Count:18502 |
never evaluated: graphicsEffect->isEnabled() | 0-18502 |
2859 | QGraphicsEffectSource *source = graphicsEffect->d_func()->source; | - |
2860 | QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *> | - |
2861 | (source->d_func()); | - |
2862 | if (!sourced->context) { never evaluated: !sourced->context | 0 |
2863 | QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, backingStore); | - |
2864 | sourced->context = &context; | - |
2865 | if (!sharedPainter) { never evaluated: !sharedPainter | 0 |
2866 | setSystemClip(pdev, rgn.translated(offset)); | - |
2867 | QPainter p(pdev); | - |
2868 | p.translate(offset); | - |
2869 | context.painter = &p; | - |
2870 | graphicsEffect->draw(&p); | - |
2871 | setSystemClip(pdev, QRegion()); | - |
2872 | } else { | 0 |
2873 | context.painter = sharedPainter; | - |
2874 | if (sharedPainter->worldTransform() != sourced->lastEffectTransform) { never evaluated: sharedPainter->worldTransform() != sourced->lastEffectTransform | 0 |
2875 | sourced->invalidateCache(); | - |
2876 | sourced->lastEffectTransform = sharedPainter->worldTransform(); | - |
2877 | } | 0 |
2878 | sharedPainter->save(); | - |
2879 | sharedPainter->translate(offset); | - |
2880 | graphicsEffect->draw(sharedPainter); | - |
2881 | sharedPainter->restore(); | - |
2882 | } | 0 |
2883 | sourced->context = 0; | - |
2884 | return; | 0 |
2885 | } | - |
2886 | } | 0 |
2887 | | - |
2888 | | - |
2889 | const bool asRoot = flags & DrawAsRoot; | - |
2890 | const bool alsoOnScreen = flags & DrawPaintOnScreen; | - |
2891 | const bool recursive = flags & DrawRecursive; | - |
2892 | const bool alsoInvisible = flags & DrawInvisible; | - |
2893 | | - |
2894 | qt_noop(); | - |
2895 | | - |
2896 | QRegion toBePainted(rgn); | - |
2897 | if (asRoot && !alsoInvisible) evaluated: asRoot yes Evaluation Count:4110 | yes Evaluation Count:14392 |
evaluated: !alsoInvisible yes Evaluation Count:4020 | yes Evaluation Count:90 |
| 90-14392 |
2898 | toBePainted &= clipRect(); executed: toBePainted &= clipRect(); Execution Count:4020 | 4020 |
2899 | if (!(flags & DontSubtractOpaqueChildren)) partially evaluated: !(flags & DontSubtractOpaqueChildren) yes Evaluation Count:18502 | no Evaluation Count:0 |
| 0-18502 |
2900 | subtractOpaqueChildren(toBePainted, q->rect()); executed: subtractOpaqueChildren(toBePainted, q->rect()); Execution Count:18502 | 18502 |
2901 | | - |
2902 | if (!toBePainted.isEmpty()) { evaluated: !toBePainted.isEmpty() yes Evaluation Count:16430 | yes Evaluation Count:2072 |
| 2072-16430 |
2903 | bool onScreen = paintOnScreen(); | - |
2904 | if (!onScreen || alsoOnScreen) { evaluated: !onScreen yes Evaluation Count:16422 | yes Evaluation Count:8 |
partially evaluated: alsoOnScreen yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-16422 |
2905 | | - |
2906 | if (q->testAttribute(Qt::WA_WState_InPaintEvent)) partially evaluated: q->testAttribute(Qt::WA_WState_InPaintEvent) no Evaluation Count:0 | yes Evaluation Count:16430 |
| 0-16430 |
2907 | QMessageLogger("kernel/qwidget.cpp", 5076, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); never executed: QMessageLogger("kernel/qwidget.cpp", 5076, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); | 0 |
2908 | q->setAttribute(Qt::WA_WState_InPaintEvent); | - |
2909 | | - |
2910 | | - |
2911 | | - |
2912 | | - |
2913 | | - |
2914 | QPaintEngine *paintEngine = pdev->paintEngine(); | - |
2915 | if (paintEngine) { evaluated: paintEngine yes Evaluation Count:16422 | yes Evaluation Count:8 |
| 8-16422 |
2916 | setRedirected(pdev, -offset); | - |
2917 | if (sharedPainter) evaluated: sharedPainter yes Evaluation Count:26 | yes Evaluation Count:16396 |
| 26-16396 |
2918 | setSystemClip(pdev, toBePainted); executed: setSystemClip(pdev, toBePainted); Execution Count:26 | 26 |
2919 | else | - |
2920 | paintEngine->d_func()->systemRect = q->data->crect; executed: paintEngine->d_func()->systemRect = q->data->crect; Execution Count:16396 | 16396 |
2921 | | - |
2922 | | - |
2923 | if ((asRoot || q->autoFillBackground() || onScreen || q->testAttribute(Qt::WA_StyledBackground)) evaluated: asRoot yes Evaluation Count:3480 | yes Evaluation Count:12942 |
evaluated: q->autoFillBackground() yes Evaluation Count:5211 | yes Evaluation Count:7731 |
partially evaluated: onScreen no Evaluation Count:0 | yes Evaluation Count:7731 |
evaluated: q->testAttribute(Qt::WA_StyledBackground) yes Evaluation Count:2 | yes Evaluation Count:7729 |
| 0-12942 |
2924 | && !q->testAttribute(Qt::WA_OpaquePaintEvent) && !q->testAttribute(Qt::WA_NoSystemBackground)) { evaluated: !q->testAttribute(Qt::WA_OpaquePaintEvent) yes Evaluation Count:8683 | yes Evaluation Count:10 |
evaluated: !q->testAttribute(Qt::WA_NoSystemBackground) yes Evaluation Count:8679 | yes Evaluation Count:4 |
| 4-8683 |
2925 | QPainter p(q); | - |
2926 | paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0); | - |
2927 | } executed: } Execution Count:8679 | 8679 |
2928 | | - |
2929 | if (!sharedPainter) evaluated: !sharedPainter yes Evaluation Count:16396 | yes Evaluation Count:26 |
| 26-16396 |
2930 | setSystemClip(pdev, toBePainted.translated(offset)); executed: setSystemClip(pdev, toBePainted.translated(offset)); Execution Count:16396 | 16396 |
2931 | | - |
2932 | if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) { partially evaluated: !onScreen yes Evaluation Count:16422 | no Evaluation Count:0 |
evaluated: !asRoot yes Evaluation Count:12942 | yes Evaluation Count:3480 |
evaluated: !isOpaque yes Evaluation Count:4572 | yes Evaluation Count:8370 |
partially evaluated: q->testAttribute(Qt::WA_TintedBackground) no Evaluation Count:0 | yes Evaluation Count:4572 |
| 0-16422 |
2933 | QPainter p(q); | - |
2934 | QColor tint = q->palette().window().color(); | - |
2935 | tint.setAlphaF(qreal(.6)); | - |
2936 | p.fillRect(toBePainted.boundingRect(), tint); | - |
2937 | } | 0 |
2938 | } executed: } Execution Count:16422 | 16422 |
2939 | QPaintEvent e(toBePainted); | - |
2940 | QCoreApplication::sendSpontaneousEvent(q, &e); | - |
2941 | | - |
2942 | | - |
2943 | if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) evaluated: backingStore yes Evaluation Count:15952 | yes Evaluation Count:478 |
partially evaluated: !onScreen yes Evaluation Count:15952 | no Evaluation Count:0 |
evaluated: !asRoot yes Evaluation Count:12561 | yes Evaluation Count:3391 |
evaluated: q->internalWinId() yes Evaluation Count:23 | yes Evaluation Count:12538 |
evaluated: !q->nativeParentWidget()->isWindow() yes Evaluation Count:2 | yes Evaluation Count:12536 |
| 0-15952 |
2944 | backingStore->markDirtyOnScreen(toBePainted, q, offset); executed: backingStore->markDirtyOnScreen(toBePainted, q, offset); Execution Count:25 | 25 |
2945 | | - |
2946 | | - |
2947 | if (paintEngine) { evaluated: paintEngine yes Evaluation Count:16422 | yes Evaluation Count:8 |
| 8-16422 |
2948 | | - |
2949 | | - |
2950 | | - |
2951 | | - |
2952 | restoreRedirected(); | - |
2953 | if (!sharedPainter) evaluated: !sharedPainter yes Evaluation Count:16396 | yes Evaluation Count:26 |
| 26-16396 |
2954 | paintEngine->d_func()->systemRect = QRect(); executed: paintEngine->d_func()->systemRect = QRect(); Execution Count:16396 | 16396 |
2955 | else | - |
2956 | paintEngine->d_func()->currentClipDevice = 0; executed: paintEngine->d_func()->currentClipDevice = 0; Execution Count:26 | 26 |
2957 | | - |
2958 | setSystemClip(pdev, QRegion()); | - |
2959 | } executed: } Execution Count:16422 | 16422 |
2960 | q->setAttribute(Qt::WA_WState_InPaintEvent, false); | - |
2961 | if (q->paintingActive()) partially evaluated: q->paintingActive() no Evaluation Count:0 | yes Evaluation Count:16430 |
| 0-16430 |
2962 | QMessageLogger("kernel/qwidget.cpp", 5149, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); never executed: QMessageLogger("kernel/qwidget.cpp", 5149, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); | 0 |
2963 | | - |
2964 | if (paintEngine && paintEngine->autoDestruct()) { evaluated: paintEngine yes Evaluation Count:16422 | yes Evaluation Count:8 |
partially evaluated: paintEngine->autoDestruct() no Evaluation Count:0 | yes Evaluation Count:16422 |
| 0-16422 |
2965 | delete paintEngine; | - |
2966 | } | 0 |
2967 | | - |
2968 | | - |
2969 | | - |
2970 | | - |
2971 | | - |
2972 | } else if (q->isWindow()) { never evaluated: q->isWindow() executed: } Execution Count:16430 | 0-16430 |
2973 | QPaintEngine *engine = pdev->paintEngine(); | - |
2974 | if (engine) { | 0 |
2975 | QPainter p(pdev); | - |
2976 | p.setClipRegion(toBePainted); | - |
2977 | const QBrush bg = q->palette().brush(QPalette::Window); | - |
2978 | if (bg.style() == Qt::TexturePattern) never evaluated: bg.style() == Qt::TexturePattern | 0 |
2979 | p.drawTiledPixmap(q->rect(), bg.texture()); never executed: p.drawTiledPixmap(q->rect(), bg.texture()); | 0 |
2980 | else | - |
2981 | p.fillRect(q->rect(), bg); never executed: p.fillRect(q->rect(), bg); | 0 |
2982 | | - |
2983 | if (engine->autoDestruct()) never evaluated: engine->autoDestruct() | 0 |
2984 | delete engine; never executed: delete engine; | 0 |
2985 | } | 0 |
2986 | } | 0 |
2987 | } | - |
2988 | | - |
2989 | if (recursive && !children.isEmpty()) { evaluated: recursive yes Evaluation Count:18494 | yes Evaluation Count:8 |
evaluated: !children.isEmpty() yes Evaluation Count:7860 | yes Evaluation Count:10634 |
| 8-18494 |
2990 | paintSiblingsRecursive(pdev, children, children.size() - 1, rgn, offset, flags & ~DrawAsRoot | - |
2991 | , sharedPainter, backingStore); | - |
2992 | } executed: } Execution Count:7860 | 7860 |
2993 | } executed: } Execution Count:18502 | 18502 |
2994 | | - |
2995 | void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, | - |
2996 | const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, | - |
2997 | bool readyToRender) | - |
2998 | { | - |
2999 | if (!target) { partially evaluated: !target no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3000 | QMessageLogger("kernel/qwidget.cpp", 5187, __PRETTY_FUNCTION__).warning("QWidget::render: null pointer to paint device"); | - |
3001 | return; | 0 |
3002 | } | - |
3003 | | - |
3004 | const bool inRenderWithPainter = extra && extra->inRenderWithPainter; evaluated: extra yes Evaluation Count:80 | yes Evaluation Count:10 |
evaluated: extra->inRenderWithPainter yes Evaluation Count:26 | yes Evaluation Count:54 |
| 10-80 |
3005 | QRegion paintRegion = !inRenderWithPainter && !readyToRender evaluated: !inRenderWithPainter yes Evaluation Count:64 | yes Evaluation Count:26 |
partially evaluated: !readyToRender yes Evaluation Count:64 | no Evaluation Count:0 |
| 0-64 |
3006 | ? prepareToRender(sourceRegion, renderFlags) | - |
3007 | : sourceRegion; | - |
3008 | if (paintRegion.isEmpty()) partially evaluated: paintRegion.isEmpty() no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3009 | return; | 0 |
3010 | | - |
3011 | | - |
3012 | QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; evaluated: inRenderWithPainter yes Evaluation Count:26 | yes Evaluation Count:64 |
| 26-64 |
3013 | | - |
3014 | | - |
3015 | | - |
3016 | if (target->devType() == QInternal::Widget) { partially evaluated: target->devType() == QInternal::Widget no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3017 | QWidgetPrivate *targetPrivate = static_cast<QWidget *>(target)->d_func(); | - |
3018 | if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { never evaluated: targetPrivate->extra never evaluated: targetPrivate->extra->inRenderWithPainter | 0 |
3019 | QPainter *targetPainter = targetPrivate->sharedPainter(); | - |
3020 | if (targetPainter && targetPainter->isActive()) never evaluated: targetPainter never evaluated: targetPainter->isActive() | 0 |
3021 | setSharedPainter(targetPainter); never executed: setSharedPainter(targetPainter); | 0 |
3022 | } | 0 |
3023 | } | 0 |
3024 | | - |
3025 | | - |
3026 | | - |
3027 | | - |
3028 | | - |
3029 | QPoint offset = targetOffset; | - |
3030 | offset -= paintRegion.boundingRect().topLeft(); | - |
3031 | QPoint redirectionOffset; | - |
3032 | QPaintDevice *redirected = 0; | - |
3033 | | - |
3034 | if (target->devType() == QInternal::Widget) partially evaluated: target->devType() == QInternal::Widget no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3035 | redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); never executed: redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); | 0 |
3036 | if (!redirected) partially evaluated: !redirected yes Evaluation Count:90 | no Evaluation Count:0 |
| 0-90 |
3037 | redirected = QPainter::redirected(target, &redirectionOffset); executed: redirected = QPainter::redirected(target, &redirectionOffset); Execution Count:90 | 90 |
3038 | | - |
3039 | if (redirected) { partially evaluated: redirected no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3040 | target = redirected; | - |
3041 | offset -= redirectionOffset; | - |
3042 | } | 0 |
3043 | | - |
3044 | if (!inRenderWithPainter) { evaluated: !inRenderWithPainter yes Evaluation Count:64 | yes Evaluation Count:26 |
| 26-64 |
3045 | if (QPaintEngine *targetEngine = target->paintEngine()) { partially evaluated: QPaintEngine *targetEngine = target->paintEngine() yes Evaluation Count:64 | no Evaluation Count:0 |
| 0-64 |
3046 | const QRegion targetSystemClip = targetEngine->systemClip(); | - |
3047 | if (!targetSystemClip.isEmpty()) evaluated: !targetSystemClip.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:61 |
| 3-61 |
3048 | paintRegion &= targetSystemClip.translated(-offset); executed: paintRegion &= targetSystemClip.translated(-offset); Execution Count:3 | 3 |
3049 | } executed: } Execution Count:64 | 64 |
3050 | } executed: } Execution Count:64 | 64 |
3051 | | - |
3052 | | - |
3053 | int flags = DrawPaintOnScreen | DrawInvisible; | - |
3054 | if (renderFlags & QWidget::DrawWindowBackground) partially evaluated: renderFlags & QWidget::DrawWindowBackground yes Evaluation Count:90 | no Evaluation Count:0 |
| 0-90 |
3055 | flags |= DrawAsRoot; executed: flags |= DrawAsRoot; Execution Count:90 | 90 |
3056 | | - |
3057 | if (renderFlags & QWidget::DrawChildren) partially evaluated: renderFlags & QWidget::DrawChildren yes Evaluation Count:90 | no Evaluation Count:0 |
| 0-90 |
3058 | flags |= DrawRecursive; executed: flags |= DrawRecursive; Execution Count:90 | 90 |
3059 | else | - |
3060 | flags |= DontSubtractOpaqueChildren; never executed: flags |= DontSubtractOpaqueChildren; | 0 |
3061 | | - |
3062 | flags |= DontSetCompositionMode; | - |
3063 | | - |
3064 | if (target->devType() == QInternal::Printer) { partially evaluated: target->devType() == QInternal::Printer no Evaluation Count:0 | yes Evaluation Count:90 |
| 0-90 |
3065 | QPainter p(target); | - |
3066 | render_helper(&p, targetOffset, paintRegion, renderFlags); | - |
3067 | return; | 0 |
3068 | } | - |
3069 | | - |
3070 | | - |
3071 | | - |
3072 | drawWidget(target, paintRegion, offset, flags, sharedPainter()); | - |
3073 | | - |
3074 | | - |
3075 | if (oldSharedPainter) evaluated: oldSharedPainter yes Evaluation Count:24 | yes Evaluation Count:66 |
| 24-66 |
3076 | setSharedPainter(oldSharedPainter); executed: setSharedPainter(oldSharedPainter); Execution Count:24 | 24 |
3077 | | - |
3078 | | - |
3079 | | - |
3080 | | - |
3081 | } executed: } Execution Count:90 | 90 |
3082 | | - |
3083 | void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn, | - |
3084 | const QPoint &offset, int flags | - |
3085 | , QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - |
3086 | { | - |
3087 | QWidget *w = 0; | - |
3088 | QRect boundingRect; | - |
3089 | bool dirtyBoundingRect = true; | - |
3090 | const bool exludeOpaqueChildren = (flags & DontDrawOpaqueChildren); | - |
3091 | const bool excludeNativeChildren = (flags & DontDrawNativeChildren); | - |
3092 | | - |
3093 | do { | - |
3094 | QWidget *x = qobject_cast<QWidget*>(siblings.at(index)); | - |
3095 | if (x && !(exludeOpaqueChildren && x->d_func()->isOpaque) && !x->isHidden() && !x->isWindow() evaluated: x yes Evaluation Count:20336 | yes Evaluation Count:9311 |
evaluated: exludeOpaqueChildren yes Evaluation Count:2028 | yes Evaluation Count:18308 |
evaluated: x->d_func()->isOpaque yes Evaluation Count:590 | yes Evaluation Count:1438 |
evaluated: !x->isHidden() yes Evaluation Count:13964 | yes Evaluation Count:5782 |
evaluated: !x->isWindow() yes Evaluation Count:13937 | yes Evaluation Count:27 |
| 27-20336 |
3096 | && !(excludeNativeChildren && x->internalWinId())) { partially evaluated: excludeNativeChildren no Evaluation Count:0 | yes Evaluation Count:13937 |
never evaluated: x->internalWinId() | 0-13937 |
3097 | if (dirtyBoundingRect) { evaluated: dirtyBoundingRect yes Evaluation Count:10569 | yes Evaluation Count:3368 |
| 3368-10569 |
3098 | boundingRect = rgn.boundingRect(); | - |
3099 | dirtyBoundingRect = false; | - |
3100 | } executed: } Execution Count:10569 | 10569 |
3101 | | - |
3102 | if (qRectIntersects(boundingRect, x->d_func()->effectiveRectFor(x->data->crect))) { evaluated: qRectIntersects(boundingRect, x->d_func()->effectiveRectFor(x->data->crect)) yes Evaluation Count:9860 | yes Evaluation Count:4077 |
| 4077-9860 |
3103 | w = x; | - |
3104 | break; executed: break; Execution Count:9860 | 9860 |
3105 | } | - |
3106 | } executed: } Execution Count:4077 | 4077 |
3107 | --index; | - |
3108 | } while (index >= 0); evaluated: index >= 0 yes Evaluation Count:15570 | yes Evaluation Count:4217 |
executed: } Execution Count:19787 | 4217-19787 |
3109 | | - |
3110 | if (!w) evaluated: !w yes Evaluation Count:4217 | yes Evaluation Count:9860 |
| 4217-9860 |
3111 | return; executed: return; Execution Count:4217 | 4217 |
3112 | | - |
3113 | QWidgetPrivate *wd = w->d_func(); | - |
3114 | const QPoint widgetPos(w->data->crect.topLeft()); | - |
3115 | const bool hasMask = wd->extra && wd->extra->hasMask && !wd->graphicsEffect; evaluated: wd->extra yes Evaluation Count:6108 | yes Evaluation Count:3752 |
evaluated: wd->extra->hasMask yes Evaluation Count:17 | yes Evaluation Count:6091 |
partially evaluated: !wd->graphicsEffect yes Evaluation Count:17 | no Evaluation Count:0 |
| 0-6108 |
3116 | if (index > 0) { evaluated: index > 0 yes Evaluation Count:6217 | yes Evaluation Count:3643 |
| 3643-6217 |
3117 | QRegion wr(rgn); | - |
3118 | if (wd->isOpaque) evaluated: wd->isOpaque yes Evaluation Count:942 | yes Evaluation Count:5275 |
| 942-5275 |
3119 | wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect; partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:942 |
executed: wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect; Execution Count:942 | 0-942 |
3120 | paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags | - |
3121 | , sharedPainter, backingStore); | - |
3122 | } executed: } Execution Count:6217 | 6217 |
3123 | | - |
3124 | if (w->updatesEnabled() partially evaluated: w->updatesEnabled() yes Evaluation Count:9860 | no Evaluation Count:0 |
| 0-9860 |
3125 | | - |
3126 | && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget) evaluated: !w->d_func()->extra yes Evaluation Count:3752 | yes Evaluation Count:6108 |
partially evaluated: !w->d_func()->extra->proxyWidget yes Evaluation Count:6108 | no Evaluation Count:0 |
| 0-6108 |
3127 | | - |
3128 | ) { | - |
3129 | QRegion wRegion(rgn); | - |
3130 | wRegion &= wd->effectiveRectFor(w->data->crect); | - |
3131 | wRegion.translate(-widgetPos); | - |
3132 | if (hasMask) evaluated: hasMask yes Evaluation Count:17 | yes Evaluation Count:9843 |
| 17-9843 |
3133 | wRegion &= wd->extra->mask; executed: wRegion &= wd->extra->mask; Execution Count:17 | 17 |
3134 | wd->drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, backingStore); | - |
3135 | } executed: } Execution Count:9860 | 9860 |
3136 | } executed: } Execution Count:9860 | 9860 |
3137 | | - |
3138 | | - |
3139 | QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const | - |
3140 | { | - |
3141 | if (system != Qt::DeviceCoordinates) never evaluated: system != Qt::DeviceCoordinates | 0 |
3142 | return m_widget->rect(); never executed: return m_widget->rect(); | 0 |
3143 | | - |
3144 | if (!context) { never evaluated: !context | 0 |
3145 | | - |
3146 | QMessageLogger("kernel/qwidget.cpp", 5333, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context"); | - |
3147 | return QRectF(); never executed: return QRectF(); | 0 |
3148 | } | - |
3149 | | - |
3150 | return context->painter->worldTransform().mapRect(m_widget->rect()); never executed: return context->painter->worldTransform().mapRect(m_widget->rect()); | 0 |
3151 | } | - |
3152 | | - |
3153 | void QWidgetEffectSourcePrivate::draw(QPainter *painter) | - |
3154 | { | - |
3155 | if (!context || context->painter != painter) { never evaluated: !context never evaluated: context->painter != painter | 0 |
3156 | m_widget->render(painter); | - |
3157 | return; | 0 |
3158 | } | - |
3159 | | - |
3160 | | - |
3161 | | - |
3162 | QRegion toBePainted = context->rgn; | - |
3163 | toBePainted &= m_widget->rect(); | - |
3164 | QWidgetPrivate *wd = qt_widget_private(m_widget); | - |
3165 | if (wd->extra && wd->extra->hasMask) never evaluated: wd->extra never evaluated: wd->extra->hasMask | 0 |
3166 | toBePainted &= wd->extra->mask; never executed: toBePainted &= wd->extra->mask; | 0 |
3167 | | - |
3168 | wd->drawWidget(context->pdev, toBePainted, context->offset, context->flags, | - |
3169 | context->sharedPainter, context->backingStore); | - |
3170 | } | 0 |
3171 | | - |
3172 | QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset, | - |
3173 | QGraphicsEffect::PixmapPadMode mode) const | - |
3174 | { | - |
3175 | const bool deviceCoordinates = (system == Qt::DeviceCoordinates); | - |
3176 | if (!context && deviceCoordinates) { never evaluated: !context never evaluated: deviceCoordinates | 0 |
3177 | | - |
3178 | QMessageLogger("kernel/qwidget.cpp", 5365, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); | - |
3179 | return QPixmap(); never executed: return QPixmap(); | 0 |
3180 | } | - |
3181 | | - |
3182 | QPoint pixmapOffset; | - |
3183 | QRectF sourceRect = m_widget->rect(); | - |
3184 | | - |
3185 | if (deviceCoordinates) { never evaluated: deviceCoordinates | 0 |
3186 | const QTransform &painterTransform = context->painter->worldTransform(); | - |
3187 | sourceRect = painterTransform.mapRect(sourceRect); | - |
3188 | pixmapOffset = painterTransform.map(pixmapOffset); | - |
3189 | } | 0 |
3190 | | - |
3191 | QRect effectRect; | - |
3192 | | - |
3193 | if (mode == QGraphicsEffect::PadToEffectiveBoundingRect) never evaluated: mode == QGraphicsEffect::PadToEffectiveBoundingRect | 0 |
3194 | effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); never executed: effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); | 0 |
3195 | else if (mode == QGraphicsEffect::PadToTransparentBorder) never evaluated: mode == QGraphicsEffect::PadToTransparentBorder | 0 |
3196 | effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); never executed: effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); | 0 |
3197 | else | - |
3198 | effectRect = sourceRect.toAlignedRect(); never executed: effectRect = sourceRect.toAlignedRect(); | 0 |
3199 | | - |
3200 | if (offset) | 0 |
3201 | *offset = effectRect.topLeft(); never executed: *offset = effectRect.topLeft(); | 0 |
3202 | | - |
3203 | pixmapOffset -= effectRect.topLeft(); | - |
3204 | | - |
3205 | QPixmap pixmap(effectRect.size()); | - |
3206 | pixmap.fill(Qt::transparent); | - |
3207 | m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren); | - |
3208 | return pixmap; never executed: return pixmap; | 0 |
3209 | } | - |
3210 | QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin) | - |
3211 | { | - |
3212 | if (origin) { evaluated: origin yes Evaluation Count:40309 | yes Evaluation Count:21246 |
| 21246-40309 |
3213 | QWExtra *extra = origin->d_func()->extra; | - |
3214 | if (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:33010 | yes Evaluation Count:7299 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:33010 |
| 0-33010 |
3215 | return extra->proxyWidget; never executed: return extra->proxyWidget; | 0 |
3216 | return nearestGraphicsProxyWidget(origin->parentWidget()); executed: return nearestGraphicsProxyWidget(origin->parentWidget()); Execution Count:40309 | 40309 |
3217 | } | - |
3218 | return 0; executed: return 0; Execution Count:21246 | 21246 |
3219 | } | - |
3220 | void QWidgetPrivate::setLocale_helper(const QLocale &loc, bool forceUpdate) | - |
3221 | { | - |
3222 | QWidget * const q = q_func(); | - |
3223 | if (locale == loc && !forceUpdate) evaluated: locale == loc yes Evaluation Count:41900 | yes Evaluation Count:76 |
partially evaluated: !forceUpdate yes Evaluation Count:41900 | no Evaluation Count:0 |
| 0-41900 |
3224 | return; executed: return; Execution Count:41900 | 41900 |
3225 | | - |
3226 | locale = loc; | - |
3227 | | - |
3228 | if (!children.isEmpty()) { evaluated: !children.isEmpty() yes Evaluation Count:39 | yes Evaluation Count:37 |
| 37-39 |
3229 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:103 | yes Evaluation Count:39 |
| 39-103 |
3230 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
3231 | if (!w) evaluated: !w yes Evaluation Count:42 | yes Evaluation Count:61 |
| 42-61 |
3232 | continue; executed: continue; Execution Count:42 | 42 |
3233 | if (w->testAttribute(Qt::WA_SetLocale)) evaluated: w->testAttribute(Qt::WA_SetLocale) yes Evaluation Count:1 | yes Evaluation Count:60 |
| 1-60 |
3234 | continue; executed: continue; Execution Count:1 | 1 |
3235 | if (w->isWindow() && !w->testAttribute(Qt::WA_WindowPropagation)) evaluated: w->isWindow() yes Evaluation Count:2 | yes Evaluation Count:58 |
partially evaluated: !w->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-58 |
3236 | continue; executed: continue; Execution Count:2 | 2 |
3237 | w->d_func()->setLocale_helper(loc, forceUpdate); | - |
3238 | } executed: } Execution Count:58 | 58 |
3239 | } executed: } Execution Count:39 | 39 |
3240 | QEvent e(QEvent::LocaleChange); | - |
3241 | QApplication::sendEvent(q, &e); | - |
3242 | } executed: } Execution Count:76 | 76 |
3243 | | - |
3244 | void QWidget::setLocale(const QLocale &locale) | - |
3245 | { | - |
3246 | QWidgetPrivate * const d = d_func(); | - |
3247 | | - |
3248 | setAttribute(Qt::WA_SetLocale); | - |
3249 | d->setLocale_helper(locale); | - |
3250 | } executed: } Execution Count:11 | 11 |
3251 | | - |
3252 | QLocale QWidget::locale() const | - |
3253 | { | - |
3254 | const QWidgetPrivate * const d = d_func(); | - |
3255 | | - |
3256 | return d->locale; executed: return d->locale; Execution Count:92980 | 92980 |
3257 | } | - |
3258 | | - |
3259 | void QWidgetPrivate::resolveLocale() | - |
3260 | { | - |
3261 | const QWidget * const q = q_func(); | - |
3262 | | - |
3263 | if (!q->testAttribute(Qt::WA_SetLocale)) { evaluated: !q->testAttribute(Qt::WA_SetLocale) yes Evaluation Count:41907 | yes Evaluation Count:1 |
| 1-41907 |
3264 | setLocale_helper(q->isWindow() | - |
3265 | ? QLocale() | - |
3266 | : q->parentWidget()->locale()); | - |
3267 | } executed: } Execution Count:41907 | 41907 |
3268 | } executed: } Execution Count:41908 | 41908 |
3269 | | - |
3270 | void QWidget::unsetLocale() | - |
3271 | { | - |
3272 | QWidgetPrivate * const d = d_func(); | - |
3273 | setAttribute(Qt::WA_SetLocale, false); | - |
3274 | d->resolveLocale(); | - |
3275 | } executed: } Execution Count:2 | 2 |
3276 | QString QWidget::windowTitle() const | - |
3277 | { | - |
3278 | const QWidgetPrivate * const d = d_func(); | - |
3279 | if (d->extra && d->extra->topextra) { evaluated: d->extra yes Evaluation Count:7317 | yes Evaluation Count:796 |
evaluated: d->extra->topextra yes Evaluation Count:7055 | yes Evaluation Count:262 |
| 262-7317 |
3280 | if (!d->extra->topextra->caption.isEmpty()) evaluated: !d->extra->topextra->caption.isEmpty() yes Evaluation Count:1577 | yes Evaluation Count:5478 |
| 1577-5478 |
3281 | return d->extra->topextra->caption; executed: return d->extra->topextra->caption; Execution Count:1577 | 1577 |
3282 | if (!d->extra->topextra->filePath.isEmpty()) evaluated: !d->extra->topextra->filePath.isEmpty() yes Evaluation Count:20 | yes Evaluation Count:5458 |
| 20-5458 |
3283 | return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); executed: return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); Execution Count:20 | 20 |
3284 | } executed: } Execution Count:5458 | 5458 |
3285 | return QString(); executed: return QString(); Execution Count:6516 | 6516 |
3286 | } | - |
3287 | QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widget) | - |
3288 | { | - |
3289 | qt_noop(); | - |
3290 | | - |
3291 | | - |
3292 | | - |
3293 | | - |
3294 | | - |
3295 | QString cap = title; | - |
3296 | | - |
3297 | | - |
3298 | if (cap.isEmpty()) evaluated: cap.isEmpty() yes Evaluation Count:5533 | yes Evaluation Count:379 |
| 379-5533 |
3299 | return cap; executed: return cap; Execution Count:5533 | 5533 |
3300 | | - |
3301 | QLatin1String placeHolder("[*]"); | - |
3302 | int index = cap.indexOf(placeHolder); | - |
3303 | | - |
3304 | | - |
3305 | while (index != -1) { evaluated: index != -1 yes Evaluation Count:3 | yes Evaluation Count:379 |
| 3-379 |
3306 | index += placeHolder.size(); | - |
3307 | int count = 1; | - |
3308 | while (cap.indexOf(placeHolder, index) == index) { partially evaluated: cap.indexOf(placeHolder, index) == index no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3309 | ++count; | - |
3310 | index += placeHolder.size(); | - |
3311 | } | 0 |
3312 | | - |
3313 | if (count%2) { partially evaluated: count%2 yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
3314 | int lastIndex = cap.lastIndexOf(placeHolder, index - 1); | - |
3315 | if (widget->isWindowModified() partially evaluated: widget->isWindowModified() no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3316 | && widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget)) never evaluated: widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget) | 0 |
3317 | cap.replace(lastIndex, 3, QWidget::tr("*")); never executed: cap.replace(lastIndex, 3, QWidget::tr("*")); | 0 |
3318 | else | - |
3319 | cap.remove(lastIndex, 3); executed: cap.remove(lastIndex, 3); Execution Count:3 | 3 |
3320 | } | - |
3321 | | - |
3322 | index = cap.indexOf(placeHolder, index); | - |
3323 | } executed: } Execution Count:3 | 3 |
3324 | | - |
3325 | cap.replace(QLatin1String("[*][*]"), placeHolder); | - |
3326 | | - |
3327 | return cap; executed: return cap; Execution Count:379 | 379 |
3328 | } | - |
3329 | | - |
3330 | void QWidgetPrivate::setWindowTitle_helper(const QString &title) | - |
3331 | { | - |
3332 | QWidget * const q = q_func(); | - |
3333 | if (q->testAttribute(Qt::WA_WState_Created)) evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:3047 | yes Evaluation Count:468 |
| 468-3047 |
3334 | setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); executed: setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); Execution Count:3047 | 3047 |
3335 | } executed: } Execution Count:3515 | 3515 |
3336 | | - |
3337 | void QWidgetPrivate::setWindowIconText_helper(const QString &title) | - |
3338 | { | - |
3339 | QWidget * const q = q_func(); | - |
3340 | if (q->testAttribute(Qt::WA_WState_Created)) partially evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2810 | no Evaluation Count:0 |
| 0-2810 |
3341 | setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); executed: setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); Execution Count:2810 | 2810 |
3342 | } executed: } Execution Count:2810 | 2810 |
3343 | | - |
3344 | void QWidget::setWindowIconText(const QString &iconText) | - |
3345 | { | - |
3346 | if (QWidget::windowIconText() == iconText) never evaluated: QWidget::windowIconText() == iconText | 0 |
3347 | return; | 0 |
3348 | | - |
3349 | QWidgetPrivate * const d = d_func(); | - |
3350 | d->topData()->iconText = iconText; | - |
3351 | d->setWindowIconText_helper(iconText); | - |
3352 | | - |
3353 | QEvent e(QEvent::IconTextChange); | - |
3354 | QApplication::sendEvent(this, &e); | - |
3355 | } | 0 |
3356 | | - |
3357 | void QWidget::setWindowTitle(const QString &title) | - |
3358 | { | - |
3359 | if (QWidget::windowTitle() == title && !title.isEmpty() && !title.isNull()) evaluated: QWidget::windowTitle() == title yes Evaluation Count:365 | yes Evaluation Count:459 |
evaluated: !title.isEmpty() yes Evaluation Count:261 | yes Evaluation Count:104 |
partially evaluated: !title.isNull() yes Evaluation Count:261 | no Evaluation Count:0 |
| 0-459 |
3360 | return; executed: return; Execution Count:261 | 261 |
3361 | | - |
3362 | QWidgetPrivate * const d = d_func(); | - |
3363 | d->topData()->caption = title; | - |
3364 | d->setWindowTitle_helper(title); | - |
3365 | | - |
3366 | QEvent e(QEvent::WindowTitleChange); | - |
3367 | QApplication::sendEvent(this, &e); | - |
3368 | } executed: } Execution Count:563 | 563 |
3369 | QIcon QWidget::windowIcon() const | - |
3370 | { | - |
3371 | const QWidget *w = this; | - |
3372 | while (w) { evaluated: w yes Evaluation Count:4238 | yes Evaluation Count:3019 |
| 3019-4238 |
3373 | const QWidgetPrivate *d = w->d_func(); | - |
3374 | if (d->extra && d->extra->topextra && d->extra->topextra->icon) evaluated: d->extra yes Evaluation Count:3668 | yes Evaluation Count:570 |
evaluated: d->extra->topextra yes Evaluation Count:2965 | yes Evaluation Count:703 |
evaluated: d->extra->topextra->icon yes Evaluation Count:212 | yes Evaluation Count:2753 |
| 212-3668 |
3375 | return *d->extra->topextra->icon; executed: return *d->extra->topextra->icon; Execution Count:212 | 212 |
3376 | w = w->parentWidget(); | - |
3377 | } executed: } Execution Count:4026 | 4026 |
3378 | return QApplication::windowIcon(); executed: return QApplication::windowIcon(); Execution Count:3019 | 3019 |
3379 | } | - |
3380 | | - |
3381 | void QWidgetPrivate::setWindowIcon_helper() | - |
3382 | { | - |
3383 | QEvent e(QEvent::WindowIconChange); | - |
3384 | QApplication::sendEvent(q_func(), &e); | - |
3385 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:18 | yes Evaluation Count:112 |
| 18-112 |
3386 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
3387 | if (w && !w->isWindow()) partially evaluated: w yes Evaluation Count:18 | no Evaluation Count:0 |
evaluated: !w->isWindow() yes Evaluation Count:15 | yes Evaluation Count:3 |
| 0-18 |
3388 | QApplication::sendEvent(w, &e); executed: QApplication::sendEvent(w, &e); Execution Count:15 | 15 |
3389 | } executed: } Execution Count:18 | 18 |
3390 | } executed: } Execution Count:112 | 112 |
3391 | | - |
3392 | void QWidget::setWindowIcon(const QIcon &icon) | - |
3393 | { | - |
3394 | QWidgetPrivate * const d = d_func(); | - |
3395 | | - |
3396 | setAttribute(Qt::WA_SetWindowIcon, !icon.isNull()); | - |
3397 | d->createTLExtra(); | - |
3398 | | - |
3399 | if (!d->extra->topextra->icon) partially evaluated: !d->extra->topextra->icon yes Evaluation Count:104 | no Evaluation Count:0 |
| 0-104 |
3400 | d->extra->topextra->icon = new QIcon(); executed: d->extra->topextra->icon = new QIcon(); Execution Count:104 | 104 |
3401 | *d->extra->topextra->icon = icon; | - |
3402 | | - |
3403 | d->setWindowIcon_sys(); | - |
3404 | d->setWindowIcon_helper(); | - |
3405 | } executed: } Execution Count:104 | 104 |
3406 | QString QWidget::windowIconText() const | - |
3407 | { | - |
3408 | const QWidgetPrivate * const d = d_func(); | - |
3409 | return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString(); executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString(); Execution Count:2810 | 2810 |
3410 | } | - |
3411 | QString QWidget::windowFilePath() const | - |
3412 | { | - |
3413 | const QWidgetPrivate * const d = d_func(); | - |
3414 | return (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString(); executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString(); Execution Count:66 | 66 |
3415 | } | - |
3416 | | - |
3417 | void QWidget::setWindowFilePath(const QString &filePath) | - |
3418 | { | - |
3419 | if (filePath == windowFilePath()) evaluated: filePath == windowFilePath() yes Evaluation Count:3 | yes Evaluation Count:18 |
| 3-18 |
3420 | return; executed: return; Execution Count:3 | 3 |
3421 | | - |
3422 | QWidgetPrivate * const d = d_func(); | - |
3423 | | - |
3424 | d->createTLExtra(); | - |
3425 | d->extra->topextra->filePath = filePath; | - |
3426 | d->setWindowFilePath_helper(filePath); | - |
3427 | } executed: } Execution Count:18 | 18 |
3428 | | - |
3429 | void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath) | - |
3430 | { | - |
3431 | if (extra->topextra && extra->topextra->caption.isEmpty()) { partially evaluated: extra->topextra yes Evaluation Count:18 | no Evaluation Count:0 |
evaluated: extra->topextra->caption.isEmpty() yes Evaluation Count:14 | yes Evaluation Count:4 |
| 0-18 |
3432 | | - |
3433 | | - |
3434 | | - |
3435 | QWidget * const q = q_func(); | - |
3436 | (void)filePath;; | - |
3437 | setWindowTitle_helper(q->windowTitle()); | - |
3438 | | - |
3439 | } executed: } Execution Count:14 | 14 |
3440 | | - |
3441 | | - |
3442 | | - |
3443 | } executed: } Execution Count:18 | 18 |
3444 | | - |
3445 | | - |
3446 | | - |
3447 | | - |
3448 | | - |
3449 | | - |
3450 | | - |
3451 | QString QWidget::windowRole() const | - |
3452 | { | - |
3453 | const QWidgetPrivate * const d = d_func(); | - |
3454 | return (d->extra && d->extra->topextra) ? d->extra->topextra->role : QString(); never executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->role : QString(); | 0 |
3455 | } | - |
3456 | | - |
3457 | | - |
3458 | | - |
3459 | | - |
3460 | | - |
3461 | void QWidget::setWindowRole(const QString &role) | - |
3462 | { | - |
3463 | | - |
3464 | | - |
3465 | | - |
3466 | | - |
3467 | | - |
3468 | (void)role; | - |
3469 | | - |
3470 | } | 0 |
3471 | void QWidget::setFocusProxy(QWidget * w) | - |
3472 | { | - |
3473 | QWidgetPrivate * const d = d_func(); | - |
3474 | if (!w && !d->extra) evaluated: !w yes Evaluation Count:946 | yes Evaluation Count:7393 |
evaluated: !d->extra yes Evaluation Count:565 | yes Evaluation Count:381 |
| 381-7393 |
3475 | return; executed: return; Execution Count:565 | 565 |
3476 | | - |
3477 | for (QWidget* fp = w; fp; fp = fp->focusProxy()) { evaluated: fp yes Evaluation Count:7395 | yes Evaluation Count:7774 |
| 7395-7774 |
3478 | if (fp == this) { partially evaluated: fp == this no Evaluation Count:0 | yes Evaluation Count:7395 |
| 0-7395 |
3479 | QMessageLogger("kernel/qwidget.cpp", 5810, __PRETTY_FUNCTION__).warning("QWidget: %s (%s) already in focus proxy chain", metaObject()->className(), objectName().toLocal8Bit().constData()); | - |
3480 | return; | 0 |
3481 | } | - |
3482 | } executed: } Execution Count:7395 | 7395 |
3483 | | - |
3484 | d->createExtra(); | - |
3485 | d->extra->focus_proxy = w; | - |
3486 | } executed: } Execution Count:7774 | 7774 |
3487 | QWidget * QWidget::focusProxy() const | - |
3488 | { | - |
3489 | const QWidgetPrivate * const d = d_func(); | - |
3490 | return d->extra ? (QWidget *)d->extra->focus_proxy : 0; executed: return d->extra ? (QWidget *)d->extra->focus_proxy : 0; Execution Count:15060 | 15060 |
3491 | } | - |
3492 | bool QWidget::hasFocus() const | - |
3493 | { | - |
3494 | const QWidget* w = this; | - |
3495 | while (w->d_func()->extra && w->d_func()->extra->focus_proxy) evaluated: w->d_func()->extra yes Evaluation Count:194735 | yes Evaluation Count:303563 |
evaluated: w->d_func()->extra->focus_proxy yes Evaluation Count:33445 | yes Evaluation Count:161290 |
| 33445-303563 |
3496 | w = w->d_func()->extra->focus_proxy; executed: w = w->d_func()->extra->focus_proxy; Execution Count:33445 | 33445 |
3497 | if (QWidget *window = w->window()) { partially evaluated: QWidget *window = w->window() yes Evaluation Count:464853 | no Evaluation Count:0 |
| 0-464853 |
3498 | | - |
3499 | QWExtra *e = window->d_func()->extra; | - |
3500 | if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w) evaluated: e yes Evaluation Count:319494 | yes Evaluation Count:145359 |
evaluated: e->proxyWidget yes Evaluation Count:57 | yes Evaluation Count:319437 |
partially evaluated: e->proxyWidget->hasFocus() no Evaluation Count:0 | yes Evaluation Count:57 |
never evaluated: window->focusWidget() == w | 0-319494 |
3501 | return true; never executed: return true; | 0 |
3502 | | - |
3503 | } executed: } Execution Count:464853 | 464853 |
3504 | return (QApplication::focusWidget() == w); executed: return (QApplication::focusWidget() == w); Execution Count:464853 | 464853 |
3505 | } | - |
3506 | void QWidget::setFocus(Qt::FocusReason reason) | - |
3507 | { | - |
3508 | if (!isEnabled()) evaluated: !isEnabled() yes Evaluation Count:2 | yes Evaluation Count:6935 |
| 2-6935 |
3509 | return; executed: return; Execution Count:2 | 2 |
3510 | | - |
3511 | QWidget *f = this; | - |
3512 | while (f->d_func()->extra && f->d_func()->extra->focus_proxy) evaluated: f->d_func()->extra yes Evaluation Count:6015 | yes Evaluation Count:951 |
evaluated: f->d_func()->extra->focus_proxy yes Evaluation Count:31 | yes Evaluation Count:5984 |
| 31-6015 |
3513 | f = f->d_func()->extra->focus_proxy; executed: f = f->d_func()->extra->focus_proxy; Execution Count:31 | 31 |
3514 | | - |
3515 | if (QApplication::focusWidget() == f evaluated: QApplication::focusWidget() == f yes Evaluation Count:5052 | yes Evaluation Count:1883 |
| 1883-5052 |
3516 | | - |
3517 | | - |
3518 | | - |
3519 | ) | - |
3520 | return; executed: return; Execution Count:5052 | 5052 |
3521 | | - |
3522 | | - |
3523 | QWidget *previousProxyFocus = 0; | - |
3524 | if (QWExtra *topData = window()->d_func()->extra) { evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:1774 | yes Evaluation Count:109 |
| 109-1774 |
3525 | if (topData->proxyWidget && topData->proxyWidget->hasFocus()) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1774 |
never evaluated: topData->proxyWidget->hasFocus() | 0-1774 |
3526 | previousProxyFocus = topData->proxyWidget->widget()->focusWidget(); | - |
3527 | if (previousProxyFocus && previousProxyFocus->focusProxy()) never evaluated: previousProxyFocus never evaluated: previousProxyFocus->focusProxy() | 0 |
3528 | previousProxyFocus = previousProxyFocus->focusProxy(); never executed: previousProxyFocus = previousProxyFocus->focusProxy(); | 0 |
3529 | if (previousProxyFocus == this && !topData->proxyWidget->d_func()->proxyIsGivingFocus) never evaluated: previousProxyFocus == this never evaluated: !topData->proxyWidget->d_func()->proxyIsGivingFocus | 0 |
3530 | return; | 0 |
3531 | } | 0 |
3532 | } executed: } Execution Count:1774 | 1774 |
3533 | | - |
3534 | | - |
3535 | | - |
3536 | | - |
3537 | if (QWExtra *topData = window()->d_func()->extra) { evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:1774 | yes Evaluation Count:109 |
| 109-1774 |
3538 | if (topData->proxyWidget && !topData->proxyWidget->hasFocus()) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1774 |
never evaluated: !topData->proxyWidget->hasFocus() | 0-1774 |
3539 | f->d_func()->updateFocusChild(); | - |
3540 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 1; | - |
3541 | topData->proxyWidget->setFocus(reason); | - |
3542 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 0; | - |
3543 | } | 0 |
3544 | } executed: } Execution Count:1774 | 1774 |
3545 | | - |
3546 | | - |
3547 | if (f->isActiveWindow()) { evaluated: f->isActiveWindow() yes Evaluation Count:897 | yes Evaluation Count:986 |
| 897-986 |
3548 | QWidget *prev = QApplicationPrivate::focus_widget; | - |
3549 | if (prev) { evaluated: prev yes Evaluation Count:319 | yes Evaluation Count:578 |
| 319-578 |
3550 | if (reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason evaluated: reason != Qt::PopupFocusReason yes Evaluation Count:309 | yes Evaluation Count:10 |
evaluated: reason != Qt::MenuBarFocusReason yes Evaluation Count:306 | yes Evaluation Count:3 |
| 3-309 |
3551 | && prev->testAttribute(Qt::WA_InputMethodEnabled)) { evaluated: prev->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:148 | yes Evaluation Count:158 |
| 148-158 |
3552 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
3553 | } executed: } Execution Count:148 | 148 |
3554 | | - |
3555 | if (reason != Qt::NoFocusReason) { evaluated: reason != Qt::NoFocusReason yes Evaluation Count:318 | yes Evaluation Count:1 |
| 1-318 |
3556 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, reason); | - |
3557 | QApplication::sendEvent(prev, &focusAboutToChange); | - |
3558 | } executed: } Execution Count:318 | 318 |
3559 | } executed: } Execution Count:319 | 319 |
3560 | | - |
3561 | f->d_func()->updateFocusChild(); | - |
3562 | | - |
3563 | QApplicationPrivate::setFocusWidget(f, reason); | - |
3564 | if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) evaluated: f->inherits("QMenuBar") yes Evaluation Count:16 | yes Evaluation Count:881 |
evaluated: f->inherits("QMenu") yes Evaluation Count:11 | yes Evaluation Count:870 |
partially evaluated: f->inherits("QMenuItem") no Evaluation Count:0 | yes Evaluation Count:870 |
| 0-881 |
3565 | | - |
3566 | { | - |
3567 | QAccessibleEvent event(f, QAccessible::Focus); | - |
3568 | QAccessible::updateAccessibility(&event); | - |
3569 | } executed: } Execution Count:870 | 870 |
3570 | | - |
3571 | | - |
3572 | if (QWExtra *topData = window()->d_func()->extra) { partially evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:897 | no Evaluation Count:0 |
| 0-897 |
3573 | if (topData->proxyWidget) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:897 |
| 0-897 |
3574 | if (previousProxyFocus && previousProxyFocus != f) { never evaluated: previousProxyFocus never evaluated: previousProxyFocus != f | 0 |
3575 | | - |
3576 | QFocusEvent event(QEvent::FocusOut, reason); | - |
3577 | QPointer<QWidget> that = previousProxyFocus; | - |
3578 | QApplication::sendEvent(previousProxyFocus, &event); | - |
3579 | if (that) | 0 |
3580 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 |
3581 | } | 0 |
3582 | if (!isHidden()) { never evaluated: !isHidden() | 0 |
3583 | | - |
3584 | | - |
3585 | if (QWExtra *topData = window()->d_func()->extra) never evaluated: QWExtra *topData = window()->d_func()->extra | 0 |
3586 | if (topData->proxyWidget && topData->proxyWidget->hasFocus()) never evaluated: topData->proxyWidget never evaluated: topData->proxyWidget->hasFocus() | 0 |
3587 | topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); never executed: topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); | 0 |
3588 | | - |
3589 | | - |
3590 | QFocusEvent event(QEvent::FocusIn, reason); | - |
3591 | QPointer<QWidget> that = f; | - |
3592 | QApplication::sendEvent(f, &event); | - |
3593 | if (that) | 0 |
3594 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 |
3595 | } | 0 |
3596 | } | 0 |
3597 | } executed: } Execution Count:897 | 897 |
3598 | | - |
3599 | } else { executed: } Execution Count:897 | 897 |
3600 | f->d_func()->updateFocusChild(); | - |
3601 | } executed: } Execution Count:986 | 986 |
3602 | | - |
3603 | if (QTLWExtra *extra = f->window()->d_func()->maybeTopData()) { evaluated: QTLWExtra *extra = f->window()->d_func()->maybeTopData() yes Evaluation Count:1554 | yes Evaluation Count:329 |
| 329-1554 |
3604 | if (extra->window) partially evaluated: extra->window yes Evaluation Count:1554 | no Evaluation Count:0 |
| 0-1554 |
3605 | extra->window->focusObjectChanged(f); executed: extra->window->focusObjectChanged(f); Execution Count:1554 | 1554 |
3606 | } executed: } Execution Count:1554 | 1554 |
3607 | } executed: } Execution Count:1883 | 1883 |
3608 | | - |
3609 | | - |
3610 | void QWidgetPrivate::updateFocusChild() | - |
3611 | { | - |
3612 | QWidget * const q = q_func(); | - |
3613 | | - |
3614 | QWidget *w = q; | - |
3615 | if (q->isHidden()) { evaluated: q->isHidden() yes Evaluation Count:98 | yes Evaluation Count:1785 |
| 98-1785 |
3616 | while (w && w->isHidden()) { evaluated: w yes Evaluation Count:173 | yes Evaluation Count:59 |
evaluated: w->isHidden() yes Evaluation Count:134 | yes Evaluation Count:39 |
| 39-173 |
3617 | w->d_func()->focus_child = q; | - |
3618 | w = w->isWindow() ? 0 : w->parentWidget(); evaluated: w->isWindow() yes Evaluation Count:59 | yes Evaluation Count:75 |
| 59-75 |
3619 | } executed: } Execution Count:134 | 134 |
3620 | } else { executed: } Execution Count:98 | 98 |
3621 | while (w) { evaluated: w yes Evaluation Count:4341 | yes Evaluation Count:1785 |
| 1785-4341 |
3622 | w->d_func()->focus_child = q; | - |
3623 | w = w->isWindow() ? 0 : w->parentWidget(); evaluated: w->isWindow() yes Evaluation Count:1785 | yes Evaluation Count:2556 |
| 1785-2556 |
3624 | } executed: } Execution Count:4341 | 4341 |
3625 | } executed: } Execution Count:1785 | 1785 |
3626 | } | - |
3627 | void QWidget::clearFocus() | - |
3628 | { | - |
3629 | if (hasFocus()) { evaluated: hasFocus() yes Evaluation Count:1004 | yes Evaluation Count:40719 |
| 1004-40719 |
3630 | if (testAttribute(Qt::WA_InputMethodEnabled)) evaluated: testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:120 | yes Evaluation Count:884 |
| 120-884 |
3631 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); Execution Count:120 | 120 |
3632 | | - |
3633 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); | - |
3634 | QApplication::sendEvent(this, &focusAboutToChange); | - |
3635 | } executed: } Execution Count:1004 | 1004 |
3636 | | - |
3637 | QWidget *w = this; | - |
3638 | while (w) { evaluated: w yes Evaluation Count:129632 | yes Evaluation Count:41723 |
| 41723-129632 |
3639 | if (w->d_func()->focus_child == this) evaluated: w->d_func()->focus_child == this yes Evaluation Count:2032 | yes Evaluation Count:127600 |
| 2032-127600 |
3640 | w->d_func()->focus_child = 0; executed: w->d_func()->focus_child = 0; Execution Count:2032 | 2032 |
3641 | w = w->parentWidget(); | - |
3642 | } executed: } Execution Count:129632 | 129632 |
3643 | | - |
3644 | QWExtra *topData = d_func()->extra; | - |
3645 | if (topData && topData->proxyWidget) evaluated: topData yes Evaluation Count:16603 | yes Evaluation Count:25120 |
partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:16603 |
| 0-25120 |
3646 | topData->proxyWidget->clearFocus(); never executed: topData->proxyWidget->clearFocus(); | 0 |
3647 | | - |
3648 | | - |
3649 | if (hasFocus()) { evaluated: hasFocus() yes Evaluation Count:1004 | yes Evaluation Count:40719 |
| 1004-40719 |
3650 | | - |
3651 | QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); | - |
3652 | | - |
3653 | | - |
3654 | | - |
3655 | | - |
3656 | | - |
3657 | { | - |
3658 | | - |
3659 | QAccessibleEvent event(this, QAccessible::Focus); | - |
3660 | QAccessible::updateAccessibility(&event); | - |
3661 | | - |
3662 | } | - |
3663 | } executed: } Execution Count:1004 | 1004 |
3664 | } executed: } Execution Count:41723 | 41723 |
3665 | bool QWidget::focusNextPrevChild(bool next) | - |
3666 | { | - |
3667 | QWidgetPrivate * const d = d_func(); | - |
3668 | QWidget* p = parentWidget(); | - |
3669 | bool isSubWindow = (windowType() == Qt::SubWindow); | - |
3670 | if (!isWindow() && !isSubWindow && p) evaluated: !isWindow() yes Evaluation Count:410 | yes Evaluation Count:176 |
evaluated: !isSubWindow yes Evaluation Count:272 | yes Evaluation Count:138 |
partially evaluated: p yes Evaluation Count:272 | no Evaluation Count:0 |
| 0-410 |
3671 | return p->focusNextPrevChild(next); executed: return p->focusNextPrevChild(next); Execution Count:272 | 272 |
3672 | | - |
3673 | if (d->extra && d->extra->proxyWidget) evaluated: d->extra yes Evaluation Count:313 | yes Evaluation Count:1 |
partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:313 |
| 0-313 |
3674 | return d->extra->proxyWidget->focusNextPrevChild(next); never executed: return d->extra->proxyWidget->focusNextPrevChild(next); | 0 |
3675 | | - |
3676 | QWidget *w = QApplicationPrivate::focusNextPrevChild_helper(this, next); | - |
3677 | if (!w) return false; evaluated: !w yes Evaluation Count:263 | yes Evaluation Count:51 |
executed: return false; Execution Count:263 | 51-263 |
3678 | | - |
3679 | w->setFocus(next ? Qt::TabFocusReason : Qt::BacktabFocusReason); | - |
3680 | return true; executed: return true; Execution Count:51 | 51 |
3681 | } | - |
3682 | QWidget *QWidget::focusWidget() const | - |
3683 | { | - |
3684 | return const_cast<QWidget *>(d_func()->focus_child); executed: return const_cast<QWidget *>(d_func()->focus_child); Execution Count:64948 | 64948 |
3685 | } | - |
3686 | | - |
3687 | | - |
3688 | | - |
3689 | | - |
3690 | | - |
3691 | | - |
3692 | QWidget *QWidget::nextInFocusChain() const | - |
3693 | { | - |
3694 | return const_cast<QWidget *>(d_func()->focus_next); executed: return const_cast<QWidget *>(d_func()->focus_next); Execution Count:34153 | 34153 |
3695 | } | - |
3696 | QWidget *QWidget::previousInFocusChain() const | - |
3697 | { | - |
3698 | return const_cast<QWidget *>(d_func()->focus_prev); executed: return const_cast<QWidget *>(d_func()->focus_prev); Execution Count:18 | 18 |
3699 | } | - |
3700 | bool QWidget::isActiveWindow() const | - |
3701 | { | - |
3702 | QWidget *tlw = window(); | - |
3703 | if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) evaluated: tlw == QApplication::activeWindow() yes Evaluation Count:170902 | yes Evaluation Count:352690 |
evaluated: isVisible() yes Evaluation Count:177825 | yes Evaluation Count:174865 |
evaluated: (tlw->windowType() == Qt::Popup) yes Evaluation Count:7798 | yes Evaluation Count:170027 |
| 7798-352690 |
3704 | return true; executed: return true; Execution Count:178700 | 178700 |
3705 | | - |
3706 | | - |
3707 | if (QWExtra *tlwExtra = tlw->d_func()->extra) { evaluated: QWExtra *tlwExtra = tlw->d_func()->extra yes Evaluation Count:225081 | yes Evaluation Count:119811 |
| 119811-225081 |
3708 | if (isVisible() && tlwExtra->proxyWidget) evaluated: isVisible() yes Evaluation Count:170027 | yes Evaluation Count:55054 |
evaluated: tlwExtra->proxyWidget yes Evaluation Count:113 | yes Evaluation Count:169914 |
| 113-170027 |
3709 | return tlwExtra->proxyWidget->isActiveWindow(); executed: return tlwExtra->proxyWidget->isActiveWindow(); Execution Count:113 | 113 |
3710 | } executed: } Execution Count:224968 | 224968 |
3711 | | - |
3712 | | - |
3713 | if(style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, this)) { partially evaluated: style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, this) no Evaluation Count:0 | yes Evaluation Count:344779 |
| 0-344779 |
3714 | if(tlw->windowType() == Qt::Tool && never evaluated: tlw->windowType() == Qt::Tool | 0 |
3715 | !tlw->isModal() && never evaluated: !tlw->isModal() | 0 |
3716 | (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) never evaluated: !tlw->parentWidget() never evaluated: tlw->parentWidget()->isActiveWindow() | 0 |
3717 | return true; never executed: return true; | 0 |
3718 | QWidget *w = QApplication::activeWindow(); | - |
3719 | while(w && tlw->windowType() == Qt::Tool && never evaluated: tlw->windowType() == Qt::Tool | 0 |
3720 | !w->isModal() && w->parentWidget()) { never evaluated: !w->isModal() never evaluated: w->parentWidget() | 0 |
3721 | w = w->parentWidget()->window(); | - |
3722 | if(w == tlw) never evaluated: w == tlw | 0 |
3723 | return true; never executed: return true; | 0 |
3724 | } | 0 |
3725 | } | 0 |
3726 | | - |
3727 | | - |
3728 | | - |
3729 | | - |
3730 | | - |
3731 | | - |
3732 | if (const QWindow *w = tlw->windowHandle()) { evaluated: const QWindow *w = tlw->windowHandle() yes Evaluation Count:213397 | yes Evaluation Count:131382 |
| 131382-213397 |
3733 | if (w->handle()) evaluated: w->handle() yes Evaluation Count:194155 | yes Evaluation Count:19242 |
| 19242-194155 |
3734 | return w->handle()->isActive(); executed: return w->handle()->isActive(); Execution Count:194155 | 194155 |
3735 | } executed: } Execution Count:19242 | 19242 |
3736 | | - |
3737 | return false; executed: return false; Execution Count:150624 | 150624 |
3738 | } | - |
3739 | void QWidget::setTabOrder(QWidget* first, QWidget *second) | - |
3740 | { | - |
3741 | if (!first || !second || first->focusPolicy() == Qt::NoFocus || second->focusPolicy() == Qt::NoFocus) partially evaluated: !first no Evaluation Count:0 | yes Evaluation Count:3863 |
partially evaluated: !second no Evaluation Count:0 | yes Evaluation Count:3863 |
evaluated: first->focusPolicy() == Qt::NoFocus yes Evaluation Count:114 | yes Evaluation Count:3749 |
evaluated: second->focusPolicy() == Qt::NoFocus yes Evaluation Count:7 | yes Evaluation Count:3742 |
| 0-3863 |
3742 | return; executed: return; Execution Count:121 | 121 |
3743 | | - |
3744 | if (first->window() != second->window()) { partially evaluated: first->window() != second->window() no Evaluation Count:0 | yes Evaluation Count:3742 |
| 0-3742 |
3745 | QMessageLogger("kernel/qwidget.cpp", 6262, __PRETTY_FUNCTION__).warning("QWidget::setTabOrder: 'first' and 'second' must be in the same window"); | - |
3746 | return; | 0 |
3747 | } | - |
3748 | | - |
3749 | QWidget *fp = first->focusProxy(); | - |
3750 | if (fp) { evaluated: fp yes Evaluation Count:194 | yes Evaluation Count:3548 |
| 194-3548 |
3751 | | - |
3752 | | - |
3753 | | - |
3754 | | - |
3755 | QList<QWidget *> l = first->findChildren<QWidget *>(); | - |
3756 | for (int i = l.size()-1; i >= 0; --i) { partially evaluated: i >= 0 yes Evaluation Count:198 | no Evaluation Count:0 |
| 0-198 |
3757 | QWidget * next = l.at(i); | - |
3758 | if (next->window() == fp->window()) { partially evaluated: next->window() == fp->window() yes Evaluation Count:198 | no Evaluation Count:0 |
| 0-198 |
3759 | fp = next; | - |
3760 | if (fp->focusPolicy() != Qt::NoFocus) evaluated: fp->focusPolicy() != Qt::NoFocus yes Evaluation Count:194 | yes Evaluation Count:4 |
| 4-194 |
3761 | break; executed: break; Execution Count:194 | 194 |
3762 | } executed: } Execution Count:4 | 4 |
3763 | } executed: } Execution Count:4 | 4 |
3764 | first = fp; | - |
3765 | } executed: } Execution Count:194 | 194 |
3766 | | - |
3767 | if (fp == second) evaluated: fp == second yes Evaluation Count:1 | yes Evaluation Count:3741 |
| 1-3741 |
3768 | return; executed: return; Execution Count:1 | 1 |
3769 | | - |
3770 | if (QWidget *sp = second->focusProxy()) evaluated: QWidget *sp = second->focusProxy() yes Evaluation Count:193 | yes Evaluation Count:3548 |
| 193-3548 |
3771 | second = sp; executed: second = sp; Execution Count:193 | 193 |
3772 | | - |
3773 | | - |
3774 | QWidget *fn = first->d_func()->focus_next; | - |
3775 | | - |
3776 | if (fn == second || first == second) evaluated: fn == second yes Evaluation Count:2027 | yes Evaluation Count:1714 |
partially evaluated: first == second no Evaluation Count:0 | yes Evaluation Count:1714 |
| 0-2027 |
3777 | return; executed: return; Execution Count:2027 | 2027 |
3778 | | - |
3779 | QWidget *sp = second->d_func()->focus_prev; | - |
3780 | QWidget *sn = second->d_func()->focus_next; | - |
3781 | | - |
3782 | fn->d_func()->focus_prev = second; | - |
3783 | first->d_func()->focus_next = second; | - |
3784 | | - |
3785 | second->d_func()->focus_next = fn; | - |
3786 | second->d_func()->focus_prev = first; | - |
3787 | | - |
3788 | sp->d_func()->focus_next = sn; | - |
3789 | sn->d_func()->focus_prev = sp; | - |
3790 | | - |
3791 | | - |
3792 | qt_noop(); | - |
3793 | qt_noop(); | - |
3794 | | - |
3795 | qt_noop(); | - |
3796 | qt_noop(); | - |
3797 | } executed: } Execution Count:1714 | 1714 |
3798 | void QWidgetPrivate::reparentFocusWidgets(QWidget * oldtlw) | - |
3799 | { | - |
3800 | QWidget * const q = q_func(); | - |
3801 | if (oldtlw == q->window()) evaluated: oldtlw == q->window() yes Evaluation Count:1133 | yes Evaluation Count:40430 |
| 1133-40430 |
3802 | return; executed: return; Execution Count:1133 | 1133 |
3803 | | - |
3804 | if(focus_child) evaluated: focus_child yes Evaluation Count:10 | yes Evaluation Count:40420 |
| 10-40420 |
3805 | focus_child->clearFocus(); executed: focus_child->clearFocus(); Execution Count:10 | 10 |
3806 | | - |
3807 | | - |
3808 | QWidget *firstOld = 0; | - |
3809 | | - |
3810 | QWidget *o = 0; | - |
3811 | QWidget *n = q; | - |
3812 | | - |
3813 | bool prevWasNew = true; | - |
3814 | QWidget *w = focus_next; | - |
3815 | | - |
3816 | | - |
3817 | | - |
3818 | | - |
3819 | while (w != q) { evaluated: w != q yes Evaluation Count:9584 | yes Evaluation Count:40430 |
| 9584-40430 |
3820 | bool currentIsNew = q->isAncestorOf(w); | - |
3821 | if (currentIsNew) { evaluated: currentIsNew yes Evaluation Count:6447 | yes Evaluation Count:3137 |
| 3137-6447 |
3822 | if (!prevWasNew) { evaluated: !prevWasNew yes Evaluation Count:1 | yes Evaluation Count:6446 |
| 1-6446 |
3823 | | - |
3824 | n->d_func()->focus_next = w; | - |
3825 | w->d_func()->focus_prev = n; | - |
3826 | } executed: } Execution Count:1 | 1 |
3827 | n = w; | - |
3828 | } else { executed: } Execution Count:6447 | 6447 |
3829 | if (prevWasNew) { evaluated: prevWasNew yes Evaluation Count:310 | yes Evaluation Count:2827 |
| 310-2827 |
3830 | | - |
3831 | if (o) { evaluated: o yes Evaluation Count:1 | yes Evaluation Count:309 |
| 1-309 |
3832 | o->d_func()->focus_next = w; | - |
3833 | w->d_func()->focus_prev = o; | - |
3834 | } else { executed: } Execution Count:1 | 1 |
3835 | | - |
3836 | firstOld = w; | - |
3837 | } executed: } Execution Count:309 | 309 |
3838 | } | - |
3839 | o = w; | - |
3840 | } executed: } Execution Count:3137 | 3137 |
3841 | w = w->d_func()->focus_next; | - |
3842 | prevWasNew = currentIsNew; | - |
3843 | } executed: } Execution Count:9584 | 9584 |
3844 | | - |
3845 | | - |
3846 | if (firstOld) { evaluated: firstOld yes Evaluation Count:309 | yes Evaluation Count:40121 |
| 309-40121 |
3847 | o->d_func()->focus_next = firstOld; | - |
3848 | firstOld->d_func()->focus_prev = o; | - |
3849 | } executed: } Execution Count:309 | 309 |
3850 | | - |
3851 | if (!q->isWindow()) { evaluated: !q->isWindow() yes Evaluation Count:40294 | yes Evaluation Count:136 |
| 136-40294 |
3852 | QWidget *topLevel = q->window(); | - |
3853 | | - |
3854 | | - |
3855 | QWidget *prev = topLevel->d_func()->focus_prev; | - |
3856 | | - |
3857 | topLevel->d_func()->focus_prev = n; | - |
3858 | prev->d_func()->focus_next = q; | - |
3859 | | - |
3860 | focus_prev = prev; | - |
3861 | n->d_func()->focus_next = topLevel; | - |
3862 | } else { executed: } Execution Count:40294 | 40294 |
3863 | | - |
3864 | n->d_func()->focus_next = q; | - |
3865 | focus_prev = n; | - |
3866 | } executed: } Execution Count:136 | 136 |
3867 | | - |
3868 | } | - |
3869 | int QWidgetPrivate::pointToRect(const QPoint &p, const QRect &r) | - |
3870 | { | - |
3871 | int dx = 0; | - |
3872 | int dy = 0; | - |
3873 | if (p.x() < r.left()) never evaluated: p.x() < r.left() | 0 |
3874 | dx = r.left() - p.x(); never executed: dx = r.left() - p.x(); | 0 |
3875 | else if (p.x() > r.right()) never evaluated: p.x() > r.right() | 0 |
3876 | dx = p.x() - r.right(); never executed: dx = p.x() - r.right(); | 0 |
3877 | if (p.y() < r.top()) never evaluated: p.y() < r.top() | 0 |
3878 | dy = r.top() - p.y(); never executed: dy = r.top() - p.y(); | 0 |
3879 | else if (p.y() > r.bottom()) never evaluated: p.y() > r.bottom() | 0 |
3880 | dy = p.y() - r.bottom(); never executed: dy = p.y() - r.bottom(); | 0 |
3881 | return dx + dy; never executed: return dx + dy; | 0 |
3882 | } | - |
3883 | QSize QWidget::frameSize() const | - |
3884 | { | - |
3885 | const QWidgetPrivate * const d = d_func(); | - |
3886 | if (isWindow() && !(windowType() == Qt::Popup)) { never evaluated: isWindow() never evaluated: !(windowType() == Qt::Popup) | 0 |
3887 | QRect fs = d->frameStrut(); | - |
3888 | return QSize(data->crect.width() + fs.left() + fs.right(), | 0 |
3889 | data->crect.height() + fs.top() + fs.bottom()); never executed: return QSize(data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 |
3890 | } | - |
3891 | return data->crect.size(); never executed: return data->crect.size(); | 0 |
3892 | } | - |
3893 | void QWidget::move(const QPoint &p) | - |
3894 | { | - |
3895 | QWidgetPrivate * const d = d_func(); | - |
3896 | setAttribute(Qt::WA_Moved); | - |
3897 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:661 | yes Evaluation Count:559 |
| 559-661 |
3898 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:565 | yes Evaluation Count:96 |
| 96-565 |
3899 | d->topData()->posIncludesFrame = false; executed: d->topData()->posIncludesFrame = false; Execution Count:565 | 565 |
3900 | d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(), | - |
3901 | p.y() + geometry().y() - QWidget::y(), | - |
3902 | width(), height(), true); | - |
3903 | d->setDirtyOpaqueRegion(); | - |
3904 | } else { executed: } Execution Count:661 | 661 |
3905 | | - |
3906 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:228 | yes Evaluation Count:331 |
| 228-331 |
3907 | d->topData()->posIncludesFrame = true; executed: d->topData()->posIncludesFrame = true; Execution Count:228 | 228 |
3908 | data->crect.moveTopLeft(p); | - |
3909 | setAttribute(Qt::WA_PendingMoveEvent); | - |
3910 | } executed: } Execution Count:559 | 559 |
3911 | } | - |
3912 | | - |
3913 | | - |
3914 | | - |
3915 | | - |
3916 | | - |
3917 | | - |
3918 | | - |
3919 | void QWidget::resize(const QSize &s) | - |
3920 | { | - |
3921 | QWidgetPrivate * const d = d_func(); | - |
3922 | setAttribute(Qt::WA_Resized); | - |
3923 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2466 | yes Evaluation Count:5286 |
| 2466-5286 |
3924 | d->fixPosIncludesFrame(); | - |
3925 | d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false); | - |
3926 | d->setDirtyOpaqueRegion(); | - |
3927 | } else { executed: } Execution Count:2466 | 2466 |
3928 | data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize())); | - |
3929 | setAttribute(Qt::WA_PendingResizeEvent); | - |
3930 | } executed: } Execution Count:5286 | 5286 |
3931 | } | - |
3932 | | - |
3933 | void QWidget::setGeometry(const QRect &r) | - |
3934 | { | - |
3935 | QWidgetPrivate * const d = d_func(); | - |
3936 | setAttribute(Qt::WA_Resized); | - |
3937 | setAttribute(Qt::WA_Moved); | - |
3938 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:483 | yes Evaluation Count:63197 |
| 483-63197 |
3939 | d->topData()->posIncludesFrame = 0; executed: d->topData()->posIncludesFrame = 0; Execution Count:483 | 483 |
3940 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:25897 | yes Evaluation Count:37783 |
| 25897-37783 |
3941 | d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true); | - |
3942 | d->setDirtyOpaqueRegion(); | - |
3943 | } else { executed: } Execution Count:25897 | 25897 |
3944 | data->crect.setTopLeft(r.topLeft()); | - |
3945 | data->crect.setSize(r.size().boundedTo(maximumSize()).expandedTo(minimumSize())); | - |
3946 | setAttribute(Qt::WA_PendingMoveEvent); | - |
3947 | setAttribute(Qt::WA_PendingResizeEvent); | - |
3948 | } executed: } Execution Count:37783 | 37783 |
3949 | } | - |
3950 | QByteArray QWidget::saveGeometry() const | - |
3951 | { | - |
3952 | QByteArray array; | - |
3953 | QDataStream stream(&array, QIODevice::WriteOnly); | - |
3954 | stream.setVersion(QDataStream::Qt_4_0); | - |
3955 | const quint32 magicNumber = 0x1D9D0CB; | - |
3956 | quint16 majorVersion = 1; | - |
3957 | quint16 minorVersion = 0; | - |
3958 | stream << magicNumber | - |
3959 | << majorVersion | - |
3960 | << minorVersion | - |
3961 | | - |
3962 | | - |
3963 | | - |
3964 | | - |
3965 | << frameGeometry() | - |
3966 | << normalGeometry() | - |
3967 | | - |
3968 | << qint32(QApplication::desktop()->screenNumber(this)) | - |
3969 | << quint8(windowState() & Qt::WindowMaximized) | - |
3970 | << quint8(windowState() & Qt::WindowFullScreen); | - |
3971 | return array; executed: return array; Execution Count:5 | 5 |
3972 | } | - |
3973 | bool QWidget::restoreGeometry(const QByteArray &geometry) | - |
3974 | { | - |
3975 | if (geometry.size() < 4) evaluated: geometry.size() < 4 yes Evaluation Count:4 | yes Evaluation Count:10 |
| 4-10 |
3976 | return false; executed: return false; Execution Count:4 | 4 |
3977 | QDataStream stream(geometry); | - |
3978 | stream.setVersion(QDataStream::Qt_4_0); | - |
3979 | | - |
3980 | const quint32 magicNumber = 0x1D9D0CB; | - |
3981 | quint32 storedMagicNumber; | - |
3982 | stream >> storedMagicNumber; | - |
3983 | if (storedMagicNumber != magicNumber) evaluated: storedMagicNumber != magicNumber yes Evaluation Count:2 | yes Evaluation Count:8 |
| 2-8 |
3984 | return false; executed: return false; Execution Count:2 | 2 |
3985 | | - |
3986 | const quint16 currentMajorVersion = 1; | - |
3987 | quint16 majorVersion = 0; | - |
3988 | quint16 minorVersion = 0; | - |
3989 | | - |
3990 | stream >> majorVersion >> minorVersion; | - |
3991 | | - |
3992 | if (majorVersion != currentMajorVersion) partially evaluated: majorVersion != currentMajorVersion no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
3993 | return false; never executed: return false; | 0 |
3994 | | - |
3995 | | - |
3996 | QRect restoredFrameGeometry; | - |
3997 | QRect restoredNormalGeometry; | - |
3998 | qint32 restoredScreenNumber; | - |
3999 | quint8 maximized; | - |
4000 | quint8 fullScreen; | - |
4001 | | - |
4002 | stream >> restoredFrameGeometry | - |
4003 | >> restoredNormalGeometry | - |
4004 | >> restoredScreenNumber | - |
4005 | >> maximized | - |
4006 | >> fullScreen; | - |
4007 | | - |
4008 | const int frameHeight = 20; | - |
4009 | if (!restoredFrameGeometry.isValid()) partially evaluated: !restoredFrameGeometry.isValid() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4010 | restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); never executed: restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); | 0 |
4011 | | - |
4012 | if (!restoredNormalGeometry.isValid()) partially evaluated: !restoredNormalGeometry.isValid() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4013 | restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); never executed: restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); | 0 |
4014 | if (!restoredNormalGeometry.isValid()) { partially evaluated: !restoredNormalGeometry.isValid() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4015 | | - |
4016 | restoredNormalGeometry.setSize(restoredNormalGeometry | - |
4017 | .size() | - |
4018 | .expandedTo(d_func()->adjustedSize())); | - |
4019 | } | 0 |
4020 | | - |
4021 | const QDesktopWidget * const desktop = QApplication::desktop(); | - |
4022 | if (restoredScreenNumber >= desktop->numScreens()) partially evaluated: restoredScreenNumber >= desktop->numScreens() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4023 | restoredScreenNumber = desktop->primaryScreen(); never executed: restoredScreenNumber = desktop->primaryScreen(); | 0 |
4024 | | - |
4025 | const QRect availableGeometry = desktop->availableGeometry(restoredScreenNumber); | - |
4026 | if (!restoredFrameGeometry.intersects(availableGeometry)) { partially evaluated: !restoredFrameGeometry.intersects(availableGeometry) no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4027 | restoredFrameGeometry.moveBottom(qMin(restoredFrameGeometry.bottom(), availableGeometry.bottom())); | - |
4028 | restoredFrameGeometry.moveLeft(qMax(restoredFrameGeometry.left(), availableGeometry.left())); | - |
4029 | restoredFrameGeometry.moveRight(qMin(restoredFrameGeometry.right(), availableGeometry.right())); | - |
4030 | } | 0 |
4031 | restoredFrameGeometry.moveTop(qMax(restoredFrameGeometry.top(), availableGeometry.top())); | - |
4032 | | - |
4033 | if (!restoredNormalGeometry.intersects(availableGeometry)) { partially evaluated: !restoredNormalGeometry.intersects(availableGeometry) no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4034 | restoredNormalGeometry.moveBottom(qMin(restoredNormalGeometry.bottom(), availableGeometry.bottom())); | - |
4035 | restoredNormalGeometry.moveLeft(qMax(restoredNormalGeometry.left(), availableGeometry.left())); | - |
4036 | restoredNormalGeometry.moveRight(qMin(restoredNormalGeometry.right(), availableGeometry.right())); | - |
4037 | } | 0 |
4038 | restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight)); | - |
4039 | | - |
4040 | if (maximized || fullScreen) { evaluated: maximized yes Evaluation Count:2 | yes Evaluation Count:6 |
evaluated: fullScreen yes Evaluation Count:2 | yes Evaluation Count:4 |
| 2-6 |
4041 | | - |
4042 | | - |
4043 | | - |
4044 | | - |
4045 | | - |
4046 | setGeometry(restoredNormalGeometry); | - |
4047 | | - |
4048 | Qt::WindowStates ws = windowState(); | - |
4049 | if (maximized) evaluated: maximized yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
4050 | ws |= Qt::WindowMaximized; executed: ws |= Qt::WindowMaximized; Execution Count:2 | 2 |
4051 | if (fullScreen) evaluated: fullScreen yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
4052 | ws |= Qt::WindowFullScreen; executed: ws |= Qt::WindowFullScreen; Execution Count:2 | 2 |
4053 | setWindowState(ws); | - |
4054 | d_func()->topData()->normalGeometry = restoredNormalGeometry; | - |
4055 | } else { executed: } Execution Count:4 | 4 |
4056 | QPoint offset; | - |
4057 | | - |
4058 | | - |
4059 | | - |
4060 | | - |
4061 | setWindowState(windowState() & ~(Qt::WindowMaximized | Qt::WindowFullScreen)); | - |
4062 | move(restoredFrameGeometry.topLeft() + offset); | - |
4063 | resize(restoredNormalGeometry.size()); | - |
4064 | } executed: } Execution Count:4 | 4 |
4065 | return true; executed: return true; Execution Count:8 | 8 |
4066 | } | - |
4067 | void QWidget::setContentsMargins(int left, int top, int right, int bottom) | - |
4068 | { | - |
4069 | QWidgetPrivate * const d = d_func(); | - |
4070 | if (left == d->leftmargin && top == d->topmargin evaluated: left == d->leftmargin yes Evaluation Count:37120 | yes Evaluation Count:8580 |
evaluated: top == d->topmargin yes Evaluation Count:37014 | yes Evaluation Count:106 |
| 106-37120 |
4071 | && right == d->rightmargin && bottom == d->bottommargin) evaluated: right == d->rightmargin yes Evaluation Count:37013 | yes Evaluation Count:1 |
partially evaluated: bottom == d->bottommargin yes Evaluation Count:37013 | no Evaluation Count:0 |
| 0-37013 |
4072 | return; executed: return; Execution Count:37013 | 37013 |
4073 | d->leftmargin = left; | - |
4074 | d->topmargin = top; | - |
4075 | d->rightmargin = right; | - |
4076 | d->bottommargin = bottom; | - |
4077 | | - |
4078 | if (QLayout *l=d->layout) evaluated: QLayout *l=d->layout yes Evaluation Count:590 | yes Evaluation Count:8097 |
| 590-8097 |
4079 | l->update(); executed: l->update(); Execution Count:590 | 590 |
4080 | else | - |
4081 | updateGeometry(); executed: updateGeometry(); Execution Count:8097 | 8097 |
4082 | | - |
4083 | if (isVisible()) { evaluated: isVisible() yes Evaluation Count:7 | yes Evaluation Count:8680 |
| 7-8680 |
4084 | update(); | - |
4085 | QResizeEvent e(data->crect.size(), data->crect.size()); | - |
4086 | QApplication::sendEvent(this, &e); | - |
4087 | } else { executed: } Execution Count:7 | 7 |
4088 | setAttribute(Qt::WA_PendingResizeEvent, true); | - |
4089 | } executed: } Execution Count:8680 | 8680 |
4090 | | - |
4091 | QEvent e(QEvent::ContentsRectChange); | - |
4092 | QApplication::sendEvent(this, &e); | - |
4093 | } executed: } Execution Count:8687 | 8687 |
4094 | void QWidget::setContentsMargins(const QMargins &margins) | - |
4095 | { | - |
4096 | setContentsMargins(margins.left(), margins.top(), | - |
4097 | margins.right(), margins.bottom()); | - |
4098 | } | 0 |
4099 | | - |
4100 | | - |
4101 | | - |
4102 | | - |
4103 | | - |
4104 | | - |
4105 | | - |
4106 | void QWidget::getContentsMargins(int *left, int *top, int *right, int *bottom) const | - |
4107 | { | - |
4108 | const QWidgetPrivate * const d = d_func(); | - |
4109 | if (left) evaluated: left yes Evaluation Count:3323 | yes Evaluation Count:2 |
| 2-3323 |
4110 | *left = d->leftmargin; executed: *left = d->leftmargin; Execution Count:3323 | 3323 |
4111 | if (top) evaluated: top yes Evaluation Count:3240 | yes Evaluation Count:85 |
| 85-3240 |
4112 | *top = d->topmargin; executed: *top = d->topmargin; Execution Count:3240 | 3240 |
4113 | if (right) evaluated: right yes Evaluation Count:3323 | yes Evaluation Count:2 |
| 2-3323 |
4114 | *right = d->rightmargin; executed: *right = d->rightmargin; Execution Count:3323 | 3323 |
4115 | if (bottom) evaluated: bottom yes Evaluation Count:3240 | yes Evaluation Count:85 |
| 85-3240 |
4116 | *bottom = d->bottommargin; executed: *bottom = d->bottommargin; Execution Count:3240 | 3240 |
4117 | } executed: } Execution Count:3325 | 3325 |
4118 | QMargins QWidget::contentsMargins() const | - |
4119 | { | - |
4120 | const QWidgetPrivate * const d = d_func(); | - |
4121 | return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin); never executed: return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin); | 0 |
4122 | } | - |
4123 | | - |
4124 | | - |
4125 | | - |
4126 | | - |
4127 | | - |
4128 | | - |
4129 | | - |
4130 | QRect QWidget::contentsRect() const | - |
4131 | { | - |
4132 | const QWidgetPrivate * const d = d_func(); | - |
4133 | return QRect(QPoint(d->leftmargin, d->topmargin), | 260960 |
4134 | QPoint(data->crect.width() - 1 - d->rightmargin, | 260960 |
4135 | data->crect.height() - 1 - d->bottommargin)); executed: return QRect(QPoint(d->leftmargin, d->topmargin), QPoint(data->crect.width() - 1 - d->rightmargin, data->crect.height() - 1 - d->bottommargin)); Execution Count:260960 | 260960 |
4136 | | - |
4137 | } | - |
4138 | Qt::ContextMenuPolicy QWidget::contextMenuPolicy() const | - |
4139 | { | - |
4140 | return (Qt::ContextMenuPolicy)data->context_menu_policy; executed: return (Qt::ContextMenuPolicy)data->context_menu_policy; Execution Count:34 | 34 |
4141 | } | - |
4142 | | - |
4143 | void QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy policy) | - |
4144 | { | - |
4145 | data->context_menu_policy = (uint) policy; | - |
4146 | } executed: } Execution Count:1300 | 1300 |
4147 | Qt::FocusPolicy QWidget::focusPolicy() const | - |
4148 | { | - |
4149 | return (Qt::FocusPolicy)data->focus_policy; executed: return (Qt::FocusPolicy)data->focus_policy; Execution Count:66995 | 66995 |
4150 | } | - |
4151 | | - |
4152 | void QWidget::setFocusPolicy(Qt::FocusPolicy policy) | - |
4153 | { | - |
4154 | data->focus_policy = (uint) policy; | - |
4155 | QWidgetPrivate * const d = d_func(); | - |
4156 | if (d->extra && d->extra->focus_proxy) evaluated: d->extra yes Evaluation Count:2115 | yes Evaluation Count:26505 |
evaluated: d->extra->focus_proxy yes Evaluation Count:860 | yes Evaluation Count:1255 |
| 860-26505 |
4157 | d->extra->focus_proxy->setFocusPolicy(policy); executed: d->extra->focus_proxy->setFocusPolicy(policy); Execution Count:860 | 860 |
4158 | } executed: } Execution Count:28620 | 28620 |
4159 | void QWidget::setUpdatesEnabled(bool enable) | - |
4160 | { | - |
4161 | QWidgetPrivate * const d = d_func(); | - |
4162 | setAttribute(Qt::WA_ForceUpdatesDisabled, !enable); | - |
4163 | d->setUpdatesEnabled_helper(enable); | - |
4164 | } executed: } Execution Count:2522 | 2522 |
4165 | void QWidget::show() | - |
4166 | { | - |
4167 | if (isWindow() && (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen()) evaluated: isWindow() yes Evaluation Count:2812 | yes Evaluation Count:11646 |
partially evaluated: (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen() no Evaluation Count:0 | yes Evaluation Count:2812 |
| 0-11646 |
4168 | showFullScreen(); never executed: showFullScreen(); | 0 |
4169 | else | - |
4170 | setVisible(true); executed: setVisible(true); Execution Count:14458 | 14458 |
4171 | } | - |
4172 | | - |
4173 | | - |
4174 | | - |
4175 | | - |
4176 | | - |
4177 | | - |
4178 | void QWidgetPrivate::show_recursive() | - |
4179 | { | - |
4180 | QWidget * const q = q_func(); | - |
4181 | | - |
4182 | | - |
4183 | if (!q->testAttribute(Qt::WA_WState_Created)) evaluated: !q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:725 | yes Evaluation Count:3706 |
| 725-3706 |
4184 | createRecursively(); executed: createRecursively(); Execution Count:725 | 725 |
4185 | q->ensurePolished(); | - |
4186 | | - |
4187 | if (!q->isWindow() && q->parentWidget()->d_func()->layout && !q->parentWidget()->data->in_show) partially evaluated: !q->isWindow() yes Evaluation Count:4431 | no Evaluation Count:0 |
evaluated: q->parentWidget()->d_func()->layout yes Evaluation Count:3339 | yes Evaluation Count:1092 |
partially evaluated: !q->parentWidget()->data->in_show no Evaluation Count:0 | yes Evaluation Count:3339 |
| 0-4431 |
4188 | q->parentWidget()->d_func()->layout->activate(); never executed: q->parentWidget()->d_func()->layout->activate(); | 0 |
4189 | | - |
4190 | if (layout) evaluated: layout yes Evaluation Count:1073 | yes Evaluation Count:3358 |
| 1073-3358 |
4191 | layout->activate(); executed: layout->activate(); Execution Count:1073 | 1073 |
4192 | | - |
4193 | show_helper(); | - |
4194 | } executed: } Execution Count:4431 | 4431 |
4195 | | - |
4196 | void QWidgetPrivate::sendPendingMoveAndResizeEvents(bool recursive, bool disableUpdates) | - |
4197 | { | - |
4198 | QWidget * const q = q_func(); | - |
4199 | | - |
4200 | disableUpdates = disableUpdates && q->updatesEnabled(); evaluated: disableUpdates yes Evaluation Count:1568 | yes Evaluation Count:14991 |
partially evaluated: q->updatesEnabled() yes Evaluation Count:1568 | no Evaluation Count:0 |
| 0-14991 |
4201 | if (disableUpdates) evaluated: disableUpdates yes Evaluation Count:1568 | yes Evaluation Count:14991 |
| 1568-14991 |
4202 | q->setAttribute(Qt::WA_UpdatesDisabled); executed: q->setAttribute(Qt::WA_UpdatesDisabled); Execution Count:1568 | 1568 |
4203 | | - |
4204 | if (q->testAttribute(Qt::WA_PendingMoveEvent)) { evaluated: q->testAttribute(Qt::WA_PendingMoveEvent) yes Evaluation Count:11797 | yes Evaluation Count:4762 |
| 4762-11797 |
4205 | QMoveEvent e(data.crect.topLeft(), data.crect.topLeft()); | - |
4206 | QApplication::sendEvent(q, &e); | - |
4207 | q->setAttribute(Qt::WA_PendingMoveEvent, false); | - |
4208 | } executed: } Execution Count:11797 | 11797 |
4209 | | - |
4210 | if (q->testAttribute(Qt::WA_PendingResizeEvent)) { evaluated: q->testAttribute(Qt::WA_PendingResizeEvent) yes Evaluation Count:11993 | yes Evaluation Count:4566 |
| 4566-11993 |
4211 | QResizeEvent e(data.crect.size(), QSize()); | - |
4212 | QApplication::sendEvent(q, &e); | - |
4213 | q->setAttribute(Qt::WA_PendingResizeEvent, false); | - |
4214 | } executed: } Execution Count:11993 | 11993 |
4215 | | - |
4216 | if (disableUpdates) evaluated: disableUpdates yes Evaluation Count:1568 | yes Evaluation Count:14991 |
| 1568-14991 |
4217 | q->setAttribute(Qt::WA_UpdatesDisabled, false); executed: q->setAttribute(Qt::WA_UpdatesDisabled, false); Execution Count:1568 | 1568 |
4218 | | - |
4219 | if (!recursive) evaluated: !recursive yes Evaluation Count:15150 | yes Evaluation Count:1409 |
| 1409-15150 |
4220 | return; executed: return; Execution Count:15150 | 15150 |
4221 | | - |
4222 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:1618 | yes Evaluation Count:1409 |
| 1409-1618 |
4223 | if (QWidget *child = qobject_cast<QWidget *>(children.at(i))) evaluated: QWidget *child = qobject_cast<QWidget *>(children.at(i)) yes Evaluation Count:1302 | yes Evaluation Count:316 |
| 316-1302 |
4224 | child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); executed: child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); Execution Count:1302 | 1302 |
4225 | } executed: } Execution Count:1618 | 1618 |
4226 | } executed: } Execution Count:1409 | 1409 |
4227 | | - |
4228 | void QWidgetPrivate::activateChildLayoutsRecursively() | - |
4229 | { | - |
4230 | sendPendingMoveAndResizeEvents(false, true); | - |
4231 | | - |
4232 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:137 | yes Evaluation Count:159 |
| 137-159 |
4233 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
4234 | if (!child || child->isHidden() || child->isWindow()) evaluated: !child yes Evaluation Count:2 | yes Evaluation Count:135 |
evaluated: child->isHidden() yes Evaluation Count:4 | yes Evaluation Count:131 |
partially evaluated: child->isWindow() no Evaluation Count:0 | yes Evaluation Count:131 |
| 0-135 |
4235 | continue; executed: continue; Execution Count:6 | 6 |
4236 | | - |
4237 | child->ensurePolished(); | - |
4238 | | - |
4239 | | - |
4240 | QWidgetPrivate *childPrivate = child->d_func(); | - |
4241 | if (childPrivate->layout) partially evaluated: childPrivate->layout no Evaluation Count:0 | yes Evaluation Count:131 |
| 0-131 |
4242 | childPrivate->layout->activate(); never executed: childPrivate->layout->activate(); | 0 |
4243 | | - |
4244 | | - |
4245 | const bool wasVisible = child->isVisible(); | - |
4246 | if (!wasVisible) partially evaluated: !wasVisible yes Evaluation Count:131 | no Evaluation Count:0 |
| 0-131 |
4247 | child->setAttribute(Qt::WA_WState_Visible); executed: child->setAttribute(Qt::WA_WState_Visible); Execution Count:131 | 131 |
4248 | | - |
4249 | | - |
4250 | childPrivate->activateChildLayoutsRecursively(); | - |
4251 | | - |
4252 | | - |
4253 | if (!wasVisible) partially evaluated: !wasVisible yes Evaluation Count:131 | no Evaluation Count:0 |
| 0-131 |
4254 | child->setAttribute(Qt::WA_WState_Visible, false); executed: child->setAttribute(Qt::WA_WState_Visible, false); Execution Count:131 | 131 |
4255 | } executed: } Execution Count:131 | 131 |
4256 | } executed: } Execution Count:159 | 159 |
4257 | | - |
4258 | void QWidgetPrivate::show_helper() | - |
4259 | { | - |
4260 | QWidget * const q = q_func(); | - |
4261 | data.in_show = true; | - |
4262 | | - |
4263 | sendPendingMoveAndResizeEvents(); | - |
4264 | | - |
4265 | | - |
4266 | q->setAttribute(Qt::WA_WState_Visible); | - |
4267 | | - |
4268 | | - |
4269 | showChildren(false); | - |
4270 | | - |
4271 | | - |
4272 | | - |
4273 | | - |
4274 | | - |
4275 | | - |
4276 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:2545 | yes Evaluation Count:12446 |
| 2545-12446 |
4277 | if ((q->windowType() == Qt::Tool) || (q->windowType() == Qt::Popup) || q->windowType() == Qt::ToolTip) { evaluated: (q->windowType() == Qt::Tool) yes Evaluation Count:16 | yes Evaluation Count:2529 |
evaluated: (q->windowType() == Qt::Popup) yes Evaluation Count:96 | yes Evaluation Count:2433 |
evaluated: q->windowType() == Qt::ToolTip yes Evaluation Count:13 | yes Evaluation Count:2420 |
| 13-2529 |
4278 | q->raise(); | - |
4279 | if (q->parentWidget() && q->parentWidget()->window()->testAttribute(Qt::WA_KeyboardFocusChange)) evaluated: q->parentWidget() yes Evaluation Count:60 | yes Evaluation Count:65 |
evaluated: q->parentWidget()->window()->testAttribute(Qt::WA_KeyboardFocusChange) yes Evaluation Count:1 | yes Evaluation Count:59 |
| 1-65 |
4280 | q->setAttribute(Qt::WA_KeyboardFocusChange); executed: q->setAttribute(Qt::WA_KeyboardFocusChange); Execution Count:1 | 1 |
4281 | } else { executed: } Execution Count:125 | 125 |
4282 | while (QApplication::activePopupWidget()) { evaluated: QApplication::activePopupWidget() yes Evaluation Count:1 | yes Evaluation Count:2420 |
| 1-2420 |
4283 | if (!QApplication::activePopupWidget()->close()) partially evaluated: !QApplication::activePopupWidget()->close() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4284 | break; | 0 |
4285 | } executed: } Execution Count:1 | 1 |
4286 | } executed: } Execution Count:2420 | 2420 |
4287 | } | - |
4288 | | - |
4289 | | - |
4290 | | - |
4291 | bool isEmbedded = false; | - |
4292 | | - |
4293 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:2545 | yes Evaluation Count:12446 |
| 2545-12446 |
4294 | isEmbedded = q->graphicsProxyWidget() ? true : false; evaluated: q->graphicsProxyWidget() yes Evaluation Count:8 | yes Evaluation Count:2537 |
| 8-2537 |
4295 | if (!isEmbedded && !bypassGraphicsProxyWidget(q)) { evaluated: !isEmbedded yes Evaluation Count:2537 | yes Evaluation Count:8 |
evaluated: !bypassGraphicsProxyWidget(q) yes Evaluation Count:2529 | yes Evaluation Count:8 |
| 8-2537 |
4296 | QGraphicsProxyWidget *ancestorProxy = nearestGraphicsProxyWidget(q->parentWidget()); | - |
4297 | if (ancestorProxy) { partially evaluated: ancestorProxy no Evaluation Count:0 | yes Evaluation Count:2529 |
| 0-2529 |
4298 | isEmbedded = true; | - |
4299 | ancestorProxy->d_func()->embedSubWindow(q); | - |
4300 | } | 0 |
4301 | } executed: } Execution Count:2529 | 2529 |
4302 | } executed: } Execution Count:2545 | 2545 |
4303 | QShowEvent showEvent; | - |
4304 | QApplication::sendEvent(q, &showEvent); | - |
4305 | | - |
4306 | show_sys(); | - |
4307 | | - |
4308 | if (!isEmbedded && q->windowType() == Qt::Popup) evaluated: !isEmbedded yes Evaluation Count:14983 | yes Evaluation Count:8 |
evaluated: q->windowType() == Qt::Popup yes Evaluation Count:96 | yes Evaluation Count:14887 |
| 8-14983 |
4309 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q); Execution Count:96 | 96 |
4310 | | - |
4311 | | - |
4312 | if (q->windowType() != Qt::ToolTip) { evaluated: q->windowType() != Qt::ToolTip yes Evaluation Count:14978 | yes Evaluation Count:13 |
| 13-14978 |
4313 | QAccessibleEvent event(q, QAccessible::ObjectShow); | - |
4314 | QAccessible::updateAccessibility(&event); | - |
4315 | } executed: } Execution Count:14978 | 14978 |
4316 | | - |
4317 | | - |
4318 | if (QApplicationPrivate::hidden_focus_widget == q) { evaluated: QApplicationPrivate::hidden_focus_widget == q yes Evaluation Count:5 | yes Evaluation Count:14986 |
| 5-14986 |
4319 | QApplicationPrivate::hidden_focus_widget = 0; | - |
4320 | q->setFocus(Qt::OtherFocusReason); | - |
4321 | } executed: } Execution Count:5 | 5 |
4322 | | - |
4323 | | - |
4324 | | - |
4325 | | - |
4326 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->in_exec && q->windowType() == Qt::SplashScreen) evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->in_exec yes Evaluation Count:14856 | yes Evaluation Count:135 |
evaluated: q->windowType() == Qt::SplashScreen yes Evaluation Count:1 | yes Evaluation Count:14855 |
| 1-14856 |
4327 | QApplication::processEvents(); executed: QApplication::processEvents(); Execution Count:1 | 1 |
4328 | | - |
4329 | data.in_show = false; | - |
4330 | } executed: } Execution Count:14991 | 14991 |
4331 | void QWidget::hide() | - |
4332 | { | - |
4333 | setVisible(false); | - |
4334 | } executed: } Execution Count:7397 | 7397 |
4335 | | - |
4336 | | - |
4337 | | - |
4338 | void QWidgetPrivate::hide_helper() | - |
4339 | { | - |
4340 | QWidget * const q = q_func(); | - |
4341 | | - |
4342 | bool isEmbedded = false; | - |
4343 | | - |
4344 | isEmbedded = q->isWindow() && !bypassGraphicsProxyWidget(q) && nearestGraphicsProxyWidget(q->parentWidget()) != 0; evaluated: q->isWindow() yes Evaluation Count:2511 | yes Evaluation Count:1380 |
evaluated: !bypassGraphicsProxyWidget(q) yes Evaluation Count:2504 | yes Evaluation Count:7 |
partially evaluated: nearestGraphicsProxyWidget(q->parentWidget()) != 0 no Evaluation Count:0 | yes Evaluation Count:2504 |
| 0-2511 |
4345 | | - |
4346 | | - |
4347 | | - |
4348 | | - |
4349 | if (!isEmbedded && (q->windowType() == Qt::Popup)) partially evaluated: !isEmbedded yes Evaluation Count:3891 | no Evaluation Count:0 |
evaluated: (q->windowType() == Qt::Popup) yes Evaluation Count:95 | yes Evaluation Count:3796 |
| 0-3891 |
4350 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q); Execution Count:95 | 95 |
4351 | | - |
4352 | | - |
4353 | | - |
4354 | | - |
4355 | | - |
4356 | | - |
4357 | | - |
4358 | q->setAttribute(Qt::WA_Mapped, false); | - |
4359 | hide_sys(); | - |
4360 | | - |
4361 | bool wasVisible = q->testAttribute(Qt::WA_WState_Visible); | - |
4362 | | - |
4363 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:3527 | yes Evaluation Count:364 |
| 364-3527 |
4364 | q->setAttribute(Qt::WA_WState_Visible, false); | - |
4365 | | - |
4366 | } executed: } Execution Count:3527 | 3527 |
4367 | | - |
4368 | QHideEvent hideEvent; | - |
4369 | QApplication::sendEvent(q, &hideEvent); | - |
4370 | hideChildren(false); | - |
4371 | | - |
4372 | | - |
4373 | | - |
4374 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:3527 | yes Evaluation Count:364 |
| 364-3527 |
4375 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(q); | - |
4376 | QWidget *fw = QApplication::focusWidget(); | - |
4377 | while (fw && !fw->isWindow()) { evaluated: fw yes Evaluation Count:1128 | yes Evaluation Count:3012 |
evaluated: !fw->isWindow() yes Evaluation Count:787 | yes Evaluation Count:341 |
| 341-3012 |
4378 | if (fw == q) { evaluated: fw == q yes Evaluation Count:174 | yes Evaluation Count:613 |
| 174-613 |
4379 | q->focusNextPrevChild(true); | - |
4380 | break; executed: break; Execution Count:174 | 174 |
4381 | } | - |
4382 | fw = fw->parentWidget(); | - |
4383 | } executed: } Execution Count:613 | 613 |
4384 | } executed: } Execution Count:3527 | 3527 |
4385 | | - |
4386 | if (QWidgetBackingStore *bs = maybeBackingStore()) partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:3891 | no Evaluation Count:0 |
| 0-3891 |
4387 | bs->removeDirtyWidget(q); executed: bs->removeDirtyWidget(q); Execution Count:3891 | 3891 |
4388 | | - |
4389 | | - |
4390 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:3527 | yes Evaluation Count:364 |
| 364-3527 |
4391 | QAccessibleEvent event(q, QAccessible::ObjectHide); | - |
4392 | QAccessible::updateAccessibility(&event); | - |
4393 | } executed: } Execution Count:3527 | 3527 |
4394 | | - |
4395 | } executed: } Execution Count:3891 | 3891 |
4396 | void QWidget::setVisible(bool visible) | - |
4397 | { | - |
4398 | if (visible) { evaluated: visible yes Evaluation Count:26431 | yes Evaluation Count:72501 |
| 26431-72501 |
4399 | if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden)) evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:14265 | yes Evaluation Count:12166 |
evaluated: !testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:10348 | yes Evaluation Count:3917 |
| 3917-14265 |
4400 | return; executed: return; Execution Count:10348 | 10348 |
4401 | | - |
4402 | QWidgetPrivate * const d = d_func(); | - |
4403 | | - |
4404 | | - |
4405 | if (!isWindow() && parentWidget() && parentWidget()->isVisible() evaluated: !isWindow() yes Evaluation Count:13538 | yes Evaluation Count:2545 |
partially evaluated: parentWidget() yes Evaluation Count:13538 | no Evaluation Count:0 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:8015 | yes Evaluation Count:5523 |
| 0-13538 |
4406 | && !parentWidget()->testAttribute(Qt::WA_WState_Created)) partially evaluated: !parentWidget()->testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:8015 |
| 0-8015 |
4407 | parentWidget()->window()->d_func()->createRecursively(); never executed: parentWidget()->window()->d_func()->createRecursively(); | 0 |
4408 | | - |
4409 | | - |
4410 | | - |
4411 | QWidget *pw = parentWidget(); | - |
4412 | if (!testAttribute(Qt::WA_WState_Created) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:13819 | yes Evaluation Count:2264 |
| 2264-13819 |
4413 | && (isWindow() || pw->testAttribute(Qt::WA_WState_Created))) { evaluated: isWindow() yes Evaluation Count:2390 | yes Evaluation Count:11429 |
evaluated: pw->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:6674 | yes Evaluation Count:4755 |
| 2390-11429 |
4414 | create(); | - |
4415 | } executed: } Execution Count:9064 | 9064 |
4416 | | - |
4417 | | - |
4418 | | - |
4419 | | - |
4420 | | - |
4421 | | - |
4422 | bool wasResized = testAttribute(Qt::WA_Resized); | - |
4423 | Qt::WindowStates initialWindowState = windowState(); | - |
4424 | | - |
4425 | | - |
4426 | ensurePolished(); | - |
4427 | | - |
4428 | | - |
4429 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - |
4430 | | - |
4431 | bool needUpdateGeometry = !isWindow() && testAttribute(Qt::WA_WState_Hidden); evaluated: !isWindow() yes Evaluation Count:13538 | yes Evaluation Count:2545 |
evaluated: testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:4111 | yes Evaluation Count:9427 |
| 2545-13538 |
4432 | | - |
4433 | setAttribute(Qt::WA_WState_Hidden, false); | - |
4434 | | - |
4435 | if (needUpdateGeometry) evaluated: needUpdateGeometry yes Evaluation Count:4111 | yes Evaluation Count:11972 |
| 4111-11972 |
4436 | d->updateGeometry_helper(true); executed: d->updateGeometry_helper(true); Execution Count:4111 | 4111 |
4437 | | - |
4438 | | - |
4439 | if (d->layout) evaluated: d->layout yes Evaluation Count:3334 | yes Evaluation Count:12749 |
| 3334-12749 |
4440 | d->layout->activate(); executed: d->layout->activate(); Execution Count:3334 | 3334 |
4441 | | - |
4442 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:13538 | yes Evaluation Count:2545 |
| 2545-13538 |
4443 | QWidget *parent = parentWidget(); | - |
4444 | while (parent && parent->isVisible() && parent->d_func()->layout && !parent->data->in_show) { partially evaluated: parent yes Evaluation Count:13616 | no Evaluation Count:0 |
evaluated: parent->isVisible() yes Evaluation Count:8093 | yes Evaluation Count:5523 |
evaluated: parent->d_func()->layout yes Evaluation Count:2876 | yes Evaluation Count:5217 |
evaluated: !parent->data->in_show yes Evaluation Count:182 | yes Evaluation Count:2694 |
| 0-13616 |
4445 | parent->d_func()->layout->activate(); | - |
4446 | if (parent->isWindow()) evaluated: parent->isWindow() yes Evaluation Count:104 | yes Evaluation Count:78 |
| 78-104 |
4447 | break; executed: break; Execution Count:104 | 104 |
4448 | parent = parent->parentWidget(); | - |
4449 | } executed: } Execution Count:78 | 78 |
4450 | if (parent) partially evaluated: parent yes Evaluation Count:13538 | no Evaluation Count:0 |
| 0-13538 |
4451 | parent->d_func()->setDirtyOpaqueRegion(); executed: parent->d_func()->setDirtyOpaqueRegion(); Execution Count:13538 | 13538 |
4452 | } executed: } Execution Count:13538 | 13538 |
4453 | | - |
4454 | | - |
4455 | if (!wasResized evaluated: !wasResized yes Evaluation Count:6150 | yes Evaluation Count:9933 |
| 6150-9933 |
4456 | && (isWindow() || !parentWidget()->d_func()->layout)) { evaluated: isWindow() yes Evaluation Count:1598 | yes Evaluation Count:4552 |
evaluated: !parentWidget()->d_func()->layout yes Evaluation Count:1875 | yes Evaluation Count:2677 |
| 1598-4552 |
4457 | if (isWindow()) { evaluated: isWindow() yes Evaluation Count:1598 | yes Evaluation Count:1875 |
| 1598-1875 |
4458 | adjustSize(); | - |
4459 | if (windowState() != initialWindowState) partially evaluated: windowState() != initialWindowState no Evaluation Count:0 | yes Evaluation Count:1598 |
| 0-1598 |
4460 | setWindowState(initialWindowState); never executed: setWindowState(initialWindowState); | 0 |
4461 | } else { executed: } Execution Count:1598 | 1598 |
4462 | adjustSize(); | - |
4463 | } executed: } Execution Count:1875 | 1875 |
4464 | setAttribute(Qt::WA_Resized, false); | - |
4465 | } executed: } Execution Count:3473 | 3473 |
4466 | | - |
4467 | setAttribute(Qt::WA_KeyboardFocusChange, false); | - |
4468 | | - |
4469 | if (isWindow() || parentWidget()->isVisible()) { evaluated: isWindow() yes Evaluation Count:2545 | yes Evaluation Count:13538 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:8015 | yes Evaluation Count:5523 |
| 2545-13538 |
4470 | d->show_helper(); | - |
4471 | | - |
4472 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - |
4473 | } executed: } Execution Count:10560 | 10560 |
4474 | | - |
4475 | QEvent showToParentEvent(QEvent::ShowToParent); | - |
4476 | QApplication::sendEvent(this, &showToParentEvent); | - |
4477 | } else { executed: } Execution Count:16083 | 16083 |
4478 | if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden)) evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:60166 | yes Evaluation Count:12335 |
evaluated: testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:54991 | yes Evaluation Count:5175 |
| 5175-60166 |
4479 | return; executed: return; Execution Count:54991 | 54991 |
4480 | if (QApplicationPrivate::hidden_focus_widget == this) evaluated: QApplicationPrivate::hidden_focus_widget == this yes Evaluation Count:2 | yes Evaluation Count:17508 |
| 2-17508 |
4481 | QApplicationPrivate::hidden_focus_widget = 0; executed: QApplicationPrivate::hidden_focus_widget = 0; Execution Count:2 | 2 |
4482 | | - |
4483 | QWidgetPrivate * const d = d_func(); | - |
4484 | | - |
4485 | | - |
4486 | | - |
4487 | | - |
4488 | | - |
4489 | if (!isWindow() && parentWidget()) evaluated: !isWindow() yes Evaluation Count:14586 | yes Evaluation Count:2924 |
partially evaluated: parentWidget() yes Evaluation Count:14586 | no Evaluation Count:0 |
| 0-14586 |
4490 | parentWidget()->d_func()->setDirtyOpaqueRegion(); executed: parentWidget()->d_func()->setDirtyOpaqueRegion(); Execution Count:14586 | 14586 |
4491 | | - |
4492 | setAttribute(Qt::WA_WState_Hidden); | - |
4493 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - |
4494 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:3891 | yes Evaluation Count:13619 |
| 3891-13619 |
4495 | d->hide_helper(); executed: d->hide_helper(); Execution Count:3891 | 3891 |
4496 | | - |
4497 | | - |
4498 | if (!isWindow() && parentWidget()) { evaluated: !isWindow() yes Evaluation Count:14586 | yes Evaluation Count:2924 |
partially evaluated: parentWidget() yes Evaluation Count:14586 | no Evaluation Count:0 |
| 0-14586 |
4499 | if (parentWidget()->d_func()->layout) evaluated: parentWidget()->d_func()->layout yes Evaluation Count:1959 | yes Evaluation Count:12627 |
| 1959-12627 |
4500 | parentWidget()->d_func()->layout->invalidate(); executed: parentWidget()->d_func()->layout->invalidate(); Execution Count:1959 | 1959 |
4501 | else if (parentWidget()->isVisible()) evaluated: parentWidget()->isVisible() yes Evaluation Count:882 | yes Evaluation Count:11745 |
| 882-11745 |
4502 | QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); executed: QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); Execution Count:882 | 882 |
4503 | } | - |
4504 | | - |
4505 | QEvent hideToParentEvent(QEvent::HideToParent); | - |
4506 | QApplication::sendEvent(this, &hideToParentEvent); | - |
4507 | } executed: } Execution Count:17510 | 17510 |
4508 | } | - |
4509 | | - |
4510 | | - |
4511 | | - |
4512 | | - |
4513 | void QWidget::setHidden(bool hidden) | - |
4514 | { | - |
4515 | setVisible(!hidden); | - |
4516 | } executed: } Execution Count:6919 | 6919 |
4517 | | - |
4518 | void QWidgetPrivate::_q_showIfNotHidden() | - |
4519 | { | - |
4520 | QWidget * const q = q_func(); | - |
4521 | if ( !(q->isHidden() && q->testAttribute(Qt::WA_WState_ExplicitShowHide)) ) evaluated: q->isHidden() yes Evaluation Count:23 | yes Evaluation Count:14 |
evaluated: q->testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:4 | yes Evaluation Count:19 |
| 4-23 |
4522 | q->setVisible(true); executed: q->setVisible(true); Execution Count:33 | 33 |
4523 | } executed: } Execution Count:37 | 37 |
4524 | | - |
4525 | void QWidgetPrivate::showChildren(bool spontaneous) | - |
4526 | { | - |
4527 | QList<QObject*> childList = children; | - |
4528 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:25307 | yes Evaluation Count:14991 |
| 14991-25307 |
4529 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - |
4530 | if (!widget evaluated: !widget yes Evaluation Count:7440 | yes Evaluation Count:17867 |
| 7440-17867 |
4531 | || widget->isWindow() evaluated: widget->isWindow() yes Evaluation Count:736 | yes Evaluation Count:17131 |
| 736-17131 |
4532 | || widget->testAttribute(Qt::WA_WState_Hidden)) evaluated: widget->testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:6359 | yes Evaluation Count:10772 |
| 6359-10772 |
4533 | continue; executed: continue; Execution Count:14535 | 14535 |
4534 | if (spontaneous) { partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:10772 |
| 0-10772 |
4535 | widget->setAttribute(Qt::WA_Mapped); | - |
4536 | widget->d_func()->showChildren(true); | - |
4537 | QShowEvent e; | - |
4538 | QApplication::sendSpontaneousEvent(widget, &e); | - |
4539 | } else { | 0 |
4540 | if (widget->testAttribute(Qt::WA_WState_ExplicitShowHide)) evaluated: widget->testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:4431 | yes Evaluation Count:6341 |
| 4431-6341 |
4541 | widget->d_func()->show_recursive(); executed: widget->d_func()->show_recursive(); Execution Count:4431 | 4431 |
4542 | else | - |
4543 | widget->show(); executed: widget->show(); Execution Count:6341 | 6341 |
4544 | } | - |
4545 | } | - |
4546 | } executed: } Execution Count:14991 | 14991 |
4547 | | - |
4548 | void QWidgetPrivate::hideChildren(bool spontaneous) | - |
4549 | { | - |
4550 | QList<QObject*> childList = children; | - |
4551 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:24659 | yes Evaluation Count:14628 |
| 14628-24659 |
4552 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - |
4553 | if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) evaluated: !widget yes Evaluation Count:7297 | yes Evaluation Count:17362 |
evaluated: widget->isWindow() yes Evaluation Count:784 | yes Evaluation Count:16578 |
evaluated: widget->testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:5841 | yes Evaluation Count:10737 |
| 784-17362 |
4554 | continue; executed: continue; Execution Count:13922 | 13922 |
4555 | if (spontaneous) partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:10737 |
| 0-10737 |
4556 | widget->setAttribute(Qt::WA_Mapped, false); never executed: widget->setAttribute(Qt::WA_Mapped, false); | 0 |
4557 | else | - |
4558 | widget->setAttribute(Qt::WA_WState_Visible, false); executed: widget->setAttribute(Qt::WA_WState_Visible, false); Execution Count:10737 | 10737 |
4559 | widget->d_func()->hideChildren(spontaneous); | - |
4560 | QHideEvent e; | - |
4561 | if (spontaneous) { partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:10737 |
| 0-10737 |
4562 | QApplication::sendSpontaneousEvent(widget, &e); | - |
4563 | } else { | 0 |
4564 | QApplication::sendEvent(widget, &e); | - |
4565 | if (widget->internalWinId() evaluated: widget->internalWinId() yes Evaluation Count:23 | yes Evaluation Count:10714 |
| 23-10714 |
4566 | && widget->testAttribute(Qt::WA_DontCreateNativeAncestors)) { evaluated: widget->testAttribute(Qt::WA_DontCreateNativeAncestors) yes Evaluation Count:1 | yes Evaluation Count:22 |
| 1-22 |
4567 | | - |
4568 | | - |
4569 | widget->d_func()->hide_sys(); | - |
4570 | } executed: } Execution Count:1 | 1 |
4571 | } executed: } Execution Count:10737 | 10737 |
4572 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(widget); | - |
4573 | | - |
4574 | if (!spontaneous) { partially evaluated: !spontaneous yes Evaluation Count:10737 | no Evaluation Count:0 |
| 0-10737 |
4575 | QAccessibleEvent event(widget, QAccessible::ObjectHide); | - |
4576 | QAccessible::updateAccessibility(&event); | - |
4577 | } executed: } Execution Count:10737 | 10737 |
4578 | | - |
4579 | } executed: } Execution Count:10737 | 10737 |
4580 | } executed: } Execution Count:14628 | 14628 |
4581 | | - |
4582 | bool QWidgetPrivate::close_helper(CloseMode mode) | - |
4583 | { | - |
4584 | if (data.is_closing) evaluated: data.is_closing yes Evaluation Count:26 | yes Evaluation Count:2281 |
| 26-2281 |
4585 | return true; executed: return true; Execution Count:26 | 26 |
4586 | | - |
4587 | QWidget * const q = q_func(); | - |
4588 | data.is_closing = 1; | - |
4589 | | - |
4590 | QPointer<QWidget> that = q; | - |
4591 | QPointer<QWidget> parentWidget = q->parentWidget(); | - |
4592 | | - |
4593 | bool quitOnClose = q->testAttribute(Qt::WA_QuitOnClose); | - |
4594 | if (mode != CloseNoEvent) { evaluated: mode != CloseNoEvent yes Evaluation Count:98 | yes Evaluation Count:2183 |
| 98-2183 |
4595 | QCloseEvent e; | - |
4596 | if (mode == CloseWithSpontaneousEvent) partially evaluated: mode == CloseWithSpontaneousEvent no Evaluation Count:0 | yes Evaluation Count:98 |
| 0-98 |
4597 | QApplication::sendSpontaneousEvent(q, &e); never executed: QApplication::sendSpontaneousEvent(q, &e); | 0 |
4598 | else | - |
4599 | QApplication::sendEvent(q, &e); executed: QApplication::sendEvent(q, &e); Execution Count:98 | 98 |
4600 | if (!that.isNull() && !e.isAccepted()) { evaluated: !that.isNull() yes Evaluation Count:97 | yes Evaluation Count:1 |
evaluated: !e.isAccepted() yes Evaluation Count:6 | yes Evaluation Count:91 |
| 1-97 |
4601 | data.is_closing = 0; | - |
4602 | return false; executed: return false; Execution Count:6 | 6 |
4603 | } | - |
4604 | } executed: } Execution Count:92 | 92 |
4605 | | - |
4606 | if (!that.isNull() && !q->isHidden()) evaluated: !that.isNull() yes Evaluation Count:2274 | yes Evaluation Count:1 |
evaluated: !q->isHidden() yes Evaluation Count:2159 | yes Evaluation Count:115 |
| 1-2274 |
4607 | q->hide(); executed: q->hide(); Execution Count:2159 | 2159 |
4608 | | - |
4609 | | - |
4610 | quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible()); evaluated: quitOnClose yes Evaluation Count:2197 | yes Evaluation Count:78 |
evaluated: parentWidget.isNull() yes Evaluation Count:2148 | yes Evaluation Count:49 |
evaluated: !parentWidget->isVisible() yes Evaluation Count:33 | yes Evaluation Count:16 |
| 16-2197 |
4611 | | - |
4612 | if (quitOnClose) { evaluated: quitOnClose yes Evaluation Count:2181 | yes Evaluation Count:94 |
| 94-2181 |
4613 | | - |
4614 | | - |
4615 | | - |
4616 | QWidgetList list = QApplication::topLevelWidgets(); | - |
4617 | bool lastWindowClosed = true; | - |
4618 | for (int i = 0; i < list.size(); ++i) { evaluated: i < list.size() yes Evaluation Count:3611 | yes Evaluation Count:1728 |
| 1728-3611 |
4619 | QWidget *w = list.at(i); | - |
4620 | if (!w->isVisible() || w->parentWidget() || !w->testAttribute(Qt::WA_QuitOnClose)) evaluated: !w->isVisible() yes Evaluation Count:3079 | yes Evaluation Count:532 |
evaluated: w->parentWidget() yes Evaluation Count:5 | yes Evaluation Count:527 |
evaluated: !w->testAttribute(Qt::WA_QuitOnClose) yes Evaluation Count:74 | yes Evaluation Count:453 |
| 5-3079 |
4621 | continue; executed: continue; Execution Count:3158 | 3158 |
4622 | lastWindowClosed = false; | - |
4623 | break; executed: break; Execution Count:453 | 453 |
4624 | } | - |
4625 | if (lastWindowClosed) { evaluated: lastWindowClosed yes Evaluation Count:1728 | yes Evaluation Count:453 |
| 453-1728 |
4626 | QGuiApplicationPrivate::emitLastWindowClosed(); | - |
4627 | QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance())); | - |
4628 | applicationPrivate->maybeQuit(); | - |
4629 | } executed: } Execution Count:1728 | 1728 |
4630 | } executed: } Execution Count:2181 | 2181 |
4631 | | - |
4632 | | - |
4633 | if (!that.isNull()) { evaluated: !that.isNull() yes Evaluation Count:2274 | yes Evaluation Count:1 |
| 1-2274 |
4634 | data.is_closing = 0; | - |
4635 | if (q->testAttribute(Qt::WA_DeleteOnClose)) { evaluated: q->testAttribute(Qt::WA_DeleteOnClose) yes Evaluation Count:14 | yes Evaluation Count:2260 |
| 14-2260 |
4636 | q->setAttribute(Qt::WA_DeleteOnClose, false); | - |
4637 | q->deleteLater(); | - |
4638 | } executed: } Execution Count:14 | 14 |
4639 | } executed: } Execution Count:2274 | 2274 |
4640 | return true; executed: return true; Execution Count:2275 | 2275 |
4641 | } | - |
4642 | bool QWidget::close() | - |
4643 | { | - |
4644 | return d_func()->close_helper(QWidgetPrivate::CloseWithEvent); executed: return d_func()->close_helper(QWidgetPrivate::CloseWithEvent); Execution Count:98 | 98 |
4645 | } | - |
4646 | bool QWidget::isVisibleTo(const QWidget *ancestor) const | - |
4647 | { | - |
4648 | if (!ancestor) partially evaluated: !ancestor no Evaluation Count:0 | yes Evaluation Count:1801 |
| 0-1801 |
4649 | return isVisible(); never executed: return isVisible(); | 0 |
4650 | const QWidget * w = this; | - |
4651 | while (!w->isHidden() evaluated: !w->isHidden() yes Evaluation Count:3292 | yes Evaluation Count:733 |
| 733-3292 |
4652 | && !w->isWindow() evaluated: !w->isWindow() yes Evaluation Count:2899 | yes Evaluation Count:393 |
| 393-2899 |
4653 | && w->parentWidget() partially evaluated: w->parentWidget() yes Evaluation Count:2899 | no Evaluation Count:0 |
| 0-2899 |
4654 | && w->parentWidget() != ancestor) evaluated: w->parentWidget() != ancestor yes Evaluation Count:2224 | yes Evaluation Count:675 |
| 675-2224 |
4655 | w = w->parentWidget(); executed: w = w->parentWidget(); Execution Count:2224 | 2224 |
4656 | return !w->isHidden(); executed: return !w->isHidden(); Execution Count:1801 | 1801 |
4657 | } | - |
4658 | QRegion QWidget::visibleRegion() const | - |
4659 | { | - |
4660 | const QWidgetPrivate * const d = d_func(); | - |
4661 | | - |
4662 | QRect clipRect = d->clipRect(); | - |
4663 | if (clipRect.isEmpty()) partially evaluated: clipRect.isEmpty() no Evaluation Count:0 | yes Evaluation Count:27 |
| 0-27 |
4664 | return QRegion(); never executed: return QRegion(); | 0 |
4665 | QRegion r(clipRect); | - |
4666 | d->subtractOpaqueChildren(r, clipRect); | - |
4667 | d->subtractOpaqueSiblings(r); | - |
4668 | return r; executed: return r; Execution Count:27 | 27 |
4669 | } | - |
4670 | | - |
4671 | | - |
4672 | QSize QWidgetPrivate::adjustedSize() const | - |
4673 | { | - |
4674 | const QWidget * const q = q_func(); | - |
4675 | | - |
4676 | QSize s = q->sizeHint(); | - |
4677 | | - |
4678 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:1802 | yes Evaluation Count:1890 |
| 1802-1890 |
4679 | Qt::Orientations exp; | - |
4680 | if (layout) { evaluated: layout yes Evaluation Count:279 | yes Evaluation Count:1523 |
| 279-1523 |
4681 | if (layout->hasHeightForWidth()) evaluated: layout->hasHeightForWidth() yes Evaluation Count:17 | yes Evaluation Count:262 |
| 17-262 |
4682 | s.setHeight(layout->totalHeightForWidth(s.width())); executed: s.setHeight(layout->totalHeightForWidth(s.width())); Execution Count:17 | 17 |
4683 | exp = layout->expandingDirections(); | - |
4684 | } else executed: } Execution Count:279 | 279 |
4685 | { | - |
4686 | if (q->sizePolicy().hasHeightForWidth()) evaluated: q->sizePolicy().hasHeightForWidth() yes Evaluation Count:4 | yes Evaluation Count:1519 |
| 4-1519 |
4687 | s.setHeight(q->heightForWidth(s.width())); executed: s.setHeight(q->heightForWidth(s.width())); Execution Count:4 | 4 |
4688 | exp = q->sizePolicy().expandingDirections(); | - |
4689 | } executed: } Execution Count:1523 | 1523 |
4690 | if (exp & Qt::Horizontal) evaluated: exp & Qt::Horizontal yes Evaluation Count:967 | yes Evaluation Count:835 |
| 835-967 |
4691 | s.setWidth(qMax(s.width(), 200)); executed: s.setWidth(qMax(s.width(), 200)); Execution Count:967 | 967 |
4692 | if (exp & Qt::Vertical) evaluated: exp & Qt::Vertical yes Evaluation Count:852 | yes Evaluation Count:950 |
| 852-950 |
4693 | s.setHeight(qMax(s.height(), 100)); executed: s.setHeight(qMax(s.height(), 100)); Execution Count:852 | 852 |
4694 | | - |
4695 | | - |
4696 | | - |
4697 | QRect screen = QApplication::desktop()->screenGeometry(q->pos()); | - |
4698 | | - |
4699 | | - |
4700 | | - |
4701 | | - |
4702 | | - |
4703 | s.setWidth(qMin(s.width(), screen.width()*2/3)); | - |
4704 | s.setHeight(qMin(s.height(), screen.height()*2/3)); | - |
4705 | | - |
4706 | if (QTLWExtra *extra = maybeTopData()) evaluated: QTLWExtra *extra = maybeTopData() yes Evaluation Count:1660 | yes Evaluation Count:142 |
| 142-1660 |
4707 | extra->sizeAdjusted = true; executed: extra->sizeAdjusted = true; Execution Count:1660 | 1660 |
4708 | } executed: } Execution Count:1802 | 1802 |
4709 | | - |
4710 | if (!s.isValid()) { evaluated: !s.isValid() yes Evaluation Count:846 | yes Evaluation Count:2846 |
| 846-2846 |
4711 | QRect r = q->childrenRect(); | - |
4712 | if (r.isNull()) evaluated: r.isNull() yes Evaluation Count:659 | yes Evaluation Count:187 |
| 187-659 |
4713 | return s; executed: return s; Execution Count:659 | 659 |
4714 | s = r.size() + QSize(2 * r.x(), 2 * r.y()); | - |
4715 | } executed: } Execution Count:187 | 187 |
4716 | | - |
4717 | return s; executed: return s; Execution Count:3033 | 3033 |
4718 | } | - |
4719 | void QWidget::adjustSize() | - |
4720 | { | - |
4721 | QWidgetPrivate * const d = d_func(); | - |
4722 | ensurePolished(); | - |
4723 | QSize s = d->adjustedSize(); | - |
4724 | | - |
4725 | if (d->layout) evaluated: d->layout yes Evaluation Count:823 | yes Evaluation Count:2869 |
| 823-2869 |
4726 | d->layout->activate(); executed: d->layout->activate(); Execution Count:823 | 823 |
4727 | | - |
4728 | if (s.isValid()) evaluated: s.isValid() yes Evaluation Count:3033 | yes Evaluation Count:659 |
| 659-3033 |
4729 | resize(s); executed: resize(s); Execution Count:3033 | 3033 |
4730 | } executed: } Execution Count:3692 | 3692 |
4731 | QSize QWidget::sizeHint() const | - |
4732 | { | - |
4733 | const QWidgetPrivate * const d = d_func(); | - |
4734 | if (d->layout) evaluated: d->layout yes Evaluation Count:10701 | yes Evaluation Count:10389 |
| 10389-10701 |
4735 | return d->layout->totalSizeHint(); executed: return d->layout->totalSizeHint(); Execution Count:10701 | 10701 |
4736 | return QSize(-1, -1); executed: return QSize(-1, -1); Execution Count:10389 | 10389 |
4737 | } | - |
4738 | QSize QWidget::minimumSizeHint() const | - |
4739 | { | - |
4740 | const QWidgetPrivate * const d = d_func(); | - |
4741 | if (d->layout) evaluated: d->layout yes Evaluation Count:3603 | yes Evaluation Count:11680 |
| 3603-11680 |
4742 | return d->layout->totalMinimumSize(); executed: return d->layout->totalMinimumSize(); Execution Count:3603 | 3603 |
4743 | return QSize(-1, -1); executed: return QSize(-1, -1); Execution Count:11680 | 11680 |
4744 | } | - |
4745 | bool QWidget::isAncestorOf(const QWidget *child) const | - |
4746 | { | - |
4747 | while (child) { evaluated: child yes Evaluation Count:80360 | yes Evaluation Count:42085 |
| 42085-80360 |
4748 | if (child == this) evaluated: child == this yes Evaluation Count:7244 | yes Evaluation Count:73116 |
| 7244-73116 |
4749 | return true; executed: return true; Execution Count:7244 | 7244 |
4750 | if (child->isWindow()) evaluated: child->isWindow() yes Evaluation Count:17074 | yes Evaluation Count:56042 |
| 17074-56042 |
4751 | return false; executed: return false; Execution Count:17074 | 17074 |
4752 | child = child->parentWidget(); | - |
4753 | } executed: } Execution Count:56042 | 56042 |
4754 | return false; executed: return false; Execution Count:42085 | 42085 |
4755 | } | - |
4756 | bool QWidget::event(QEvent *event) | - |
4757 | { | - |
4758 | QWidgetPrivate * const d = d_func(); | - |
4759 | | - |
4760 | | - |
4761 | if (!isEnabled()) { evaluated: !isEnabled() yes Evaluation Count:6410 | yes Evaluation Count:582366 |
| 6410-582366 |
4762 | switch(event->type()) { | - |
4763 | case QEvent::TabletPress: | - |
4764 | case QEvent::TabletRelease: | - |
4765 | case QEvent::TabletMove: | - |
4766 | case QEvent::MouseButtonPress: | - |
4767 | case QEvent::MouseButtonRelease: | - |
4768 | case QEvent::MouseButtonDblClick: | - |
4769 | case QEvent::MouseMove: | - |
4770 | case QEvent::TouchBegin: | - |
4771 | case QEvent::TouchUpdate: | - |
4772 | case QEvent::TouchEnd: | - |
4773 | case QEvent::TouchCancel: | - |
4774 | case QEvent::ContextMenu: | - |
4775 | case QEvent::KeyPress: | - |
4776 | case QEvent::KeyRelease: | - |
4777 | | - |
4778 | case QEvent::Wheel: | - |
4779 | | - |
4780 | return false; executed: return false; Execution Count:3 | 3 |
4781 | default: | - |
4782 | break; executed: break; Execution Count:6407 | 6407 |
4783 | } | - |
4784 | } executed: } Execution Count:6407 | 6407 |
4785 | switch (event->type()) { | - |
4786 | case QEvent::MouseMove: | - |
4787 | mouseMoveEvent((QMouseEvent*)event); | - |
4788 | break; executed: break; Execution Count:598 | 598 |
4789 | | - |
4790 | case QEvent::MouseButtonPress: | - |
4791 | mousePressEvent((QMouseEvent*)event); | - |
4792 | break; executed: break; Execution Count:5517 | 5517 |
4793 | | - |
4794 | case QEvent::MouseButtonRelease: | - |
4795 | mouseReleaseEvent((QMouseEvent*)event); | - |
4796 | break; executed: break; Execution Count:5474 | 5474 |
4797 | | - |
4798 | case QEvent::MouseButtonDblClick: | - |
4799 | mouseDoubleClickEvent((QMouseEvent*)event); | - |
4800 | break; executed: break; Execution Count:394 | 394 |
4801 | | - |
4802 | case QEvent::Wheel: | - |
4803 | wheelEvent((QWheelEvent*)event); | - |
4804 | break; executed: break; Execution Count:38 | 38 |
4805 | | - |
4806 | | - |
4807 | case QEvent::TabletMove: | - |
4808 | case QEvent::TabletPress: | - |
4809 | case QEvent::TabletRelease: | - |
4810 | tabletEvent((QTabletEvent*)event); | - |
4811 | break; | 0 |
4812 | | - |
4813 | case QEvent::KeyPress: { | - |
4814 | QKeyEvent *k = (QKeyEvent *)event; | - |
4815 | bool res = false; | - |
4816 | if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { evaluated: !(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier)) yes Evaluation Count:6748 | yes Evaluation Count:183 |
| 183-6748 |
4817 | if (k->key() == Qt::Key_Backtab evaluated: k->key() == Qt::Key_Backtab yes Evaluation Count:20 | yes Evaluation Count:6728 |
| 20-6728 |
4818 | || (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier))) evaluated: k->key() == Qt::Key_Tab yes Evaluation Count:130 | yes Evaluation Count:6598 |
evaluated: (k->modifiers() & Qt::ShiftModifier) yes Evaluation Count:11 | yes Evaluation Count:119 |
| 11-6598 |
4819 | res = focusNextPrevChild(false); executed: res = focusNextPrevChild(false); Execution Count:31 | 31 |
4820 | else if (k->key() == Qt::Key_Tab) evaluated: k->key() == Qt::Key_Tab yes Evaluation Count:119 | yes Evaluation Count:6598 |
| 119-6598 |
4821 | res = focusNextPrevChild(true); executed: res = focusNextPrevChild(true); Execution Count:119 | 119 |
4822 | if (res) evaluated: res yes Evaluation Count:37 | yes Evaluation Count:6711 |
| 37-6711 |
4823 | break; executed: break; Execution Count:37 | 37 |
4824 | } executed: } Execution Count:6711 | 6711 |
4825 | keyPressEvent(k); | - |
4826 | if (!k->isAccepted() evaluated: !k->isAccepted() yes Evaluation Count:1412 | yes Evaluation Count:5482 |
| 1412-5482 |
4827 | && k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1 evaluated: k->modifiers() & Qt::ShiftModifier yes Evaluation Count:178 | yes Evaluation Count:1234 |
partially evaluated: k->key() == Qt::Key_F1 no Evaluation Count:0 | yes Evaluation Count:178 |
| 0-1234 |
4828 | && d->whatsThis.size()) { never evaluated: d->whatsThis.size() | 0 |
4829 | QWhatsThis::showText(mapToGlobal(inputMethodQuery(Qt::ImCursorRectangle).toRect().center()), d->whatsThis, this); | - |
4830 | k->accept(); | - |
4831 | } | 0 |
4832 | | - |
4833 | } | - |
4834 | break; executed: break; Execution Count:6894 | 6894 |
4835 | | - |
4836 | case QEvent::KeyRelease: | - |
4837 | keyReleaseEvent((QKeyEvent*)event); | - |
4838 | | - |
4839 | case QEvent::ShortcutOverride: | - |
4840 | break; executed: break; Execution Count:15114 | 15114 |
4841 | | - |
4842 | case QEvent::InputMethod: | - |
4843 | inputMethodEvent((QInputMethodEvent *) event); | - |
4844 | break; executed: break; Execution Count:79 | 79 |
4845 | | - |
4846 | case QEvent::InputMethodQuery: | - |
4847 | if (testAttribute(Qt::WA_InputMethodEnabled)) { evaluated: testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:3946 | yes Evaluation Count:2845 |
| 2845-3946 |
4848 | QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(event); | - |
4849 | Qt::InputMethodQueries queries = query->queries(); | - |
4850 | for (uint i = 0; i < 32; ++i) { evaluated: i < 32 yes Evaluation Count:126272 | yes Evaluation Count:3946 |
| 3946-126272 |
4851 | Qt::InputMethodQuery q = (Qt::InputMethodQuery)(int)(queries & (1<<i)); | - |
4852 | if (q) { evaluated: q yes Evaluation Count:3946 | yes Evaluation Count:122326 |
| 3946-122326 |
4853 | QVariant v = inputMethodQuery(q); | - |
4854 | if (q == Qt::ImEnabled && !v.isValid() && isEnabled()) partially evaluated: q == Qt::ImEnabled yes Evaluation Count:3946 | no Evaluation Count:0 |
evaluated: !v.isValid() yes Evaluation Count:3945 | yes Evaluation Count:1 |
evaluated: isEnabled() yes Evaluation Count:3944 | yes Evaluation Count:1 |
| 0-3946 |
4855 | v = QVariant(true); executed: v = QVariant(true); Execution Count:3944 | 3944 |
4856 | query->setValue(q, v); | - |
4857 | } executed: } Execution Count:3946 | 3946 |
4858 | } executed: } Execution Count:126272 | 126272 |
4859 | query->accept(); | - |
4860 | } executed: } Execution Count:3946 | 3946 |
4861 | break; executed: break; Execution Count:6791 | 6791 |
4862 | | - |
4863 | case QEvent::PolishRequest: | - |
4864 | ensurePolished(); | - |
4865 | break; executed: break; Execution Count:13755 | 13755 |
4866 | | - |
4867 | case QEvent::Polish: { | - |
4868 | style()->polish(this); | - |
4869 | setAttribute(Qt::WA_WState_Polished); | - |
4870 | if (!QApplication::font(this).isCopyOf(QApplication::font())) evaluated: !QApplication::font(this).isCopyOf(QApplication::font()) yes Evaluation Count:2 | yes Evaluation Count:37232 |
| 2-37232 |
4871 | d->resolveFont(); executed: d->resolveFont(); Execution Count:2 | 2 |
4872 | if (!QApplication::palette(this).isCopyOf(QApplication::palette())) evaluated: !QApplication::palette(this).isCopyOf(QApplication::palette()) yes Evaluation Count:2 | yes Evaluation Count:37232 |
| 2-37232 |
4873 | d->resolvePalette(); executed: d->resolvePalette(); Execution Count:2 | 2 |
4874 | } | - |
4875 | break; executed: break; Execution Count:37234 | 37234 |
4876 | | - |
4877 | case QEvent::ApplicationWindowIconChange: | - |
4878 | if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon)) { partially evaluated: isWindow() yes Evaluation Count:10 | no Evaluation Count:0 |
evaluated: !testAttribute(Qt::WA_SetWindowIcon) yes Evaluation Count:8 | yes Evaluation Count:2 |
| 0-10 |
4879 | d->setWindowIcon_sys(); | - |
4880 | d->setWindowIcon_helper(); | - |
4881 | } executed: } Execution Count:8 | 8 |
4882 | break; executed: break; Execution Count:10 | 10 |
4883 | case QEvent::FocusIn: | - |
4884 | focusInEvent((QFocusEvent*)event); | - |
4885 | d->updateWidgetTransform(); | - |
4886 | break; executed: break; Execution Count:2062 | 2062 |
4887 | | - |
4888 | case QEvent::FocusOut: | - |
4889 | focusOutEvent((QFocusEvent*)event); | - |
4890 | break; executed: break; Execution Count:1959 | 1959 |
4891 | | - |
4892 | case QEvent::Enter: | - |
4893 | | - |
4894 | if (d->statusTip.size()) { partially evaluated: d->statusTip.size() no Evaluation Count:0 | yes Evaluation Count:2847 |
| 0-2847 |
4895 | QStatusTipEvent tip(d->statusTip); | - |
4896 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - |
4897 | } | 0 |
4898 | | - |
4899 | enterEvent(event); | - |
4900 | break; executed: break; Execution Count:2847 | 2847 |
4901 | | - |
4902 | case QEvent::Leave: | - |
4903 | | - |
4904 | if (d->statusTip.size()) { partially evaluated: d->statusTip.size() no Evaluation Count:0 | yes Evaluation Count:964 |
| 0-964 |
4905 | QString empty; | - |
4906 | QStatusTipEvent tip(empty); | - |
4907 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - |
4908 | } | 0 |
4909 | | - |
4910 | leaveEvent(event); | - |
4911 | break; executed: break; Execution Count:964 | 964 |
4912 | | - |
4913 | case QEvent::HoverEnter: | - |
4914 | case QEvent::HoverLeave: | - |
4915 | update(); | - |
4916 | break; executed: break; Execution Count:5 | 5 |
4917 | | - |
4918 | case QEvent::Paint: | - |
4919 | | - |
4920 | | - |
4921 | | - |
4922 | paintEvent((QPaintEvent*)event); | - |
4923 | break; executed: break; Execution Count:14733 | 14733 |
4924 | | - |
4925 | case QEvent::Move: | - |
4926 | moveEvent((QMoveEvent*)event); | - |
4927 | d->updateWidgetTransform(); | - |
4928 | break; executed: break; Execution Count:14417 | 14417 |
4929 | | - |
4930 | case QEvent::Resize: | - |
4931 | resizeEvent((QResizeEvent*)event); | - |
4932 | d->updateWidgetTransform(); | - |
4933 | break; executed: break; Execution Count:13887 | 13887 |
4934 | | - |
4935 | case QEvent::Close: | - |
4936 | closeEvent((QCloseEvent *)event); | - |
4937 | break; executed: break; Execution Count:98 | 98 |
4938 | | - |
4939 | | - |
4940 | case QEvent::ContextMenu: | - |
4941 | switch (data->context_menu_policy) { | - |
4942 | case Qt::PreventContextMenu: | - |
4943 | break; | 0 |
4944 | case Qt::DefaultContextMenu: | - |
4945 | contextMenuEvent(static_cast<QContextMenuEvent *>(event)); | - |
4946 | break; executed: break; Execution Count:202 | 202 |
4947 | case Qt::CustomContextMenu: | - |
4948 | customContextMenuRequested(static_cast<QContextMenuEvent *>(event)->pos()); | - |
4949 | break; executed: break; Execution Count:3 | 3 |
4950 | | - |
4951 | case Qt::ActionsContextMenu: | - |
4952 | if (d->actions.count()) { never evaluated: d->actions.count() | 0 |
4953 | QMenu::exec(d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(), | - |
4954 | 0, this); | - |
4955 | break; | 0 |
4956 | } | - |
4957 | | - |
4958 | | - |
4959 | default: code before this statement never executed: default: | 0 |
4960 | event->ignore(); | - |
4961 | break; | 0 |
4962 | } | - |
4963 | break; executed: break; Execution Count:205 | 205 |
4964 | | - |
4965 | | - |
4966 | | - |
4967 | case QEvent::Drop: | - |
4968 | dropEvent((QDropEvent*) event); | - |
4969 | break; executed: break; Execution Count:2 | 2 |
4970 | | - |
4971 | case QEvent::DragEnter: | - |
4972 | dragEnterEvent((QDragEnterEvent*) event); | - |
4973 | break; executed: break; Execution Count:3 | 3 |
4974 | | - |
4975 | case QEvent::DragMove: | - |
4976 | dragMoveEvent((QDragMoveEvent*) event); | - |
4977 | break; executed: break; Execution Count:5 | 5 |
4978 | | - |
4979 | case QEvent::DragLeave: | - |
4980 | dragLeaveEvent((QDragLeaveEvent*) event); | - |
4981 | break; executed: break; Execution Count:1 | 1 |
4982 | | - |
4983 | | - |
4984 | case QEvent::Show: | - |
4985 | showEvent((QShowEvent*) event); | - |
4986 | break; executed: break; Execution Count:14991 | 14991 |
4987 | | - |
4988 | case QEvent::Hide: | - |
4989 | hideEvent((QHideEvent*) event); | - |
4990 | break; executed: break; Execution Count:14628 | 14628 |
4991 | | - |
4992 | case QEvent::ShowWindowRequest: | - |
4993 | if (!isHidden()) never evaluated: !isHidden() | 0 |
4994 | d->show_sys(); never executed: d->show_sys(); | 0 |
4995 | break; | 0 |
4996 | | - |
4997 | case QEvent::ApplicationFontChange: | - |
4998 | d->resolveFont(); | - |
4999 | break; executed: break; Execution Count:8 | 8 |
5000 | case QEvent::ApplicationPaletteChange: | - |
5001 | if (!(windowType() == Qt::Desktop)) evaluated: !(windowType() == Qt::Desktop) yes Evaluation Count:29 | yes Evaluation Count:4 |
| 4-29 |
5002 | d->resolvePalette(); executed: d->resolvePalette(); Execution Count:29 | 29 |
5003 | break; executed: break; Execution Count:33 | 33 |
5004 | | - |
5005 | case QEvent::ToolBarChange: | - |
5006 | case QEvent::ActivationChange: | - |
5007 | case QEvent::EnabledChange: | - |
5008 | case QEvent::FontChange: | - |
5009 | case QEvent::StyleChange: | - |
5010 | case QEvent::PaletteChange: | - |
5011 | case QEvent::WindowTitleChange: | - |
5012 | case QEvent::IconTextChange: | - |
5013 | case QEvent::ModifiedChange: | - |
5014 | case QEvent::MouseTrackingChange: | - |
5015 | case QEvent::ParentChange: | - |
5016 | case QEvent::WindowStateChange: | - |
5017 | case QEvent::LocaleChange: | - |
5018 | case QEvent::MacSizeChange: | - |
5019 | case QEvent::ContentsRectChange: | - |
5020 | case QEvent::ThemeChange: | - |
5021 | changeEvent(event); | - |
5022 | break; executed: break; Execution Count:91818 | 91818 |
5023 | | - |
5024 | case QEvent::WindowActivate: | - |
5025 | case QEvent::WindowDeactivate: { | - |
5026 | if (isVisible() && !palette().isEqual(QPalette::Active, QPalette::Inactive)) evaluated: isVisible() yes Evaluation Count:14152 | yes Evaluation Count:26 |
evaluated: !palette().isEqual(QPalette::Active, QPalette::Inactive) yes Evaluation Count:4 | yes Evaluation Count:14148 |
| 4-14152 |
5027 | update(); executed: update(); Execution Count:4 | 4 |
5028 | QList<QObject*> childList = d->children; | - |
5029 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:23768 | yes Evaluation Count:14178 |
| 14178-23768 |
5030 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - |
5031 | if (w && w->isVisible() && !w->isWindow()) evaluated: w yes Evaluation Count:17006 | yes Evaluation Count:6762 |
evaluated: w->isVisible() yes Evaluation Count:10852 | yes Evaluation Count:6154 |
evaluated: !w->isWindow() yes Evaluation Count:10831 | yes Evaluation Count:21 |
| 21-17006 |
5032 | QApplication::sendEvent(w, event); executed: QApplication::sendEvent(w, event); Execution Count:10831 | 10831 |
5033 | } executed: } Execution Count:23768 | 23768 |
5034 | break; } executed: break; Execution Count:14178 | 14178 |
5035 | | - |
5036 | case QEvent::LanguageChange: | - |
5037 | changeEvent(event); | - |
5038 | { | - |
5039 | QList<QObject*> childList = d->children; | - |
5040 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:19 | yes Evaluation Count:14 |
| 14-19 |
5041 | QObject *o = childList.at(i); | - |
5042 | if (o) partially evaluated: o yes Evaluation Count:19 | no Evaluation Count:0 |
| 0-19 |
5043 | QApplication::sendEvent(o, event); executed: QApplication::sendEvent(o, event); Execution Count:19 | 19 |
5044 | } executed: } Execution Count:19 | 19 |
5045 | } | - |
5046 | update(); | - |
5047 | break; executed: break; Execution Count:14 | 14 |
5048 | | - |
5049 | case QEvent::ApplicationLayoutDirectionChange: | - |
5050 | d->resolveLayoutDirection(); | - |
5051 | break; executed: break; Execution Count:154 | 154 |
5052 | | - |
5053 | case QEvent::LayoutDirectionChange: | - |
5054 | if (d->layout) evaluated: d->layout yes Evaluation Count:75 | yes Evaluation Count:350 |
| 75-350 |
5055 | d->layout->invalidate(); executed: d->layout->invalidate(); Execution Count:75 | 75 |
5056 | update(); | - |
5057 | changeEvent(event); | - |
5058 | break; executed: break; Execution Count:425 | 425 |
5059 | case QEvent::UpdateRequest: | - |
5060 | d->syncBackingStore(); | - |
5061 | break; executed: break; Execution Count:6651 | 6651 |
5062 | case QEvent::UpdateLater: | - |
5063 | update(static_cast<QUpdateLaterEvent*>(event)->region()); | - |
5064 | break; executed: break; Execution Count:8841 | 8841 |
5065 | case QEvent::StyleAnimationUpdate: | - |
5066 | update(); | - |
5067 | break; executed: break; Execution Count:15 | 15 |
5068 | | - |
5069 | case QEvent::WindowBlocked: | - |
5070 | case QEvent::WindowUnblocked: | - |
5071 | if (!d->children.isEmpty()) { evaluated: !d->children.isEmpty() yes Evaluation Count:174 | yes Evaluation Count:509 |
| 174-509 |
5072 | QWidget *modalWidget = QApplication::activeModalWidget(); | - |
5073 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:304 | yes Evaluation Count:174 |
| 174-304 |
5074 | QObject *o = d->children.at(i); | - |
5075 | if (o && o != modalWidget && o->isWidgetType()) { evaluated: o yes Evaluation Count:302 | yes Evaluation Count:2 |
evaluated: o != modalWidget yes Evaluation Count:264 | yes Evaluation Count:38 |
evaluated: o->isWidgetType() yes Evaluation Count:211 | yes Evaluation Count:53 |
| 2-302 |
5076 | QWidget *w = static_cast<QWidget *>(o); | - |
5077 | | - |
5078 | if (!w->isWindow()) evaluated: !w->isWindow() yes Evaluation Count:173 | yes Evaluation Count:38 |
| 38-173 |
5079 | QApplication::sendEvent(w, event); executed: QApplication::sendEvent(w, event); Execution Count:173 | 173 |
5080 | } executed: } Execution Count:211 | 211 |
5081 | } executed: } Execution Count:304 | 304 |
5082 | } executed: } Execution Count:174 | 174 |
5083 | | - |
5084 | | - |
5085 | | - |
5086 | break; executed: break; Execution Count:683 | 683 |
5087 | | - |
5088 | case QEvent::ToolTip: | - |
5089 | if (!d->toolTip.isEmpty()) evaluated: !d->toolTip.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
5090 | QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this); executed: QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this); Execution Count:2 | 2 |
5091 | else | - |
5092 | event->ignore(); executed: event->ignore(); Execution Count:1 | 1 |
5093 | break; executed: break; Execution Count:3 | 3 |
5094 | | - |
5095 | | - |
5096 | case QEvent::WhatsThis: | - |
5097 | if (d->whatsThis.size()) never evaluated: d->whatsThis.size() | 0 |
5098 | QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); never executed: QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); | 0 |
5099 | else | - |
5100 | event->ignore(); never executed: event->ignore(); | 0 |
5101 | break; | 0 |
5102 | case QEvent::QueryWhatsThis: | - |
5103 | if (d->whatsThis.isEmpty()) never evaluated: d->whatsThis.isEmpty() | 0 |
5104 | event->ignore(); never executed: event->ignore(); | 0 |
5105 | break; | 0 |
5106 | | - |
5107 | case QEvent::EmbeddingControl: | - |
5108 | d->topData()->frameStrut.setCoords(0 ,0, 0, 0); | - |
5109 | data->fstrut_dirty = false; | - |
5110 | | - |
5111 | | - |
5112 | | - |
5113 | break; | 0 |
5114 | | - |
5115 | case QEvent::ActionAdded: | - |
5116 | case QEvent::ActionRemoved: | - |
5117 | case QEvent::ActionChanged: | - |
5118 | actionEvent((QActionEvent*)event); | - |
5119 | break; executed: break; Execution Count:13511 | 13511 |
5120 | | - |
5121 | | - |
5122 | case QEvent::KeyboardLayoutChange: | - |
5123 | { | - |
5124 | changeEvent(event); | - |
5125 | | - |
5126 | | - |
5127 | QList<QObject*> childList = d->children; | - |
5128 | for (int i = 0; i < childList.size(); ++i) { never evaluated: i < childList.size() | 0 |
5129 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - |
5130 | if (w && w->isVisible() && !w->isWindow()) never evaluated: w->isVisible() never evaluated: !w->isWindow() | 0 |
5131 | QApplication::sendEvent(w, event); never executed: QApplication::sendEvent(w, event); | 0 |
5132 | } | 0 |
5133 | break; | 0 |
5134 | } | - |
5135 | | - |
5136 | | - |
5137 | | - |
5138 | | - |
5139 | | - |
5140 | case QEvent::TouchBegin: | - |
5141 | case QEvent::TouchUpdate: | - |
5142 | case QEvent::TouchEnd: | - |
5143 | case QEvent::TouchCancel: | - |
5144 | { | - |
5145 | event->ignore(); | - |
5146 | break; executed: break; Execution Count:1 | 1 |
5147 | } | - |
5148 | | - |
5149 | case QEvent::Gesture: | - |
5150 | event->ignore(); | - |
5151 | break; | 0 |
5152 | | - |
5153 | | - |
5154 | case QEvent::DynamicPropertyChange: { | - |
5155 | const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName(); | - |
5156 | if (!qstrncmp(propName, "_q_customDpi", 12) && propName.length() == 13) { evaluated: !qstrncmp(propName, "_q_customDpi", 12) yes Evaluation Count:4 | yes Evaluation Count:1960 |
partially evaluated: propName.length() == 13 yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-1960 |
5157 | uint value = property(propName.constData()).toUInt(); | - |
5158 | if (!d->extra) evaluated: !d->extra yes Evaluation Count:1 | yes Evaluation Count:3 |
| 1-3 |
5159 | d->createExtra(); executed: d->createExtra(); Execution Count:1 | 1 |
5160 | const char axis = propName.at(12); | - |
5161 | if (axis == 'X') evaluated: axis == 'X' yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
5162 | d->extra->customDpiX = value; executed: d->extra->customDpiX = value; Execution Count:2 | 2 |
5163 | else if (axis == 'Y') partially evaluated: axis == 'Y' yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
5164 | d->extra->customDpiY = value; executed: d->extra->customDpiY = value; Execution Count:2 | 2 |
5165 | d->updateFont(d->data.fnt); | - |
5166 | } executed: } Execution Count:4 | 4 |
5167 | | - |
5168 | } | - |
5169 | | - |
5170 | default: | - |
5171 | return QObject::event(event); executed: return QObject::event(event); Execution Count:279696 | 279696 |
5172 | } | - |
5173 | return true; executed: return true; Execution Count:309077 | 309077 |
5174 | } | - |
5175 | void QWidget::changeEvent(QEvent * event) | - |
5176 | { | - |
5177 | switch(event->type()) { | - |
5178 | case QEvent::EnabledChange: { | - |
5179 | update(); | - |
5180 | | - |
5181 | QAccessible::State s; | - |
5182 | s.disabled = true; | - |
5183 | QAccessibleStateChangeEvent event(this, s); | - |
5184 | QAccessible::updateAccessibility(&event); | - |
5185 | | - |
5186 | break; executed: break; Execution Count:3015 | 3015 |
5187 | } | - |
5188 | | - |
5189 | case QEvent::FontChange: | - |
5190 | case QEvent::StyleChange: { | - |
5191 | QWidgetPrivate * const d = d_func(); | - |
5192 | update(); | - |
5193 | updateGeometry(); | - |
5194 | if (d->layout) evaluated: d->layout yes Evaluation Count:1479 | yes Evaluation Count:4890 |
| 1479-4890 |
5195 | d->layout->invalidate(); executed: d->layout->invalidate(); Execution Count:1479 | 1479 |
5196 | break; executed: break; Execution Count:6369 | 6369 |
5197 | } | - |
5198 | | - |
5199 | case QEvent::PaletteChange: | - |
5200 | update(); | - |
5201 | break; executed: break; Execution Count:21716 | 21716 |
5202 | | - |
5203 | case QEvent::ThemeChange: | - |
5204 | if (QApplication::desktopSettingsAware() && windowType() != Qt::Desktop never evaluated: QApplication::desktopSettingsAware() never evaluated: windowType() != Qt::Desktop | 0 |
5205 | && (static_cast<QApplication *>(QCoreApplication::instance())) && !QApplication::closingDown()) { never evaluated: (static_cast<QApplication *>(QCoreApplication::instance())) never evaluated: !QApplication::closingDown() | 0 |
5206 | if (testAttribute(Qt::WA_WState_Polished)) never evaluated: testAttribute(Qt::WA_WState_Polished) | 0 |
5207 | QApplication::style()->unpolish(this); never executed: QApplication::style()->unpolish(this); | 0 |
5208 | if (testAttribute(Qt::WA_WState_Polished)) never evaluated: testAttribute(Qt::WA_WState_Polished) | 0 |
5209 | QApplication::style()->polish(this); never executed: QApplication::style()->polish(this); | 0 |
5210 | QEvent styleChangedEvent(QEvent::StyleChange); | - |
5211 | QCoreApplication::sendEvent(this, &styleChangedEvent); | - |
5212 | if (isVisible()) never evaluated: isVisible() | 0 |
5213 | update(); never executed: update(); | 0 |
5214 | } | 0 |
5215 | break; | 0 |
5216 | default: | - |
5217 | break; executed: break; Execution Count:60035 | 60035 |
5218 | } | - |
5219 | } executed: } Execution Count:91135 | 91135 |
5220 | void QWidget::mouseMoveEvent(QMouseEvent *event) | - |
5221 | { | - |
5222 | event->ignore(); | - |
5223 | } executed: } Execution Count:1 | 1 |
5224 | void QWidget::mousePressEvent(QMouseEvent *event) | - |
5225 | { | - |
5226 | event->ignore(); | - |
5227 | if ((windowType() == Qt::Popup)) { partially evaluated: (windowType() == Qt::Popup) no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
5228 | event->accept(); | - |
5229 | QWidget* w; | - |
5230 | while ((w = QApplication::activePopupWidget()) && w != this){ never evaluated: (w = QApplication::activePopupWidget()) never evaluated: w != this | 0 |
5231 | w->close(); | - |
5232 | if (QApplication::activePopupWidget() == w) never evaluated: QApplication::activePopupWidget() == w | 0 |
5233 | w->hide(); never executed: w->hide(); | 0 |
5234 | } | 0 |
5235 | if (!rect().contains(event->pos())){ never evaluated: !rect().contains(event->pos()) | 0 |
5236 | close(); | - |
5237 | } | 0 |
5238 | } | 0 |
5239 | } executed: } Execution Count:15 | 15 |
5240 | void QWidget::mouseReleaseEvent(QMouseEvent *event) | - |
5241 | { | - |
5242 | event->ignore(); | - |
5243 | } executed: } Execution Count:8 | 8 |
5244 | void QWidget::mouseDoubleClickEvent(QMouseEvent *event) | - |
5245 | { | - |
5246 | event->ignore(); | - |
5247 | } executed: } Execution Count:12 | 12 |
5248 | void QWidget::wheelEvent(QWheelEvent *event) | - |
5249 | { | - |
5250 | event->ignore(); | - |
5251 | } executed: } Execution Count:2 | 2 |
5252 | void QWidget::tabletEvent(QTabletEvent *event) | - |
5253 | { | - |
5254 | event->ignore(); | - |
5255 | } | 0 |
5256 | void QWidget::keyPressEvent(QKeyEvent *event) | - |
5257 | { | - |
5258 | if ((windowType() == Qt::Popup) && event->key() == Qt::Key_Escape) { partially evaluated: (windowType() == Qt::Popup) no Evaluation Count:0 | yes Evaluation Count:543 |
never evaluated: event->key() == Qt::Key_Escape | 0-543 |
5259 | event->accept(); | - |
5260 | close(); | - |
5261 | } else { | 0 |
5262 | event->ignore(); | - |
5263 | } executed: } Execution Count:543 | 543 |
5264 | } | - |
5265 | void QWidget::keyReleaseEvent(QKeyEvent *event) | - |
5266 | { | - |
5267 | event->ignore(); | - |
5268 | } executed: } Execution Count:6312 | 6312 |
5269 | void QWidget::focusInEvent(QFocusEvent *) | - |
5270 | { | - |
5271 | if (focusPolicy() != Qt::NoFocus || !isWindow()) { evaluated: focusPolicy() != Qt::NoFocus yes Evaluation Count:1345 | yes Evaluation Count:96 |
evaluated: !isWindow() yes Evaluation Count:5 | yes Evaluation Count:91 |
| 5-1345 |
5272 | update(); | - |
5273 | } executed: } Execution Count:1350 | 1350 |
5274 | } executed: } Execution Count:1441 | 1441 |
5275 | void QWidget::focusOutEvent(QFocusEvent *) | - |
5276 | { | - |
5277 | if (focusPolicy() != Qt::NoFocus || !isWindow()) evaluated: focusPolicy() != Qt::NoFocus yes Evaluation Count:1257 | yes Evaluation Count:24 |
evaluated: !isWindow() yes Evaluation Count:7 | yes Evaluation Count:17 |
| 7-1257 |
5278 | update(); executed: update(); Execution Count:1264 | 1264 |
5279 | } executed: } Execution Count:1281 | 1281 |
5280 | void QWidget::enterEvent(QEvent *) | - |
5281 | { | - |
5282 | } | - |
5283 | void QWidget::leaveEvent(QEvent *) | - |
5284 | { | - |
5285 | } | - |
5286 | void QWidget::paintEvent(QPaintEvent *) | - |
5287 | { | - |
5288 | } | - |
5289 | void QWidget::moveEvent(QMoveEvent *) | - |
5290 | { | - |
5291 | } | - |
5292 | void QWidget::resizeEvent(QResizeEvent * ) | - |
5293 | { | - |
5294 | } | - |
5295 | void QWidget::actionEvent(QActionEvent *) | - |
5296 | { | - |
5297 | | - |
5298 | } | - |
5299 | void QWidget::closeEvent(QCloseEvent *event) | - |
5300 | { | - |
5301 | event->accept(); | - |
5302 | } executed: } Execution Count:61 | 61 |
5303 | void QWidget::contextMenuEvent(QContextMenuEvent *event) | - |
5304 | { | - |
5305 | event->ignore(); | - |
5306 | } | 0 |
5307 | void QWidget::inputMethodEvent(QInputMethodEvent *event) | - |
5308 | { | - |
5309 | event->ignore(); | - |
5310 | } executed: } Execution Count:6 | 6 |
5311 | QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const | - |
5312 | { | - |
5313 | switch(query) { | - |
5314 | case Qt::ImCursorRectangle: | - |
5315 | return QRect(width()/2, 0, 1, height()); executed: return QRect(width()/2, 0, 1, height()); Execution Count:1 | 1 |
5316 | case Qt::ImFont: | - |
5317 | return font(); never executed: return font(); | 0 |
5318 | case Qt::ImAnchorPosition: | - |
5319 | | - |
5320 | return inputMethodQuery(Qt::ImCursorPosition); never executed: return inputMethodQuery(Qt::ImCursorPosition); | 0 |
5321 | case Qt::ImHints: | - |
5322 | return (int)inputMethodHints(); executed: return (int)inputMethodHints(); Execution Count:6 | 6 |
5323 | default: | - |
5324 | return QVariant(); executed: return QVariant(); Execution Count:3473 | 3473 |
5325 | } | - |
5326 | } | 0 |
5327 | Qt::InputMethodHints QWidget::inputMethodHints() const | - |
5328 | { | - |
5329 | | - |
5330 | const QWidgetPrivate *priv = d_func(); | - |
5331 | while (priv->inheritsInputMethodHints) { evaluated: priv->inheritsInputMethodHints yes Evaluation Count:4 | yes Evaluation Count:77 |
| 4-77 |
5332 | priv = priv->q_func()->parentWidget()->d_func(); | - |
5333 | qt_noop(); | - |
5334 | } executed: } Execution Count:4 | 4 |
5335 | return priv->imHints; executed: return priv->imHints; Execution Count:77 | 77 |
5336 | | - |
5337 | | - |
5338 | | - |
5339 | } | - |
5340 | | - |
5341 | void QWidget::setInputMethodHints(Qt::InputMethodHints hints) | - |
5342 | { | - |
5343 | | - |
5344 | QWidgetPrivate * const d = d_func(); | - |
5345 | if (d->imHints == hints) evaluated: d->imHints == hints yes Evaluation Count:2782 | yes Evaluation Count:461 |
| 461-2782 |
5346 | return; executed: return; Execution Count:2782 | 2782 |
5347 | d->imHints = hints; | - |
5348 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImHints); | - |
5349 | | - |
5350 | } executed: } Execution Count:461 | 461 |
5351 | void QWidget::dragEnterEvent(QDragEnterEvent *) | - |
5352 | { | - |
5353 | } | - |
5354 | void QWidget::dragMoveEvent(QDragMoveEvent *) | - |
5355 | { | - |
5356 | } | - |
5357 | void QWidget::dragLeaveEvent(QDragLeaveEvent *) | - |
5358 | { | - |
5359 | } | - |
5360 | void QWidget::dropEvent(QDropEvent *) | - |
5361 | { | - |
5362 | } | - |
5363 | void QWidget::showEvent(QShowEvent *) | - |
5364 | { | - |
5365 | } | - |
5366 | void QWidget::hideEvent(QHideEvent *) | - |
5367 | { | - |
5368 | } | - |
5369 | bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result) | - |
5370 | { | - |
5371 | (void)eventType;; | - |
5372 | (void)message;; | - |
5373 | (void)result;; | - |
5374 | return false; executed: return false; Execution Count:67454 | 67454 |
5375 | } | - |
5376 | void QWidget::ensurePolished() const | - |
5377 | { | - |
5378 | const QWidgetPrivate * const d = d_func(); | - |
5379 | | - |
5380 | const QMetaObject *m = metaObject(); | - |
5381 | if (m == d->polished) evaluated: m == d->polished yes Evaluation Count:185046 | yes Evaluation Count:37234 |
| 37234-185046 |
5382 | return; executed: return; Execution Count:185046 | 185046 |
5383 | d->polished = m; | - |
5384 | | - |
5385 | QEvent e(QEvent::Polish); | - |
5386 | QCoreApplication::sendEvent(const_cast<QWidget *>(this), &e); | - |
5387 | | - |
5388 | | - |
5389 | QList<QObject*> children = d->children; | - |
5390 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:49032 | yes Evaluation Count:37234 |
| 37234-49032 |
5391 | QObject *o = children.at(i); | - |
5392 | if(!o->isWidgetType()) evaluated: !o->isWidgetType() yes Evaluation Count:19578 | yes Evaluation Count:29454 |
| 19578-29454 |
5393 | continue; executed: continue; Execution Count:19578 | 19578 |
5394 | if (QWidget *w = qobject_cast<QWidget *>(o)) partially evaluated: QWidget *w = qobject_cast<QWidget *>(o) yes Evaluation Count:29454 | no Evaluation Count:0 |
| 0-29454 |
5395 | w->ensurePolished(); executed: w->ensurePolished(); Execution Count:29454 | 29454 |
5396 | } executed: } Execution Count:29454 | 29454 |
5397 | | - |
5398 | if (d->parent && d->sendChildEvents) { evaluated: d->parent yes Evaluation Count:33946 | yes Evaluation Count:3288 |
evaluated: d->sendChildEvents yes Evaluation Count:33945 | yes Evaluation Count:1 |
| 1-33946 |
5399 | QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this)); | - |
5400 | QCoreApplication::sendEvent(d->parent, &e); | - |
5401 | } executed: } Execution Count:33945 | 33945 |
5402 | } executed: } Execution Count:37234 | 37234 |
5403 | | - |
5404 | | - |
5405 | | - |
5406 | | - |
5407 | | - |
5408 | | - |
5409 | | - |
5410 | QRegion QWidget::mask() const | - |
5411 | { | - |
5412 | const QWidgetPrivate * const d = d_func(); | - |
5413 | return d->extra ? d->extra->mask : QRegion(); executed: return d->extra ? d->extra->mask : QRegion(); Execution Count:783 | 783 |
5414 | } | - |
5415 | QLayout *QWidget::layout() const | - |
5416 | { | - |
5417 | return d_func()->layout; executed: return d_func()->layout; Execution Count:57774 | 57774 |
5418 | } | - |
5419 | void QWidget::setLayout(QLayout *l) | - |
5420 | { | - |
5421 | if (!l) { evaluated: !l yes Evaluation Count:1 | yes Evaluation Count:10623 |
| 1-10623 |
5422 | QMessageLogger("kernel/qwidget.cpp", 9117, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Cannot set layout to 0"); | - |
5423 | return; executed: return; Execution Count:1 | 1 |
5424 | } | - |
5425 | if (layout()) { evaluated: layout() yes Evaluation Count:24 | yes Evaluation Count:10599 |
| 24-10599 |
5426 | if (layout() != l) partially evaluated: layout() != l no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
5427 | QMessageLogger("kernel/qwidget.cpp", 9122, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" | 0 |
5428 | " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), | 0 |
5429 | objectName().toLocal8Bit().data()); never executed: QMessageLogger("kernel/qwidget.cpp", 9122, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), objectName().toLocal8Bit().data()); | 0 |
5430 | return; executed: return; Execution Count:24 | 24 |
5431 | } | - |
5432 | | - |
5433 | QObject *oldParent = l->parent(); | - |
5434 | if (oldParent && oldParent != this) { evaluated: oldParent yes Evaluation Count:88 | yes Evaluation Count:10511 |
evaluated: oldParent != this yes Evaluation Count:1 | yes Evaluation Count:87 |
| 1-10511 |
5435 | if (oldParent->isWidgetType()) { partially evaluated: oldParent->isWidgetType() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
5436 | | - |
5437 | | - |
5438 | QWidget *oldParentWidget = static_cast<QWidget *>(oldParent); | - |
5439 | oldParentWidget->takeLayout(); | - |
5440 | } else { executed: } Execution Count:1 | 1 |
5441 | QMessageLogger("kernel/qwidget.cpp", 9136, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent", | - |
5442 | l->objectName().toLocal8Bit().data(), metaObject()->className(), | - |
5443 | objectName().toLocal8Bit().data()); | - |
5444 | return; | 0 |
5445 | } | - |
5446 | } | - |
5447 | | - |
5448 | QWidgetPrivate * const d = d_func(); | - |
5449 | l->d_func()->topLevel = true; | - |
5450 | d->layout = l; | - |
5451 | if (oldParent != this) { evaluated: oldParent != this yes Evaluation Count:10512 | yes Evaluation Count:87 |
| 87-10512 |
5452 | l->setParent(this); | - |
5453 | l->d_func()->reparentChildWidgets(this); | - |
5454 | l->invalidate(); | - |
5455 | } executed: } Execution Count:10512 | 10512 |
5456 | | - |
5457 | if (isWindow() && d->maybeTopData()) evaluated: isWindow() yes Evaluation Count:262 | yes Evaluation Count:10337 |
evaluated: d->maybeTopData() yes Evaluation Count:5 | yes Evaluation Count:257 |
| 5-10337 |
5458 | d->topData()->sizeAdjusted = false; executed: d->topData()->sizeAdjusted = false; Execution Count:5 | 5 |
5459 | } executed: } Execution Count:10599 | 10599 |
5460 | QLayout *QWidget::takeLayout() | - |
5461 | { | - |
5462 | QWidgetPrivate * const d = d_func(); | - |
5463 | QLayout *l = layout(); | - |
5464 | if (!l) partially evaluated: !l no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5465 | return 0; never executed: return 0; | 0 |
5466 | d->layout = 0; | - |
5467 | l->setParent(0); | - |
5468 | return l; executed: return l; Execution Count:1 | 1 |
5469 | } | - |
5470 | QSizePolicy QWidget::sizePolicy() const | - |
5471 | { | - |
5472 | const QWidgetPrivate * const d = d_func(); | - |
5473 | return d->size_policy; executed: return d->size_policy; Execution Count:109807 | 109807 |
5474 | } | - |
5475 | | - |
5476 | void QWidget::setSizePolicy(QSizePolicy policy) | - |
5477 | { | - |
5478 | QWidgetPrivate * const d = d_func(); | - |
5479 | setAttribute(Qt::WA_WState_OwnSizePolicy); | - |
5480 | if (policy == d->size_policy) evaluated: policy == d->size_policy yes Evaluation Count:577 | yes Evaluation Count:33145 |
| 577-33145 |
5481 | return; executed: return; Execution Count:577 | 577 |
5482 | d->size_policy = policy; | - |
5483 | | - |
5484 | | - |
5485 | if (QWExtra *extra = d->extra) { evaluated: QWExtra *extra = d->extra yes Evaluation Count:1589 | yes Evaluation Count:31556 |
| 1589-31556 |
5486 | if (extra->proxyWidget) partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1589 |
| 0-1589 |
5487 | extra->proxyWidget->setSizePolicy(policy); never executed: extra->proxyWidget->setSizePolicy(policy); | 0 |
5488 | } executed: } Execution Count:1589 | 1589 |
5489 | | - |
5490 | | - |
5491 | updateGeometry(); | - |
5492 | | - |
5493 | if (isWindow() && d->maybeTopData()) evaluated: isWindow() yes Evaluation Count:7213 | yes Evaluation Count:25932 |
evaluated: d->maybeTopData() yes Evaluation Count:13 | yes Evaluation Count:7200 |
| 13-25932 |
5494 | d->topData()->sizeAdjusted = false; executed: d->topData()->sizeAdjusted = false; Execution Count:13 | 13 |
5495 | } executed: } Execution Count:33145 | 33145 |
5496 | int QWidget::heightForWidth(int w) const | - |
5497 | { | - |
5498 | if (layout() && layout()->hasHeightForWidth()) evaluated: layout() yes Evaluation Count:68 | yes Evaluation Count:5 |
partially evaluated: layout()->hasHeightForWidth() yes Evaluation Count:68 | no Evaluation Count:0 |
| 0-68 |
5499 | return layout()->totalHeightForWidth(w); executed: return layout()->totalHeightForWidth(w); Execution Count:68 | 68 |
5500 | return -1; executed: return -1; Execution Count:5 | 5 |
5501 | } | - |
5502 | | - |
5503 | | - |
5504 | | - |
5505 | | - |
5506 | | - |
5507 | | - |
5508 | | - |
5509 | bool QWidget::hasHeightForWidth() const | - |
5510 | { | - |
5511 | const QWidgetPrivate * const d = d_func(); | - |
5512 | return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); executed: return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); Execution Count:18198 | 18198 |
5513 | } | - |
5514 | QWidget *QWidget::childAt(const QPoint &p) const | - |
5515 | { | - |
5516 | return d_func()->childAt_helper(p, false); executed: return d_func()->childAt_helper(p, false); Execution Count:2087 | 2087 |
5517 | } | - |
5518 | | - |
5519 | QWidget *QWidgetPrivate::childAt_helper(const QPoint &p, bool ignoreChildrenInDestructor) const | - |
5520 | { | - |
5521 | if (children.isEmpty()) evaluated: children.isEmpty() yes Evaluation Count:552 | yes Evaluation Count:2013 |
| 552-2013 |
5522 | return 0; executed: return 0; Execution Count:552 | 552 |
5523 | if (!pointInsideRectAndMask(p)) evaluated: !pointInsideRectAndMask(p) yes Evaluation Count:15 | yes Evaluation Count:1998 |
| 15-1998 |
5524 | return 0; executed: return 0; Execution Count:15 | 15 |
5525 | return childAtRecursiveHelper(p, ignoreChildrenInDestructor); executed: return childAtRecursiveHelper(p, ignoreChildrenInDestructor); Execution Count:1998 | 1998 |
5526 | } | - |
5527 | | - |
5528 | QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChildrenInDestructor, bool includeFrame) const | - |
5529 | { | - |
5530 | | - |
5531 | (void)includeFrame;; | - |
5532 | | - |
5533 | for (int i = children.size() - 1; i >= 0; --i) { evaluated: i >= 0 yes Evaluation Count:10599 | yes Evaluation Count:1998 |
| 1998-10599 |
5534 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
5535 | if (!child || child->isWindow() || child->isHidden() || child->testAttribute(Qt::WA_TransparentForMouseEvents) evaluated: !child yes Evaluation Count:2982 | yes Evaluation Count:7617 |
evaluated: child->isWindow() yes Evaluation Count:14 | yes Evaluation Count:7603 |
evaluated: child->isHidden() yes Evaluation Count:1370 | yes Evaluation Count:6233 |
evaluated: child->testAttribute(Qt::WA_TransparentForMouseEvents) yes Evaluation Count:4 | yes Evaluation Count:6229 |
| 4-7617 |
5536 | || (ignoreChildrenInDestructor && child->data->in_destructor)) { evaluated: ignoreChildrenInDestructor yes Evaluation Count:72 | yes Evaluation Count:6157 |
evaluated: child->data->in_destructor yes Evaluation Count:65 | yes Evaluation Count:7 |
| 7-6157 |
5537 | continue; executed: continue; Execution Count:4435 | 4435 |
5538 | } | - |
5539 | | - |
5540 | | - |
5541 | QPoint childPoint = p; | - |
5542 | childPoint -= child->data->crect.topLeft(); | - |
5543 | | - |
5544 | | - |
5545 | if (!child->d_func()->pointInsideRectAndMask(childPoint)) evaluated: !child->d_func()->pointInsideRectAndMask(childPoint) yes Evaluation Count:3500 | yes Evaluation Count:2664 |
| 2664-3500 |
5546 | continue; executed: continue; Execution Count:3500 | 3500 |
5547 | | - |
5548 | | - |
5549 | if (QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor)) evaluated: QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor) yes Evaluation Count:899 | yes Evaluation Count:1765 |
| 899-1765 |
5550 | return w; executed: return w; Execution Count:899 | 899 |
5551 | | - |
5552 | | - |
5553 | return child; executed: return child; Execution Count:1765 | 1765 |
5554 | } | - |
5555 | return 0; executed: return 0; Execution Count:1998 | 1998 |
5556 | } | - |
5557 | | - |
5558 | void QWidgetPrivate::updateGeometry_helper(bool forceUpdate) | - |
5559 | { | - |
5560 | QWidget * const q = q_func(); | - |
5561 | if (widgetItem) evaluated: widgetItem yes Evaluation Count:14295 | yes Evaluation Count:59822 |
| 14295-59822 |
5562 | widgetItem->invalidateSizeCache(); executed: widgetItem->invalidateSizeCache(); Execution Count:14295 | 14295 |
5563 | QWidget *parent; | - |
5564 | if (forceUpdate || !extra || extra->minw != extra->maxw || extra->minh != extra->maxh) { evaluated: forceUpdate yes Evaluation Count:5280 | yes Evaluation Count:68837 |
evaluated: !extra yes Evaluation Count:52751 | yes Evaluation Count:16086 |
evaluated: extra->minw != extra->maxw yes Evaluation Count:15900 | yes Evaluation Count:186 |
evaluated: extra->minh != extra->maxh yes Evaluation Count:18 | yes Evaluation Count:168 |
| 18-68837 |
5565 | if (!q->isWindow() && !q->isHidden() && (parent = q->parentWidget())) { evaluated: !q->isWindow() yes Evaluation Count:57253 | yes Evaluation Count:16696 |
evaluated: !q->isHidden() yes Evaluation Count:55267 | yes Evaluation Count:1986 |
partially evaluated: (parent = q->parentWidget()) yes Evaluation Count:55267 | no Evaluation Count:0 |
| 0-57253 |
5566 | if (parent->d_func()->layout) evaluated: parent->d_func()->layout yes Evaluation Count:24578 | yes Evaluation Count:30689 |
| 24578-30689 |
5567 | parent->d_func()->layout->invalidate(); executed: parent->d_func()->layout->invalidate(); Execution Count:24578 | 24578 |
5568 | else if (parent->isVisible()) evaluated: parent->isVisible() yes Evaluation Count:3308 | yes Evaluation Count:27381 |
| 3308-27381 |
5569 | QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); executed: QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); Execution Count:3308 | 3308 |
5570 | } | - |
5571 | } executed: } Execution Count:73949 | 73949 |
5572 | } executed: } Execution Count:74117 | 74117 |
5573 | void QWidget::updateGeometry() | - |
5574 | { | - |
5575 | QWidgetPrivate * const d = d_func(); | - |
5576 | d->updateGeometry_helper(false); | - |
5577 | } executed: } Execution Count:64381 | 64381 |
5578 | void QWidget::setWindowFlags(Qt::WindowFlags flags) | - |
5579 | { | - |
5580 | if (data->window_flags == flags) evaluated: data->window_flags == flags yes Evaluation Count:25 | yes Evaluation Count:575 |
| 25-575 |
5581 | return; executed: return; Execution Count:25 | 25 |
5582 | | - |
5583 | QWidgetPrivate * const d = d_func(); | - |
5584 | | - |
5585 | if ((data->window_flags | flags) & Qt::Window) { evaluated: (data->window_flags | flags) & Qt::Window yes Evaluation Count:469 | yes Evaluation Count:106 |
| 106-469 |
5586 | | - |
5587 | QPoint oldPos = pos(); | - |
5588 | bool visible = isVisible(); | - |
5589 | setParent(parentWidget(), flags); | - |
5590 | | - |
5591 | | - |
5592 | | - |
5593 | if (!((data->window_flags ^ flags) & Qt::Window) evaluated: !((data->window_flags ^ flags) & Qt::Window) yes Evaluation Count:409 | yes Evaluation Count:60 |
| 60-409 |
5594 | && (visible || testAttribute(Qt::WA_Moved))) { evaluated: visible yes Evaluation Count:10 | yes Evaluation Count:399 |
evaluated: testAttribute(Qt::WA_Moved) yes Evaluation Count:5 | yes Evaluation Count:394 |
| 5-399 |
5595 | move(oldPos); | - |
5596 | } executed: } Execution Count:15 | 15 |
5597 | | - |
5598 | d->adjustQuitOnCloseAttribute(); | - |
5599 | } else { executed: } Execution Count:469 | 469 |
5600 | data->window_flags = flags; | - |
5601 | } executed: } Execution Count:106 | 106 |
5602 | } | - |
5603 | void QWidget::overrideWindowFlags(Qt::WindowFlags flags) | - |
5604 | { | - |
5605 | data->window_flags = flags; | - |
5606 | } | 0 |
5607 | void QWidget::setParent(QWidget *parent) | - |
5608 | { | - |
5609 | if (parent == parentWidget()) evaluated: parent == parentWidget() yes Evaluation Count:1974 | yes Evaluation Count:3442 |
| 1974-3442 |
5610 | return; executed: return; Execution Count:1974 | 1974 |
5611 | setParent((QWidget*)parent, windowFlags() & ~Qt::WindowType_Mask); | - |
5612 | } executed: } Execution Count:3442 | 3442 |
5613 | | - |
5614 | | - |
5615 | | - |
5616 | | - |
5617 | | - |
5618 | | - |
5619 | | - |
5620 | void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) | - |
5621 | { | - |
5622 | QWidgetPrivate * const d = d_func(); | - |
5623 | bool resized = testAttribute(Qt::WA_Resized); | - |
5624 | bool wasCreated = testAttribute(Qt::WA_WState_Created); | - |
5625 | QWidget *oldtlw = window(); | - |
5626 | | - |
5627 | QWidget *desktopWidget = 0; | - |
5628 | if (parent && parent->windowType() == Qt::Desktop) evaluated: parent yes Evaluation Count:40989 | yes Evaluation Count:574 |
partially evaluated: parent->windowType() == Qt::Desktop no Evaluation Count:0 | yes Evaluation Count:40989 |
| 0-40989 |
5629 | desktopWidget = parent; never executed: desktopWidget = parent; | 0 |
5630 | bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget; evaluated: (parent != parentWidget()) yes Evaluation Count:41065 | yes Evaluation Count:498 |
evaluated: !wasCreated yes Evaluation Count:475 | yes Evaluation Count:23 |
partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:23 |
| 0-41065 |
5631 | | - |
5632 | if (newParent && parent && !desktopWidget) { evaluated: newParent yes Evaluation Count:41540 | yes Evaluation Count:23 |
evaluated: parent yes Evaluation Count:40970 | yes Evaluation Count:570 |
partially evaluated: !desktopWidget yes Evaluation Count:40970 | no Evaluation Count:0 |
| 0-41540 |
5633 | if (testAttribute(Qt::WA_NativeWindow) && !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) evaluated: testAttribute(Qt::WA_NativeWindow) yes Evaluation Count:8 | yes Evaluation Count:40962 |
evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) yes Evaluation Count:7 | yes Evaluation Count:1 |
| 1-40962 |
5634 | | - |
5635 | | - |
5636 | | - |
5637 | | - |
5638 | | - |
5639 | ) | - |
5640 | parent->d_func()->enforceNativeChildren(); executed: parent->d_func()->enforceNativeChildren(); Execution Count:7 | 7 |
5641 | else if (parent->d_func()->nativeChildrenForced() || parent->testAttribute(Qt::WA_PaintOnScreen)) evaluated: parent->d_func()->nativeChildrenForced() yes Evaluation Count:1 | yes Evaluation Count:40962 |
evaluated: parent->testAttribute(Qt::WA_PaintOnScreen) yes Evaluation Count:2 | yes Evaluation Count:40960 |
| 1-40962 |
5642 | setAttribute(Qt::WA_NativeWindow); executed: setAttribute(Qt::WA_NativeWindow); Execution Count:3 | 3 |
5643 | } | - |
5644 | | - |
5645 | if (wasCreated) { evaluated: wasCreated yes Evaluation Count:131 | yes Evaluation Count:41432 |
| 131-41432 |
5646 | if (!testAttribute(Qt::WA_WState_Hidden)) { evaluated: !testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:49 | yes Evaluation Count:82 |
| 49-82 |
5647 | hide(); | - |
5648 | setAttribute(Qt::WA_WState_ExplicitShowHide, false); | - |
5649 | } executed: } Execution Count:49 | 49 |
5650 | if (newParent) { evaluated: newParent yes Evaluation Count:108 | yes Evaluation Count:23 |
| 23-108 |
5651 | QEvent e(QEvent::ParentAboutToChange); | - |
5652 | QApplication::sendEvent(this, &e); | - |
5653 | } executed: } Execution Count:108 | 108 |
5654 | } executed: } Execution Count:131 | 131 |
5655 | if (newParent && isAncestorOf(focusWidget())) evaluated: newParent yes Evaluation Count:41540 | yes Evaluation Count:23 |
evaluated: isAncestorOf(focusWidget()) yes Evaluation Count:6 | yes Evaluation Count:41534 |
| 6-41540 |
5656 | focusWidget()->clearFocus(); executed: focusWidget()->clearFocus(); Execution Count:6 | 6 |
5657 | | - |
5658 | QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData(); | - |
5659 | QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStoreTracker : 0; evaluated: oldTopExtra yes Evaluation Count:257 | yes Evaluation Count:41306 |
| 257-41306 |
5660 | | - |
5661 | d->setParent_sys(parent, f); | - |
5662 | | - |
5663 | QTLWExtra *topExtra = window()->d_func()->maybeTopData(); | - |
5664 | QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStoreTracker : 0; evaluated: topExtra yes Evaluation Count:2856 | yes Evaluation Count:38707 |
| 2856-38707 |
5665 | if (oldBsTracker && oldBsTracker != bsTracker) evaluated: oldBsTracker yes Evaluation Count:257 | yes Evaluation Count:41306 |
evaluated: oldBsTracker != bsTracker yes Evaluation Count:185 | yes Evaluation Count:72 |
| 72-41306 |
5666 | oldBsTracker->unregisterWidgetSubtree(this); executed: oldBsTracker->unregisterWidgetSubtree(this); Execution Count:185 | 185 |
5667 | | - |
5668 | if (desktopWidget) partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:41563 |
| 0-41563 |
5669 | parent = 0; never executed: parent = 0; | 0 |
5670 | | - |
5671 | if (QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore()) { evaluated: QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore() yes Evaluation Count:825 | yes Evaluation Count:40738 |
| 825-40738 |
5672 | if (newParent) evaluated: newParent yes Evaluation Count:802 | yes Evaluation Count:23 |
| 23-802 |
5673 | oldBs->removeDirtyWidget(this); executed: oldBs->removeDirtyWidget(this); Execution Count:802 | 802 |
5674 | | - |
5675 | | - |
5676 | oldBs->moveStaticWidgets(this); | - |
5677 | } executed: } Execution Count:825 | 825 |
5678 | | - |
5679 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) && !testAttribute(Qt::WA_WState_Created)) evaluated: QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) yes Evaluation Count:2 | yes Evaluation Count:41561 |
partially evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-41561 |
5680 | create(); executed: create(); Execution Count:2 | 2 |
5681 | | - |
5682 | d->reparentFocusWidgets(oldtlw); | - |
5683 | setAttribute(Qt::WA_Resized, resized); | - |
5684 | if (!testAttribute(Qt::WA_StyleSheet) partially evaluated: !testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:41563 | no Evaluation Count:0 |
| 0-41563 |
5685 | && (!parent || !parent->testAttribute(Qt::WA_StyleSheet))) { evaluated: !parent yes Evaluation Count:574 | yes Evaluation Count:40989 |
evaluated: !parent->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:40979 | yes Evaluation Count:10 |
| 10-40989 |
5686 | d->resolveFont(); | - |
5687 | d->resolvePalette(); | - |
5688 | } executed: } Execution Count:41553 | 41553 |
5689 | d->resolveLayoutDirection(); | - |
5690 | d->resolveLocale(); | - |
5691 | | - |
5692 | | - |
5693 | | - |
5694 | | - |
5695 | | - |
5696 | if (newParent evaluated: newParent yes Evaluation Count:41540 | yes Evaluation Count:23 |
| 23-41540 |
5697 | | - |
5698 | | - |
5699 | | - |
5700 | ) { | - |
5701 | | - |
5702 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:40322 | yes Evaluation Count:1218 |
| 1218-40322 |
5703 | if (!testAttribute(Qt::WA_ForceDisabled)) partially evaluated: !testAttribute(Qt::WA_ForceDisabled) yes Evaluation Count:40322 | no Evaluation Count:0 |
| 0-40322 |
5704 | d->setEnabled_helper(parent ? parent->isEnabled() : true); executed: d->setEnabled_helper(parent ? parent->isEnabled() : true); Execution Count:40322 | 40322 |
5705 | if (!testAttribute(Qt::WA_ForceUpdatesDisabled)) partially evaluated: !testAttribute(Qt::WA_ForceUpdatesDisabled) yes Evaluation Count:40322 | no Evaluation Count:0 |
| 0-40322 |
5706 | d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); executed: d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); Execution Count:40322 | 40322 |
5707 | } executed: } Execution Count:40322 | 40322 |
5708 | d->inheritStyle(); | - |
5709 | | - |
5710 | | - |
5711 | if (parent && d->sendChildEvents) { evaluated: parent yes Evaluation Count:40970 | yes Evaluation Count:570 |
evaluated: d->sendChildEvents yes Evaluation Count:40969 | yes Evaluation Count:1 |
| 1-40970 |
5712 | QChildEvent e(QEvent::ChildAdded, this); | - |
5713 | QApplication::sendEvent(parent, &e); | - |
5714 | } executed: } Execution Count:40969 | 40969 |
5715 | if (parent && d->sendChildEvents && d->polished) { evaluated: parent yes Evaluation Count:40970 | yes Evaluation Count:570 |
evaluated: d->sendChildEvents yes Evaluation Count:40969 | yes Evaluation Count:1 |
evaluated: d->polished yes Evaluation Count:126 | yes Evaluation Count:40843 |
| 1-40970 |
5716 | QChildEvent e(QEvent::ChildPolished, this); | - |
5717 | QCoreApplication::sendEvent(parent, &e); | - |
5718 | } executed: } Execution Count:126 | 126 |
5719 | | - |
5720 | QEvent e(QEvent::ParentChange); | - |
5721 | QApplication::sendEvent(this, &e); | - |
5722 | } executed: } Execution Count:41540 | 41540 |
5723 | | - |
5724 | if (!wasCreated) { evaluated: !wasCreated yes Evaluation Count:41432 | yes Evaluation Count:131 |
| 131-41432 |
5725 | if (isWindow() || parentWidget()->isVisible()) evaluated: isWindow() yes Evaluation Count:1110 | yes Evaluation Count:40322 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:471 | yes Evaluation Count:39851 |
| 471-40322 |
5726 | setAttribute(Qt::WA_WState_Hidden, true); executed: setAttribute(Qt::WA_WState_Hidden, true); Execution Count:1581 | 1581 |
5727 | else if (!testAttribute(Qt::WA_WState_ExplicitShowHide)) evaluated: !testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:39837 | yes Evaluation Count:14 |
| 14-39837 |
5728 | setAttribute(Qt::WA_WState_Hidden, false); executed: setAttribute(Qt::WA_WState_Hidden, false); Execution Count:39837 | 39837 |
5729 | } | - |
5730 | | - |
5731 | d->updateIsOpaque(); | - |
5732 | | - |
5733 | | - |
5734 | | - |
5735 | | - |
5736 | if (oldtlw->graphicsProxyWidget()) { partially evaluated: oldtlw->graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:41563 |
| 0-41563 |
5737 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(oldtlw)) never evaluated: QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(oldtlw) | 0 |
5738 | ancestorProxy->d_func()->unembedSubWindow(this); never executed: ancestorProxy->d_func()->unembedSubWindow(this); | 0 |
5739 | } | 0 |
5740 | if (isWindow() && parent && !graphicsProxyWidget() && !bypassGraphicsProxyWidget(this)) { evaluated: isWindow() yes Evaluation Count:1218 | yes Evaluation Count:40345 |
evaluated: parent yes Evaluation Count:644 | yes Evaluation Count:574 |
partially evaluated: !graphicsProxyWidget() yes Evaluation Count:644 | no Evaluation Count:0 |
evaluated: !bypassGraphicsProxyWidget(this) yes Evaluation Count:637 | yes Evaluation Count:7 |
| 0-40345 |
5741 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(parent)) partially evaluated: QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(parent) no Evaluation Count:0 | yes Evaluation Count:637 |
| 0-637 |
5742 | ancestorProxy->d_func()->embedSubWindow(this); never executed: ancestorProxy->d_func()->embedSubWindow(this); | 0 |
5743 | } executed: } Execution Count:637 | 637 |
5744 | | - |
5745 | } executed: } Execution Count:41563 | 41563 |
5746 | void QWidget::scroll(int dx, int dy) | - |
5747 | { | - |
5748 | if ((!updatesEnabled() && children().size() == 0) || !isVisible()) evaluated: !updatesEnabled() yes Evaluation Count:2 | yes Evaluation Count:14703 |
partially evaluated: children().size() == 0 yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: !isVisible() yes Evaluation Count:52 | yes Evaluation Count:14651 |
| 0-14703 |
5749 | return; executed: return; Execution Count:54 | 54 |
5750 | if (dx == 0 && dy == 0) evaluated: dx == 0 yes Evaluation Count:2141 | yes Evaluation Count:12510 |
evaluated: dy == 0 yes Evaluation Count:2 | yes Evaluation Count:2139 |
| 2-12510 |
5751 | return; executed: return; Execution Count:2 | 2 |
5752 | QWidgetPrivate * const d = d_func(); | - |
5753 | | - |
5754 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)) { partially evaluated: QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this) no Evaluation Count:0 | yes Evaluation Count:14649 |
| 0-14649 |
5755 | | - |
5756 | | - |
5757 | | - |
5758 | if (!d->dirty.isEmpty()) { never evaluated: !d->dirty.isEmpty() | 0 |
5759 | for (QForeachContainer<__typeof__((d->dirty.translated(dx, dy)).rects())> _container_((d->dirty.translated(dx, dy)).rects()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &rect = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
5760 | proxy->update(rect); never executed: proxy->update(rect); | 0 |
5761 | } | 0 |
5762 | proxy->scroll(dx, dy, proxy->subWidgetRect(this)); | - |
5763 | return; | 0 |
5764 | } | - |
5765 | | - |
5766 | d->setDirtyOpaqueRegion(); | - |
5767 | d->scroll_sys(dx, dy); | - |
5768 | } executed: } Execution Count:14649 | 14649 |
5769 | void QWidget::scroll(int dx, int dy, const QRect &r) | - |
5770 | { | - |
5771 | | - |
5772 | if ((!updatesEnabled() && children().size() == 0) || !isVisible()) never evaluated: !updatesEnabled() never evaluated: children().size() == 0 never evaluated: !isVisible() | 0 |
5773 | return; | 0 |
5774 | if (dx == 0 && dy == 0) | 0 |
5775 | return; | 0 |
5776 | QWidgetPrivate * const d = d_func(); | - |
5777 | | - |
5778 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)) { never evaluated: QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this) | 0 |
5779 | | - |
5780 | | - |
5781 | | - |
5782 | if (!d->dirty.isEmpty()) { never evaluated: !d->dirty.isEmpty() | 0 |
5783 | for (QForeachContainer<__typeof__((d->dirty.translated(dx, dy) & r).rects())> _container_((d->dirty.translated(dx, dy) & r).rects()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &rect = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
5784 | proxy->update(rect); never executed: proxy->update(rect); | 0 |
5785 | } | 0 |
5786 | proxy->scroll(dx, dy, r.translated(proxy->subWidgetRect(this).topLeft().toPoint())); | - |
5787 | return; | 0 |
5788 | } | - |
5789 | | - |
5790 | d->scroll_sys(dx, dy, r); | - |
5791 | } | 0 |
5792 | void QWidget::repaint() | - |
5793 | { | - |
5794 | repaint(rect()); | - |
5795 | } executed: } Execution Count:382 | 382 |
5796 | void QWidget::repaint(int x, int y, int w, int h) | - |
5797 | { | - |
5798 | if (x > data->crect.width() || y > data->crect.height()) partially evaluated: x > data->crect.width() no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: y > data->crect.height() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5799 | return; | 0 |
5800 | | - |
5801 | if (w < 0) partially evaluated: w < 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5802 | w = data->crect.width() - x; never executed: w = data->crect.width() - x; | 0 |
5803 | if (h < 0) partially evaluated: h < 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5804 | h = data->crect.height() - y; never executed: h = data->crect.height() - y; | 0 |
5805 | | - |
5806 | repaint(QRect(x, y, w, h)); | - |
5807 | } executed: } Execution Count:1 | 1 |
5808 | | - |
5809 | | - |
5810 | | - |
5811 | | - |
5812 | | - |
5813 | void QWidget::repaint(const QRect &rect) | - |
5814 | { | - |
5815 | QWidgetPrivate * const d = d_func(); | - |
5816 | | - |
5817 | if (testAttribute(Qt::WA_WState_ConfigPending)) { partially evaluated: testAttribute(Qt::WA_WState_ConfigPending) no Evaluation Count:0 | yes Evaluation Count:412 |
| 0-412 |
5818 | update(rect); | - |
5819 | return; | 0 |
5820 | } | - |
5821 | | - |
5822 | if (!isVisible() || !updatesEnabled() || rect.isEmpty()) evaluated: !isVisible() yes Evaluation Count:143 | yes Evaluation Count:269 |
partially evaluated: !updatesEnabled() no Evaluation Count:0 | yes Evaluation Count:269 |
evaluated: rect.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:266 |
| 0-269 |
5823 | return; executed: return; Execution Count:146 | 146 |
5824 | | - |
5825 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:266 | no Evaluation Count:0 |
| 0-266 |
5826 | | - |
5827 | | - |
5828 | | - |
5829 | | - |
5830 | | - |
5831 | | - |
5832 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5833 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) { partially evaluated: tlwExtra yes Evaluation Count:266 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:266 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:266 | no Evaluation Count:0 |
| 0-266 |
5834 | tlwExtra->inRepaint = true; | - |
5835 | tlwExtra->backingStoreTracker->markDirty(rect, this, true); | - |
5836 | tlwExtra->inRepaint = false; | - |
5837 | } executed: } Execution Count:266 | 266 |
5838 | } else { executed: } Execution Count:266 | 266 |
5839 | d->repaint_sys(rect); | - |
5840 | } | 0 |
5841 | } | - |
5842 | | - |
5843 | | - |
5844 | | - |
5845 | | - |
5846 | | - |
5847 | | - |
5848 | void QWidget::repaint(const QRegion &rgn) | - |
5849 | { | - |
5850 | QWidgetPrivate * const d = d_func(); | - |
5851 | | - |
5852 | if (testAttribute(Qt::WA_WState_ConfigPending)) { never evaluated: testAttribute(Qt::WA_WState_ConfigPending) | 0 |
5853 | update(rgn); | - |
5854 | return; | 0 |
5855 | } | - |
5856 | | - |
5857 | if (!isVisible() || !updatesEnabled() || rgn.isEmpty()) never evaluated: !isVisible() never evaluated: !updatesEnabled() never evaluated: rgn.isEmpty() | 0 |
5858 | return; | 0 |
5859 | | - |
5860 | if (hasBackingStoreSupport()) { never evaluated: hasBackingStoreSupport() | 0 |
5861 | | - |
5862 | | - |
5863 | | - |
5864 | | - |
5865 | | - |
5866 | | - |
5867 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5868 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) { never evaluated: tlwExtra never evaluated: !tlwExtra->inTopLevelResize never evaluated: tlwExtra->backingStore | 0 |
5869 | tlwExtra->inRepaint = true; | - |
5870 | tlwExtra->backingStoreTracker->markDirty(rgn, this, true); | - |
5871 | tlwExtra->inRepaint = false; | - |
5872 | } | 0 |
5873 | } else { | 0 |
5874 | d->repaint_sys(rgn); | - |
5875 | } | 0 |
5876 | } | - |
5877 | void QWidget::update() | - |
5878 | { | - |
5879 | update(rect()); | - |
5880 | } executed: } Execution Count:191807 | 191807 |
5881 | void QWidget::update(const QRect &rect) | - |
5882 | { | - |
5883 | if (!isVisible() || !updatesEnabled() || rect.isEmpty()) evaluated: !isVisible() yes Evaluation Count:146754 | yes Evaluation Count:88256 |
evaluated: !updatesEnabled() yes Evaluation Count:361 | yes Evaluation Count:87895 |
evaluated: rect.isEmpty() yes Evaluation Count:1234 | yes Evaluation Count:86661 |
| 361-146754 |
5884 | return; executed: return; Execution Count:148349 | 148349 |
5885 | | - |
5886 | if (testAttribute(Qt::WA_WState_InPaintEvent)) { evaluated: testAttribute(Qt::WA_WState_InPaintEvent) yes Evaluation Count:186 | yes Evaluation Count:86475 |
| 186-86475 |
5887 | QApplication::postEvent(this, new QUpdateLaterEvent(rect)); | - |
5888 | return; executed: return; Execution Count:186 | 186 |
5889 | } | - |
5890 | | - |
5891 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:86475 | no Evaluation Count:0 |
| 0-86475 |
5892 | | - |
5893 | | - |
5894 | | - |
5895 | | - |
5896 | | - |
5897 | | - |
5898 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5899 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) partially evaluated: tlwExtra yes Evaluation Count:86475 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:86475 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:86475 | no Evaluation Count:0 |
| 0-86475 |
5900 | tlwExtra->backingStoreTracker->markDirty(rect, this); executed: tlwExtra->backingStoreTracker->markDirty(rect, this); Execution Count:86475 | 86475 |
5901 | } else { executed: } Execution Count:86475 | 86475 |
5902 | d_func()->repaint_sys(rect); | - |
5903 | } | 0 |
5904 | } | - |
5905 | | - |
5906 | | - |
5907 | | - |
5908 | | - |
5909 | | - |
5910 | | - |
5911 | void QWidget::update(const QRegion &rgn) | - |
5912 | { | - |
5913 | if (!isVisible() || !updatesEnabled() || rgn.isEmpty()) evaluated: !isVisible() yes Evaluation Count:534 | yes Evaluation Count:20558 |
evaluated: !updatesEnabled() yes Evaluation Count:190 | yes Evaluation Count:20368 |
evaluated: rgn.isEmpty() yes Evaluation Count:6906 | yes Evaluation Count:13462 |
| 190-20558 |
5914 | return; executed: return; Execution Count:7630 | 7630 |
5915 | | - |
5916 | if (testAttribute(Qt::WA_WState_InPaintEvent)) { partially evaluated: testAttribute(Qt::WA_WState_InPaintEvent) no Evaluation Count:0 | yes Evaluation Count:13462 |
| 0-13462 |
5917 | QApplication::postEvent(this, new QUpdateLaterEvent(rgn)); | - |
5918 | return; | 0 |
5919 | } | - |
5920 | | - |
5921 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:13462 | no Evaluation Count:0 |
| 0-13462 |
5922 | | - |
5923 | | - |
5924 | | - |
5925 | | - |
5926 | | - |
5927 | | - |
5928 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5929 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) partially evaluated: tlwExtra yes Evaluation Count:13462 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:13462 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:13462 | no Evaluation Count:0 |
| 0-13462 |
5930 | tlwExtra->backingStoreTracker->markDirty(rgn, this); executed: tlwExtra->backingStoreTracker->markDirty(rgn, this); Execution Count:13462 | 13462 |
5931 | } else { executed: } Execution Count:13462 | 13462 |
5932 | d_func()->repaint_sys(rgn); | - |
5933 | } | 0 |
5934 | } | - |
5935 | | - |
5936 | | - |
5937 | | - |
5938 | | - |
5939 | | - |
5940 | | - |
5941 | | - |
5942 | static void setAttribute_internal(Qt::WidgetAttribute attribute, bool on, QWidgetData *data, | - |
5943 | QWidgetPrivate *d) | - |
5944 | { | - |
5945 | if (attribute < int(8*sizeof(uint))) { evaluated: attribute < int(8*sizeof(uint)) yes Evaluation Count:223533 | yes Evaluation Count:416710 |
| 223533-416710 |
5946 | if (on) evaluated: on yes Evaluation Count:141099 | yes Evaluation Count:82434 |
| 82434-141099 |
5947 | data->widget_attributes |= (1<<attribute); executed: data->widget_attributes |= (1<<attribute); Execution Count:141099 | 141099 |
5948 | else | - |
5949 | data->widget_attributes &= ~(1<<attribute); executed: data->widget_attributes &= ~(1<<attribute); Execution Count:82434 | 82434 |
5950 | } else { | - |
5951 | const int x = attribute - 8*sizeof(uint); | - |
5952 | const int int_off = x / (8*sizeof(uint)); | - |
5953 | if (on) evaluated: on yes Evaluation Count:335471 | yes Evaluation Count:81239 |
| 81239-335471 |
5954 | d->high_attributes[int_off] |= (1<<(x-(int_off*8*sizeof(uint)))); executed: d->high_attributes[int_off] |= (1<<(x-(int_off*8*sizeof(uint)))); Execution Count:335471 | 335471 |
5955 | else | - |
5956 | d->high_attributes[int_off] &= ~(1<<(x-(int_off*8*sizeof(uint)))); executed: d->high_attributes[int_off] &= ~(1<<(x-(int_off*8*sizeof(uint)))); Execution Count:81239 | 81239 |
5957 | } | - |
5958 | } | - |
5959 | void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) | - |
5960 | { | - |
5961 | if (testAttribute(attribute) == on) evaluated: testAttribute(attribute) == on yes Evaluation Count:514746 | yes Evaluation Count:640243 |
| 514746-640243 |
5962 | return; executed: return; Execution Count:514746 | 514746 |
5963 | | - |
5964 | QWidgetPrivate * const d = d_func(); | - |
5965 | qt_noop(); | - |
5966 | setAttribute_internal(attribute, on, data, d); | - |
5967 | | - |
5968 | switch (attribute) { | - |
5969 | | - |
5970 | | - |
5971 | case Qt::WA_AcceptDrops: { | - |
5972 | if (on && !testAttribute(Qt::WA_DropSiteRegistered)) evaluated: on yes Evaluation Count:4235 | yes Evaluation Count:416 |
evaluated: !testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:2663 | yes Evaluation Count:1572 |
| 416-4235 |
5973 | setAttribute(Qt::WA_DropSiteRegistered, true); executed: setAttribute(Qt::WA_DropSiteRegistered, true); Execution Count:2663 | 2663 |
5974 | else if (!on && (isWindow() || !parentWidget() || !parentWidget()->testAttribute(Qt::WA_DropSiteRegistered))) evaluated: !on yes Evaluation Count:416 | yes Evaluation Count:1572 |
evaluated: isWindow() yes Evaluation Count:11 | yes Evaluation Count:405 |
partially evaluated: !parentWidget() no Evaluation Count:0 | yes Evaluation Count:405 |
evaluated: !parentWidget()->testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:404 | yes Evaluation Count:1 |
| 0-1572 |
5975 | setAttribute(Qt::WA_DropSiteRegistered, false); executed: setAttribute(Qt::WA_DropSiteRegistered, false); Execution Count:415 | 415 |
5976 | QEvent e(QEvent::AcceptDropsChange); | - |
5977 | QApplication::sendEvent(this, &e); | - |
5978 | break; executed: break; Execution Count:4651 | 4651 |
5979 | } | - |
5980 | case Qt::WA_DropSiteRegistered: { | - |
5981 | d->registerDropSite(on); | - |
5982 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:15658 | yes Evaluation Count:12325 |
| 12325-15658 |
5983 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
5984 | if (w && !w->isWindow() && !w->testAttribute(Qt::WA_AcceptDrops) && w->testAttribute(Qt::WA_DropSiteRegistered) != on) evaluated: w yes Evaluation Count:9252 | yes Evaluation Count:6406 |
partially evaluated: !w->isWindow() yes Evaluation Count:9252 | no Evaluation Count:0 |
evaluated: !w->testAttribute(Qt::WA_AcceptDrops) yes Evaluation Count:9241 | yes Evaluation Count:11 |
partially evaluated: w->testAttribute(Qt::WA_DropSiteRegistered) != on yes Evaluation Count:9241 | no Evaluation Count:0 |
| 0-9252 |
5985 | w->setAttribute(Qt::WA_DropSiteRegistered, on); executed: w->setAttribute(Qt::WA_DropSiteRegistered, on); Execution Count:9241 | 9241 |
5986 | } executed: } Execution Count:15658 | 15658 |
5987 | break; executed: break; Execution Count:12325 | 12325 |
5988 | } | - |
5989 | | - |
5990 | | - |
5991 | case Qt::WA_NoChildEventsForParent: | - |
5992 | d->sendChildEvents = !on; | - |
5993 | break; executed: break; Execution Count:1 | 1 |
5994 | case Qt::WA_NoChildEventsFromChildren: | - |
5995 | d->receiveChildEvents = !on; | - |
5996 | break; | 0 |
5997 | case Qt::WA_MacBrushedMetal: | - |
5998 | case Qt::WA_MacAlwaysShowToolWindow: | - |
5999 | | - |
6000 | | - |
6001 | | - |
6002 | break; | 0 |
6003 | case Qt::WA_MacNormalSize: | - |
6004 | case Qt::WA_MacSmallSize: | - |
6005 | case Qt::WA_MacMiniSize: | - |
6006 | break; | 0 |
6007 | case Qt::WA_ShowModal: | - |
6008 | if (!on) { evaluated: !on yes Evaluation Count:47 | yes Evaluation Count:92 |
| 47-92 |
6009 | | - |
6010 | data->window_modality = Qt::NonModal; | - |
6011 | } else if (data->window_modality == Qt::NonModal) { executed: } Execution Count:47 evaluated: data->window_modality == Qt::NonModal yes Evaluation Count:90 | yes Evaluation Count:2 |
| 2-90 |
6012 | | - |
6013 | | - |
6014 | | - |
6015 | | - |
6016 | QWidget *w = parentWidget(); | - |
6017 | if (w) evaluated: w yes Evaluation Count:35 | yes Evaluation Count:55 |
| 35-55 |
6018 | w = w->window(); executed: w = w->window(); Execution Count:35 | 35 |
6019 | while (w && !w->testAttribute(Qt::WA_GroupLeader)) { evaluated: w yes Evaluation Count:35 | yes Evaluation Count:90 |
partially evaluated: !w->testAttribute(Qt::WA_GroupLeader) yes Evaluation Count:35 | no Evaluation Count:0 |
| 0-90 |
6020 | w = w->parentWidget(); | - |
6021 | if (w) partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:35 |
| 0-35 |
6022 | w = w->window(); never executed: w = w->window(); | 0 |
6023 | } executed: } Execution Count:35 | 35 |
6024 | data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader)) partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:90 |
never evaluated: w->testAttribute(Qt::WA_GroupLeader) | 0-90 |
6025 | ? Qt::WindowModal | - |
6026 | : Qt::ApplicationModal; | - |
6027 | | - |
6028 | | - |
6029 | | - |
6030 | } executed: } Execution Count:90 | 90 |
6031 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:47 | yes Evaluation Count:92 |
| 47-92 |
6032 | | - |
6033 | d->setModal_sys(); | - |
6034 | } executed: } Execution Count:47 | 47 |
6035 | break; executed: break; Execution Count:139 | 139 |
6036 | case Qt::WA_MouseTracking: { | - |
6037 | QEvent e(QEvent::MouseTrackingChange); | - |
6038 | QApplication::sendEvent(this, &e); | - |
6039 | break; } executed: break; Execution Count:4488 | 4488 |
6040 | case Qt::WA_NativeWindow: { | - |
6041 | d->createTLExtra(); | - |
6042 | | - |
6043 | QWidget *focusWidget = d->effectiveFocusWidget(); | - |
6044 | if (on && !internalWinId() && hasFocus() partially evaluated: on yes Evaluation Count:52 | no Evaluation Count:0 |
evaluated: !internalWinId() yes Evaluation Count:46 | yes Evaluation Count:6 |
partially evaluated: hasFocus() no Evaluation Count:0 | yes Evaluation Count:46 |
| 0-52 |
6045 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { never evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) | 0 |
6046 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
6047 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6048 | } | 0 |
6049 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget() evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) yes Evaluation Count:41 | yes Evaluation Count:11 |
evaluated: parentWidget() yes Evaluation Count:24 | yes Evaluation Count:17 |
| 11-41 |
6050 | | - |
6051 | | - |
6052 | | - |
6053 | | - |
6054 | | - |
6055 | ) | - |
6056 | parentWidget()->d_func()->enforceNativeChildren(); executed: parentWidget()->d_func()->enforceNativeChildren(); Execution Count:24 | 24 |
6057 | if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created)) partially evaluated: on yes Evaluation Count:52 | no Evaluation Count:0 |
evaluated: !internalWinId() yes Evaluation Count:43 | yes Evaluation Count:9 |
evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:9 | yes Evaluation Count:34 |
| 0-52 |
6058 | d->createWinId(); executed: d->createWinId(); Execution Count:9 | 9 |
6059 | if (isEnabled() && focusWidget->isEnabled() partially evaluated: isEnabled() yes Evaluation Count:52 | no Evaluation Count:0 |
partially evaluated: focusWidget->isEnabled() yes Evaluation Count:52 | no Evaluation Count:0 |
| 0-52 |
6060 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:2 | yes Evaluation Count:50 |
| 2-50 |
6061 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6062 | } executed: } Execution Count:2 | 2 |
6063 | | - |
6064 | break; executed: break; Execution Count:52 | 52 |
6065 | } | - |
6066 | case Qt::WA_PaintOnScreen: | - |
6067 | d->updateIsOpaque(); | - |
6068 | case Qt::WA_OpaquePaintEvent: code before this statement executed: case Qt::WA_OpaquePaintEvent: Execution Count:139 | 139 |
6069 | d->updateIsOpaque(); | - |
6070 | break; executed: break; Execution Count:10535 | 10535 |
6071 | case Qt::WA_NoSystemBackground: | - |
6072 | d->updateIsOpaque(); | - |
6073 | | - |
6074 | case Qt::WA_UpdatesDisabled: code before this statement executed: case Qt::WA_UpdatesDisabled: Execution Count:59 | 59 |
6075 | d->updateSystemBackground(); | - |
6076 | break; executed: break; Execution Count:30103 | 30103 |
6077 | case Qt::WA_TransparentForMouseEvents: | - |
6078 | | - |
6079 | | - |
6080 | | - |
6081 | break; executed: break; Execution Count:52 | 52 |
6082 | case Qt::WA_InputMethodEnabled: { | - |
6083 | | - |
6084 | if ((static_cast<QApplication *>(QCoreApplication::instance()))->focusObject() == this) { evaluated: (static_cast<QApplication *>(QCoreApplication::instance()))->focusObject() == this yes Evaluation Count:700 | yes Evaluation Count:8516 |
| 700-8516 |
6085 | if (!on) evaluated: !on yes Evaluation Count:686 | yes Evaluation Count:14 |
| 14-686 |
6086 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); Execution Count:686 | 686 |
6087 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6088 | } executed: } Execution Count:700 | 700 |
6089 | | - |
6090 | break; executed: break; Execution Count:9216 | 9216 |
6091 | } | - |
6092 | case Qt::WA_WindowPropagation: | - |
6093 | d->resolvePalette(); | - |
6094 | d->resolveFont(); | - |
6095 | d->resolveLocale(); | - |
6096 | break; executed: break; Execution Count:343 | 343 |
6097 | case Qt::WA_DontShowOnScreen: { | - |
6098 | if (on && isVisible()) { partially evaluated: on yes Evaluation Count:11 | no Evaluation Count:0 |
partially evaluated: isVisible() no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
6099 | | - |
6100 | | - |
6101 | | - |
6102 | d->hide_sys(); | - |
6103 | d->show_sys(); | - |
6104 | } | 0 |
6105 | break; executed: break; Execution Count:11 | 11 |
6106 | } | - |
6107 | case Qt::WA_StaticContents: | - |
6108 | if (QWidgetBackingStore *bs = d->maybeBackingStore()) { evaluated: QWidgetBackingStore *bs = d->maybeBackingStore() yes Evaluation Count:5 | yes Evaluation Count:4 |
| 4-5 |
6109 | if (on) evaluated: on yes Evaluation Count:2 | yes Evaluation Count:3 |
| 2-3 |
6110 | bs->addStaticWidget(this); executed: bs->addStaticWidget(this); Execution Count:2 | 2 |
6111 | else | - |
6112 | bs->removeStaticWidget(this); executed: bs->removeStaticWidget(this); Execution Count:3 | 3 |
6113 | } | - |
6114 | break; executed: break; Execution Count:9 | 9 |
6115 | case Qt::WA_TranslucentBackground: | - |
6116 | if (on) { partially evaluated: on yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
6117 | setAttribute(Qt::WA_NoSystemBackground); | - |
6118 | d->updateIsTranslucent(); | - |
6119 | } executed: } Execution Count:4 | 4 |
6120 | | - |
6121 | break; executed: break; Execution Count:4 | 4 |
6122 | case Qt::WA_AcceptTouchEvents: | - |
6123 | | - |
6124 | | - |
6125 | | - |
6126 | | - |
6127 | break; executed: break; Execution Count:5125 | 5125 |
6128 | default: | - |
6129 | break; executed: break; Execution Count:563189 | 563189 |
6130 | } | - |
6131 | } executed: } Execution Count:640243 | 640243 |
6132 | bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const | - |
6133 | { | - |
6134 | const QWidgetPrivate * const d = d_func(); | - |
6135 | const int x = attribute - 8*sizeof(uint); | - |
6136 | const int int_off = x / (8*sizeof(uint)); | - |
6137 | return (d->high_attributes[int_off] & (1<<(x-(int_off*8*sizeof(uint))))); executed: return (d->high_attributes[int_off] & (1<<(x-(int_off*8*sizeof(uint))))); Execution Count:3395215 | 3395215 |
6138 | } | - |
6139 | qreal QWidget::windowOpacity() const | - |
6140 | { | - |
6141 | const QWidgetPrivate * const d = d_func(); | - |
6142 | return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; executed: return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; Execution Count:20 | 20 |
6143 | } | - |
6144 | | - |
6145 | void QWidget::setWindowOpacity(qreal opacity) | - |
6146 | { | - |
6147 | QWidgetPrivate * const d = d_func(); | - |
6148 | if (!isWindow()) evaluated: !isWindow() yes Evaluation Count:4 | yes Evaluation Count:355 |
| 4-355 |
6149 | return; executed: return; Execution Count:4 | 4 |
6150 | | - |
6151 | opacity = qBound(qreal(0.0), opacity, qreal(1.0)); | - |
6152 | QTLWExtra *extra = d->topData(); | - |
6153 | extra->opacity = uint(opacity * 255); | - |
6154 | setAttribute(Qt::WA_WState_WindowOpacitySet); | - |
6155 | d->setWindowOpacity_sys(opacity); | - |
6156 | | - |
6157 | if (!testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:353 | yes Evaluation Count:2 |
| 2-353 |
6158 | return; executed: return; Execution Count:353 | 353 |
6159 | | - |
6160 | | - |
6161 | if (QGraphicsProxyWidget *proxy = graphicsProxyWidget()) { partially evaluated: QGraphicsProxyWidget *proxy = graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
6162 | | - |
6163 | if (proxy->cacheMode() == QGraphicsItem::NoCache) never evaluated: proxy->cacheMode() == QGraphicsItem::NoCache | 0 |
6164 | proxy->update(); never executed: proxy->update(); | 0 |
6165 | else if (QGraphicsScene *scene = proxy->scene()) never evaluated: QGraphicsScene *scene = proxy->scene() | 0 |
6166 | scene->update(proxy->sceneBoundingRect()); never executed: scene->update(proxy->sceneBoundingRect()); | 0 |
6167 | return; | 0 |
6168 | } | - |
6169 | | - |
6170 | } executed: } Execution Count:2 | 2 |
6171 | bool QWidget::isWindowModified() const | - |
6172 | { | - |
6173 | return testAttribute(Qt::WA_WindowModified); executed: return testAttribute(Qt::WA_WindowModified); Execution Count:378 | 378 |
6174 | } | - |
6175 | | - |
6176 | void QWidget::setWindowModified(bool mod) | - |
6177 | { | - |
6178 | QWidgetPrivate * const d = d_func(); | - |
6179 | setAttribute(Qt::WA_WindowModified, mod); | - |
6180 | | - |
6181 | d->setWindowModified_helper(); | - |
6182 | | - |
6183 | QEvent e(QEvent::ModifiedChange); | - |
6184 | QApplication::sendEvent(this, &e); | - |
6185 | } executed: } Execution Count:148 | 148 |
6186 | | - |
6187 | void QWidgetPrivate::setWindowModified_helper() | - |
6188 | { | - |
6189 | QWidget * const q = q_func(); | - |
6190 | QWindow *window = q->windowHandle(); | - |
6191 | if (!window) evaluated: !window yes Evaluation Count:11 | yes Evaluation Count:2811 |
| 11-2811 |
6192 | return; executed: return; Execution Count:11 | 11 |
6193 | QPlatformWindow *platformWindow = window->handle(); | - |
6194 | if (!platformWindow) evaluated: !platformWindow yes Evaluation Count:1 | yes Evaluation Count:2810 |
| 1-2810 |
6195 | return; executed: return; Execution Count:1 | 1 |
6196 | bool on = q->testAttribute(Qt::WA_WindowModified); | - |
6197 | if (!platformWindow->setWindowModified(on)) { partially evaluated: !platformWindow->setWindowModified(on) yes Evaluation Count:2810 | no Evaluation Count:0 |
| 0-2810 |
6198 | if (!q->windowTitle().contains(QLatin1String("[*]")) && on) partially evaluated: !q->windowTitle().contains(QLatin1String("[*]")) yes Evaluation Count:2810 | no Evaluation Count:0 |
partially evaluated: on no Evaluation Count:0 | yes Evaluation Count:2810 |
| 0-2810 |
6199 | QMessageLogger("kernel/qwidget.cpp", 10332, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); never executed: QMessageLogger("kernel/qwidget.cpp", 10332, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); | 0 |
6200 | setWindowTitle_helper(q->windowTitle()); | - |
6201 | setWindowIconText_helper(q->windowIconText()); | - |
6202 | } executed: } Execution Count:2810 | 2810 |
6203 | } executed: } Execution Count:2810 | 2810 |
6204 | void QWidget::setToolTip(const QString &s) | - |
6205 | { | - |
6206 | QWidgetPrivate * const d = d_func(); | - |
6207 | d->toolTip = s; | - |
6208 | | - |
6209 | QEvent event(QEvent::ToolTipChange); | - |
6210 | QApplication::sendEvent(this, &event); | - |
6211 | } executed: } Execution Count:2298 | 2298 |
6212 | | - |
6213 | QString QWidget::toolTip() const | - |
6214 | { | - |
6215 | const QWidgetPrivate * const d = d_func(); | - |
6216 | return d->toolTip; executed: return d->toolTip; Execution Count:5 | 5 |
6217 | } | - |
6218 | void QWidget::setStatusTip(const QString &s) | - |
6219 | { | - |
6220 | QWidgetPrivate * const d = d_func(); | - |
6221 | d->statusTip = s; | - |
6222 | } executed: } Execution Count:18 | 18 |
6223 | | - |
6224 | QString QWidget::statusTip() const | - |
6225 | { | - |
6226 | const QWidgetPrivate * const d = d_func(); | - |
6227 | return d->statusTip; never executed: return d->statusTip; | 0 |
6228 | } | - |
6229 | void QWidget::setWhatsThis(const QString &s) | - |
6230 | { | - |
6231 | QWidgetPrivate * const d = d_func(); | - |
6232 | d->whatsThis = s; | - |
6233 | } executed: } Execution Count:18 | 18 |
6234 | | - |
6235 | QString QWidget::whatsThis() const | - |
6236 | { | - |
6237 | const QWidgetPrivate * const d = d_func(); | - |
6238 | return d->whatsThis; never executed: return d->whatsThis; | 0 |
6239 | } | - |
6240 | void QWidget::setAccessibleName(const QString &name) | - |
6241 | { | - |
6242 | QWidgetPrivate * const d = d_func(); | - |
6243 | d->accessibleName = name; | - |
6244 | QAccessibleEvent event(this, QAccessible::NameChanged); | - |
6245 | QAccessible::updateAccessibility(&event); | - |
6246 | } executed: } Execution Count:3663 | 3663 |
6247 | | - |
6248 | QString QWidget::accessibleName() const | - |
6249 | { | - |
6250 | const QWidgetPrivate * const d = d_func(); | - |
6251 | return d->accessibleName; executed: return d->accessibleName; Execution Count:1072 | 1072 |
6252 | } | - |
6253 | void QWidget::setAccessibleDescription(const QString &description) | - |
6254 | { | - |
6255 | QWidgetPrivate * const d = d_func(); | - |
6256 | d->accessibleDescription = description; | - |
6257 | QAccessibleEvent event(this, QAccessible::DescriptionChanged); | - |
6258 | QAccessible::updateAccessibility(&event); | - |
6259 | } executed: } Execution Count:2677 | 2677 |
6260 | | - |
6261 | QString QWidget::accessibleDescription() const | - |
6262 | { | - |
6263 | const QWidgetPrivate * const d = d_func(); | - |
6264 | return d->accessibleDescription; executed: return d->accessibleDescription; Execution Count:55 | 55 |
6265 | } | - |
6266 | int QWidget::grabShortcut(const QKeySequence &key, Qt::ShortcutContext context) | - |
6267 | { | - |
6268 | qt_noop(); | - |
6269 | if (key.isEmpty()) evaluated: key.isEmpty() yes Evaluation Count:2011 | yes Evaluation Count:1589 |
| 1589-2011 |
6270 | return 0; executed: return 0; Execution Count:2011 | 2011 |
6271 | setAttribute(Qt::WA_GrabbedShortcut); | - |
6272 | return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher); executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher); Execution Count:1589 | 1589 |
6273 | } | - |
6274 | void QWidget::releaseShortcut(int id) | - |
6275 | { | - |
6276 | qt_noop(); | - |
6277 | if (id) evaluated: id yes Evaluation Count:363 | yes Evaluation Count:374 |
| 363-374 |
6278 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0); Execution Count:363 | 363 |
6279 | } executed: } Execution Count:737 | 737 |
6280 | void QWidget::setShortcutEnabled(int id, bool enable) | - |
6281 | { | - |
6282 | qt_noop(); | - |
6283 | if (id) partially evaluated: id no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
6284 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0); | 0 |
6285 | } executed: } Execution Count:16 | 16 |
6286 | void QWidget::setShortcutAutoRepeat(int id, bool enable) | - |
6287 | { | - |
6288 | qt_noop(); | - |
6289 | if (id) | 0 |
6290 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0); | 0 |
6291 | } | 0 |
6292 | | - |
6293 | | - |
6294 | | - |
6295 | | - |
6296 | | - |
6297 | void QWidget::updateMicroFocus() | - |
6298 | { | - |
6299 | | - |
6300 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImQueryAll); | - |
6301 | } executed: } Execution Count:19250 | 19250 |
6302 | void QWidget::raise() | - |
6303 | { | - |
6304 | QWidgetPrivate * const d = d_func(); | - |
6305 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:6756 | yes Evaluation Count:132 |
| 132-6756 |
6306 | QWidget *p = parentWidget(); | - |
6307 | const int parentChildCount = p->d_func()->children.size(); | - |
6308 | if (parentChildCount < 2) evaluated: parentChildCount < 2 yes Evaluation Count:7 | yes Evaluation Count:6749 |
| 7-6749 |
6309 | return; executed: return; Execution Count:7 | 7 |
6310 | const int from = p->d_func()->children.indexOf(this); | - |
6311 | qt_noop(); | - |
6312 | | - |
6313 | if (from != parentChildCount -1) evaluated: from != parentChildCount -1 yes Evaluation Count:4108 | yes Evaluation Count:2641 |
| 2641-4108 |
6314 | p->d_func()->children.move(from, parentChildCount - 1); executed: p->d_func()->children.move(from, parentChildCount - 1); Execution Count:4108 | 4108 |
6315 | if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2525 | yes Evaluation Count:4224 |
evaluated: p->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1065 | yes Evaluation Count:1460 |
| 1065-4224 |
6316 | create(); executed: create(); Execution Count:1065 | 1065 |
6317 | else if (from == parentChildCount - 1) evaluated: from == parentChildCount - 1 yes Evaluation Count:2600 | yes Evaluation Count:3084 |
| 2600-3084 |
6318 | return; executed: return; Execution Count:2600 | 2600 |
6319 | | - |
6320 | QRegion region(rect()); | - |
6321 | d->subtractOpaqueSiblings(region); | - |
6322 | d->invalidateBuffer(region); | - |
6323 | } executed: } Execution Count:4149 | 4149 |
6324 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:3719 | yes Evaluation Count:562 |
| 562-3719 |
6325 | d->raise_sys(); executed: d->raise_sys(); Execution Count:3719 | 3719 |
6326 | | - |
6327 | QEvent e(QEvent::ZOrderChange); | - |
6328 | QApplication::sendEvent(this, &e); | - |
6329 | } executed: } Execution Count:4281 | 4281 |
6330 | void QWidget::lower() | - |
6331 | { | - |
6332 | QWidgetPrivate * const d = d_func(); | - |
6333 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:1107 | yes Evaluation Count:1 |
| 1-1107 |
6334 | QWidget *p = parentWidget(); | - |
6335 | const int parentChildCount = p->d_func()->children.size(); | - |
6336 | if (parentChildCount < 2) partially evaluated: parentChildCount < 2 no Evaluation Count:0 | yes Evaluation Count:1107 |
| 0-1107 |
6337 | return; | 0 |
6338 | const int from = p->d_func()->children.indexOf(this); | - |
6339 | qt_noop(); | - |
6340 | | - |
6341 | if (from != 0) evaluated: from != 0 yes Evaluation Count:863 | yes Evaluation Count:244 |
| 244-863 |
6342 | p->d_func()->children.move(from, 0); executed: p->d_func()->children.move(from, 0); Execution Count:863 | 863 |
6343 | if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1084 | yes Evaluation Count:23 |
evaluated: p->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:25 | yes Evaluation Count:1059 |
| 23-1084 |
6344 | create(); executed: create(); Execution Count:25 | 25 |
6345 | else if (from == 0) evaluated: from == 0 yes Evaluation Count:234 | yes Evaluation Count:848 |
| 234-848 |
6346 | return; executed: return; Execution Count:234 | 234 |
6347 | } | - |
6348 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:36 | yes Evaluation Count:838 |
| 36-838 |
6349 | d->lower_sys(); executed: d->lower_sys(); Execution Count:36 | 36 |
6350 | | - |
6351 | QEvent e(QEvent::ZOrderChange); | - |
6352 | QApplication::sendEvent(this, &e); | - |
6353 | } executed: } Execution Count:874 | 874 |
6354 | void QWidget::stackUnder(QWidget* w) | - |
6355 | { | - |
6356 | QWidgetPrivate * const d = d_func(); | - |
6357 | QWidget *p = parentWidget(); | - |
6358 | if (!w || isWindow() || p != w->parentWidget() || this == w) partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:11 |
partially evaluated: isWindow() no Evaluation Count:0 | yes Evaluation Count:11 |
partially evaluated: p != w->parentWidget() no Evaluation Count:0 | yes Evaluation Count:11 |
partially evaluated: this == w no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
6359 | return; | 0 |
6360 | if (p) { partially evaluated: p yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
6361 | int from = p->d_func()->children.indexOf(this); | - |
6362 | int to = p->d_func()->children.indexOf(w); | - |
6363 | qt_noop(); | - |
6364 | qt_noop(); | - |
6365 | if (from < to) evaluated: from < to yes Evaluation Count:9 | yes Evaluation Count:2 |
| 2-9 |
6366 | --to; executed: --to; Execution Count:9 | 9 |
6367 | | - |
6368 | if (from != to) evaluated: from != to yes Evaluation Count:3 | yes Evaluation Count:8 |
| 3-8 |
6369 | p->d_func()->children.move(from, to); executed: p->d_func()->children.move(from, to); Execution Count:3 | 3 |
6370 | if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1 | yes Evaluation Count:10 |
partially evaluated: p->testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-10 |
6371 | create(); never executed: create(); | 0 |
6372 | else if (from == to) evaluated: from == to yes Evaluation Count:8 | yes Evaluation Count:3 |
| 3-8 |
6373 | return; executed: return; Execution Count:8 | 8 |
6374 | } | - |
6375 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
6376 | d->stackUnder_sys(w); executed: d->stackUnder_sys(w); Execution Count:2 | 2 |
6377 | | - |
6378 | QEvent e(QEvent::ZOrderChange); | - |
6379 | QApplication::sendEvent(this, &e); | - |
6380 | } executed: } Execution Count:3 | 3 |
6381 | QRect QWidgetPrivate::frameStrut() const | - |
6382 | { | - |
6383 | const QWidget * const q = q_func(); | - |
6384 | if (!q->isWindow() || (q->windowType() == Qt::Desktop) || q->testAttribute(Qt::WA_DontShowOnScreen)) { partially evaluated: !q->isWindow() no Evaluation Count:0 | yes Evaluation Count:6371 |
evaluated: (q->windowType() == Qt::Desktop) yes Evaluation Count:133 | yes Evaluation Count:6238 |
evaluated: q->testAttribute(Qt::WA_DontShowOnScreen) yes Evaluation Count:28 | yes Evaluation Count:6210 |
| 0-6371 |
6385 | | - |
6386 | return QRect(0, 0, 1, 1); executed: return QRect(0, 0, 1, 1); Execution Count:161 | 161 |
6387 | } | - |
6388 | | - |
6389 | if (data.fstrut_dirty evaluated: data.fstrut_dirty yes Evaluation Count:5721 | yes Evaluation Count:489 |
| 489-5721 |
6390 | | - |
6391 | | - |
6392 | && q->isVisible() evaluated: q->isVisible() yes Evaluation Count:2037 | yes Evaluation Count:3684 |
| 2037-3684 |
6393 | | - |
6394 | && q->testAttribute(Qt::WA_WState_Created)) partially evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2037 | no Evaluation Count:0 |
| 0-2037 |
6395 | const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); executed: const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); Execution Count:2037 | 2037 |
6396 | | - |
6397 | return maybeTopData() ? maybeTopData()->frameStrut : QRect(); executed: return maybeTopData() ? maybeTopData()->frameStrut : QRect(); Execution Count:6210 | 6210 |
6398 | } | - |
6399 | void QWidget::setBackingStore(QBackingStore *store) | - |
6400 | { | - |
6401 | | - |
6402 | | - |
6403 | if (!isTopLevel()) partially evaluated: !isTopLevel() no Evaluation Count:0 | yes Evaluation Count:2499 |
| 0-2499 |
6404 | return; | 0 |
6405 | | - |
6406 | QWidgetPrivate * const d = d_func(); | - |
6407 | | - |
6408 | QTLWExtra *topData = d->topData(); | - |
6409 | if (topData->backingStore == store) partially evaluated: topData->backingStore == store no Evaluation Count:0 | yes Evaluation Count:2499 |
| 0-2499 |
6410 | return; | 0 |
6411 | | - |
6412 | QBackingStore *oldStore = topData->backingStore; | - |
6413 | delete topData->backingStore; | - |
6414 | topData->backingStore = store; | - |
6415 | | - |
6416 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - |
6417 | if (!bs) partially evaluated: !bs yes Evaluation Count:2499 | no Evaluation Count:0 |
| 0-2499 |
6418 | return; executed: return; Execution Count:2499 | 2499 |
6419 | | - |
6420 | if (isTopLevel()) { never evaluated: isTopLevel() | 0 |
6421 | if (bs->store != oldStore && bs->store != store) never evaluated: bs->store != oldStore never evaluated: bs->store != store | 0 |
6422 | delete bs->store; never executed: delete bs->store; | 0 |
6423 | bs->store = store; | - |
6424 | } | 0 |
6425 | } | 0 |
6426 | | - |
6427 | | - |
6428 | | - |
6429 | | - |
6430 | | - |
6431 | | - |
6432 | QBackingStore *QWidget::backingStore() const | - |
6433 | { | - |
6434 | const QWidgetPrivate * const d = d_func(); | - |
6435 | QTLWExtra *extra = d->maybeTopData(); | - |
6436 | if (extra && extra->backingStore) partially evaluated: extra yes Evaluation Count:7745 | no Evaluation Count:0 |
evaluated: extra->backingStore yes Evaluation Count:5068 | yes Evaluation Count:2677 |
| 0-7745 |
6437 | return extra->backingStore; executed: return extra->backingStore; Execution Count:5068 | 5068 |
6438 | | - |
6439 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - |
6440 | | - |
6441 | return bs ? bs->store : 0; executed: return bs ? bs->store : 0; Execution Count:2677 | 2677 |
6442 | } | - |
6443 | | - |
6444 | void QWidgetPrivate::getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const | - |
6445 | { | - |
6446 | if (left) partially evaluated: left yes Evaluation Count:587 | no Evaluation Count:0 |
| 0-587 |
6447 | *left = (int)leftLayoutItemMargin; executed: *left = (int)leftLayoutItemMargin; Execution Count:587 | 587 |
6448 | if (top) partially evaluated: top yes Evaluation Count:587 | no Evaluation Count:0 |
| 0-587 |
6449 | *top = (int)topLayoutItemMargin; executed: *top = (int)topLayoutItemMargin; Execution Count:587 | 587 |
6450 | if (right) partially evaluated: right yes Evaluation Count:587 | no Evaluation Count:0 |
| 0-587 |
6451 | *right = (int)rightLayoutItemMargin; executed: *right = (int)rightLayoutItemMargin; Execution Count:587 | 587 |
6452 | if (bottom) partially evaluated: bottom yes Evaluation Count:587 | no Evaluation Count:0 |
| 0-587 |
6453 | *bottom = (int)bottomLayoutItemMargin; executed: *bottom = (int)bottomLayoutItemMargin; Execution Count:587 | 587 |
6454 | } executed: } Execution Count:587 | 587 |
6455 | | - |
6456 | void QWidgetPrivate::setLayoutItemMargins(int left, int top, int right, int bottom) | - |
6457 | { | - |
6458 | if (leftLayoutItemMargin == left never evaluated: leftLayoutItemMargin == left | 0 |
6459 | && topLayoutItemMargin == top never evaluated: topLayoutItemMargin == top | 0 |
6460 | && rightLayoutItemMargin == right never evaluated: rightLayoutItemMargin == right | 0 |
6461 | && bottomLayoutItemMargin == bottom) never evaluated: bottomLayoutItemMargin == bottom | 0 |
6462 | return; | 0 |
6463 | | - |
6464 | QWidget * const q = q_func(); | - |
6465 | leftLayoutItemMargin = (signed char)left; | - |
6466 | topLayoutItemMargin = (signed char)top; | - |
6467 | rightLayoutItemMargin = (signed char)right; | - |
6468 | bottomLayoutItemMargin = (signed char)bottom; | - |
6469 | q->updateGeometry(); | - |
6470 | } | 0 |
6471 | | - |
6472 | void QWidgetPrivate::setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt) | - |
6473 | { | - |
6474 | QWidget * const q = q_func(); | - |
6475 | QStyleOption myOpt; | - |
6476 | if (!opt) { evaluated: !opt yes Evaluation Count:27986 | yes Evaluation Count:4313 |
| 4313-27986 |
6477 | myOpt.initFrom(q); | - |
6478 | myOpt.rect.setRect(0, 0, 32768, 32768); | - |
6479 | opt = &myOpt; | - |
6480 | } executed: } Execution Count:27986 | 27986 |
6481 | | - |
6482 | QRect liRect = q->style()->subElementRect(element, opt, q); | - |
6483 | if (liRect.isValid()) { evaluated: liRect.isValid() yes Evaluation Count:30 | yes Evaluation Count:32269 |
| 30-32269 |
6484 | leftLayoutItemMargin = (signed char)(opt->rect.left() - liRect.left()); | - |
6485 | topLayoutItemMargin = (signed char)(opt->rect.top() - liRect.top()); | - |
6486 | rightLayoutItemMargin = (signed char)(liRect.right() - opt->rect.right()); | - |
6487 | bottomLayoutItemMargin = (signed char)(liRect.bottom() - opt->rect.bottom()); | - |
6488 | } else { executed: } Execution Count:30 | 30 |
6489 | leftLayoutItemMargin = 0; | - |
6490 | topLayoutItemMargin = 0; | - |
6491 | rightLayoutItemMargin = 0; | - |
6492 | bottomLayoutItemMargin = 0; | - |
6493 | } executed: } Execution Count:32269 | 32269 |
6494 | } | - |
6495 | | - |
6496 | void QWidgetPrivate::adjustQuitOnCloseAttribute() | - |
6497 | { | - |
6498 | QWidget * const q = q_func(); | - |
6499 | | - |
6500 | if (!q->parentWidget()) { evaluated: !q->parentWidget() yes Evaluation Count:45989 | yes Evaluation Count:42 |
| 42-45989 |
6501 | Qt::WindowType type = q->windowType(); | - |
6502 | if (type == Qt::Widget || type == Qt::SubWindow) evaluated: type == Qt::Widget yes Evaluation Count:44364 | yes Evaluation Count:1625 |
evaluated: type == Qt::SubWindow yes Evaluation Count:1 | yes Evaluation Count:1624 |
| 1-44364 |
6503 | type = Qt::Window; executed: type = Qt::Window; Execution Count:44365 | 44365 |
6504 | if (type != Qt::Widget && type != Qt::Window && type != Qt::Dialog) partially evaluated: type != Qt::Widget yes Evaluation Count:45989 | no Evaluation Count:0 |
evaluated: type != Qt::Window yes Evaluation Count:1291 | yes Evaluation Count:44698 |
evaluated: type != Qt::Dialog yes Evaluation Count:906 | yes Evaluation Count:385 |
| 0-45989 |
6505 | q->setAttribute(Qt::WA_QuitOnClose, false); executed: q->setAttribute(Qt::WA_QuitOnClose, false); Execution Count:906 | 906 |
6506 | } executed: } Execution Count:45989 | 45989 |
6507 | } executed: } Execution Count:46031 | 46031 |
6508 | | - |
6509 | | - |
6510 | | - |
6511 | __attribute__((visibility("default"))) QWidgetData *qt_qwidget_data(QWidget *widget) | - |
6512 | { | - |
6513 | return widget->data; never executed: return widget->data; | 0 |
6514 | } | - |
6515 | | - |
6516 | __attribute__((visibility("default"))) QWidgetPrivate *qt_widget_private(QWidget *widget) | - |
6517 | { | - |
6518 | return widget->d_func(); executed: return widget->d_func(); Execution Count:1616 | 1616 |
6519 | } | - |
6520 | QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const | - |
6521 | { | - |
6522 | const QWidgetPrivate * const d = d_func(); | - |
6523 | if (d->extra) { evaluated: d->extra yes Evaluation Count:7417 | yes Evaluation Count:41756 |
| 7417-41756 |
6524 | return d->extra->proxyWidget; executed: return d->extra->proxyWidget; Execution Count:7417 | 7417 |
6525 | } | - |
6526 | return 0; executed: return 0; Execution Count:41756 | 41756 |
6527 | } | - |
6528 | void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags) | - |
6529 | { | - |
6530 | QWidgetPrivate * const d = d_func(); | - |
6531 | d->gestureContext.insert(gesture, flags); | - |
6532 | (void)QGestureManager::instance(); | - |
6533 | } executed: } Execution Count:6064 | 6064 |
6534 | | - |
6535 | | - |
6536 | | - |
6537 | | - |
6538 | | - |
6539 | | - |
6540 | | - |
6541 | void QWidget::ungrabGesture(Qt::GestureType gesture) | - |
6542 | { | - |
6543 | QWidgetPrivate * const d = d_func(); | - |
6544 | if (d->gestureContext.remove(gesture)) { partially evaluated: d->gestureContext.remove(gesture) yes Evaluation Count:5416 | no Evaluation Count:0 |
| 0-5416 |
6545 | if (QGestureManager *manager = QGestureManager::instance()) partially evaluated: QGestureManager *manager = QGestureManager::instance() yes Evaluation Count:5416 | no Evaluation Count:0 |
| 0-5416 |
6546 | manager->cleanupCachedGestures(this, gesture); executed: manager->cleanupCachedGestures(this, gesture); Execution Count:5416 | 5416 |
6547 | } executed: } Execution Count:5416 | 5416 |
6548 | } executed: } Execution Count:5416 | 5416 |
6549 | void QWidget::initPainter(QPainter *painter) const | - |
6550 | { | - |
6551 | const QPalette &pal = palette(); | - |
6552 | painter->d_func()->state->pen = QPen(pal.brush(foregroundRole()), 1); | - |
6553 | painter->d_func()->state->bgBrush = pal.brush(backgroundRole()); | - |
6554 | QFont f(font(), const_cast<QWidget *>(this)); | - |
6555 | painter->d_func()->state->deviceFont = f; | - |
6556 | painter->d_func()->state->font = f; | - |
6557 | } executed: } Execution Count:23461 | 23461 |
6558 | | - |
6559 | QPaintDevice *QWidget::redirected(QPoint *offset) const | - |
6560 | { | - |
6561 | return d_func()->redirected(offset); executed: return d_func()->redirected(offset); Execution Count:23460 | 23460 |
6562 | } | - |
6563 | | - |
6564 | QPainter *QWidget::sharedPainter() const | - |
6565 | { | - |
6566 | | - |
6567 | if (!d_func()->redirectDev) partially evaluated: !d_func()->redirectDev no Evaluation Count:0 | yes Evaluation Count:44943 |
| 0-44943 |
6568 | return 0; never executed: return 0; | 0 |
6569 | | - |
6570 | QPainter *sp = d_func()->sharedPainter(); | - |
6571 | if (!sp || !sp->isActive()) evaluated: !sp yes Evaluation Count:44903 | yes Evaluation Count:40 |
partially evaluated: !sp->isActive() no Evaluation Count:0 | yes Evaluation Count:40 |
| 0-44903 |
6572 | return 0; executed: return 0; Execution Count:44903 | 44903 |
6573 | | - |
6574 | if (sp->paintEngine()->paintDevice() != d_func()->redirectDev) partially evaluated: sp->paintEngine()->paintDevice() != d_func()->redirectDev no Evaluation Count:0 | yes Evaluation Count:40 |
| 0-40 |
6575 | return 0; never executed: return 0; | 0 |
6576 | | - |
6577 | return sp; executed: return sp; Execution Count:40 | 40 |
6578 | } | - |
6579 | void QWidget::setMask(const QRegion &newMask) | - |
6580 | { | - |
6581 | QWidgetPrivate * const d = d_func(); | - |
6582 | | - |
6583 | d->createExtra(); | - |
6584 | if (newMask == d->extra->mask) evaluated: newMask == d->extra->mask yes Evaluation Count:24 | yes Evaluation Count:48 |
| 24-48 |
6585 | return; executed: return; Execution Count:24 | 24 |
6586 | | - |
6587 | | - |
6588 | const QRegion oldMask(d->extra->mask); | - |
6589 | | - |
6590 | | - |
6591 | d->extra->mask = newMask; | - |
6592 | d->extra->hasMask = !newMask.isEmpty(); | - |
6593 | | - |
6594 | | - |
6595 | if (!testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:13 | yes Evaluation Count:35 |
| 13-35 |
6596 | return; executed: return; Execution Count:13 | 13 |
6597 | | - |
6598 | | - |
6599 | d->setMask_sys(newMask); | - |
6600 | | - |
6601 | | - |
6602 | if (!isVisible()) evaluated: !isVisible() yes Evaluation Count:1 | yes Evaluation Count:34 |
| 1-34 |
6603 | return; executed: return; Execution Count:1 | 1 |
6604 | | - |
6605 | if (!d->extra->hasMask) { evaluated: !d->extra->hasMask yes Evaluation Count:6 | yes Evaluation Count:28 |
| 6-28 |
6606 | | - |
6607 | QRegion expose(rect()); | - |
6608 | expose -= oldMask; | - |
6609 | if (!expose.isEmpty()) { evaluated: !expose.isEmpty() yes Evaluation Count:5 | yes Evaluation Count:1 |
| 1-5 |
6610 | d->setDirtyOpaqueRegion(); | - |
6611 | update(expose); | - |
6612 | } executed: } Execution Count:5 | 5 |
6613 | return; executed: return; Execution Count:6 | 6 |
6614 | } | - |
6615 | | - |
6616 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:27 | yes Evaluation Count:1 |
| 1-27 |
6617 | | - |
6618 | QRegion parentExpose(rect()); | - |
6619 | parentExpose -= newMask; | - |
6620 | if (!parentExpose.isEmpty()) { evaluated: !parentExpose.isEmpty() yes Evaluation Count:26 | yes Evaluation Count:1 |
| 1-26 |
6621 | d->setDirtyOpaqueRegion(); | - |
6622 | parentExpose.translate(data->crect.topLeft()); | - |
6623 | parentWidget()->update(parentExpose); | - |
6624 | } executed: } Execution Count:26 | 26 |
6625 | | - |
6626 | | - |
6627 | if (!oldMask.isEmpty()) evaluated: !oldMask.isEmpty() yes Evaluation Count:24 | yes Evaluation Count:3 |
| 3-24 |
6628 | update(newMask - oldMask); executed: update(newMask - oldMask); Execution Count:24 | 24 |
6629 | } executed: } Execution Count:27 | 27 |
6630 | | - |
6631 | } executed: } Execution Count:28 | 28 |
6632 | void QWidget::setMask(const QBitmap &bitmap) | - |
6633 | { | - |
6634 | setMask(QRegion(bitmap)); | - |
6635 | } executed: } Execution Count:4 | 4 |
6636 | void QWidget::clearMask() | - |
6637 | { | - |
6638 | setMask(QRegion()); | - |
6639 | } executed: } Execution Count:7 | 7 |
6640 | | - |
6641 | | - |
6642 | | - |
| | |