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()) && | 18300 |
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:18300 | 18300 |
16 | } | - |
17 | | - |
18 | static inline bool hasBackingStoreSupport() | - |
19 | { | - |
20 | return true; executed: return true; Execution Count:56397 | 56397 |
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:2248 | 2248 |
34 | | - |
35 | QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker() | - |
36 | { | - |
37 | delete m_ptr; | - |
38 | } executed: } Execution Count:2157 | 2157 |
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:1485 | 1485 |
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:7170 | 7170 |
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:248 |
never evaluated: m_widgets.isEmpty() | 0-248 |
79 | delete m_ptr; | - |
80 | m_ptr = 0; | - |
81 | } | 0 |
82 | } executed: } Execution Count:248 | 248 |
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:99 | yes Evaluation Count:294 |
| 99-294 |
93 | unregisterWidgetSubtree(childWidget); executed: unregisterWidgetSubtree(childWidget); Execution Count:99 | 99 |
94 | } executed: } Execution Count:248 | 248 |
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:33631 |
| 0-33631 |
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:33631 |
| 0-33631 |
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:33631 | 33631 |
146 | | - |
147 | | - |
148 | QWidgetPrivate::~QWidgetPrivate() | - |
149 | { | - |
150 | if (widgetItem) evaluated: widgetItem yes Evaluation Count:65 | yes Evaluation Count:29261 |
| 65-29261 |
151 | widgetItem->wid = 0; executed: widgetItem->wid = 0; Execution Count:65 | 65 |
152 | | - |
153 | if (extra) evaluated: extra yes Evaluation Count:10038 | yes Evaluation Count:19288 |
| 10038-19288 |
154 | deleteExtra(); executed: deleteExtra(); Execution Count:10038 | 10038 |
155 | | - |
156 | | - |
157 | delete graphicsEffect; | - |
158 | | - |
159 | } executed: } Execution Count:29326 | 29326 |
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:3 | yes Evaluation Count:1108 |
| 3-1108 |
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:3 | yes Evaluation Count:3 |
| 3 |
171 | QWidget *w = qobject_cast<QWidget*>(childObjects.at(i)); | - |
172 | if (w && !w->isWindow()) { partially evaluated: w yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: !w->isWindow() yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
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:3 | no Evaluation Count:0 |
| 0-3 |
177 | w->d_func()->setWSGeometry(); executed: w->d_func()->setWSGeometry(); Execution Count:3 | 3 |
178 | w->d_func()->setDirtyOpaqueRegion(); | - |
179 | QMoveEvent e(r.topLeft(), oldp); | - |
180 | QApplication::sendEvent(w, &e); | - |
181 | } executed: } Execution Count:3 | 3 |
182 | } executed: } Execution Count:3 | 3 |
183 | } executed: } Execution Count:3 | 3 |
184 | } executed: } Execution Count:1111 | 1111 |
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:1335 | yes Evaluation Count:19160 |
| 1335-19160 |
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:1335 | 1335 |
195 | } executed: } Execution Count:20495 | 20495 |
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:73078 | 73078 |
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:3990 | yes Evaluation Count:346 |
| 346-3990 |
206 | d->createExtra(); executed: d->createExtra(); Execution Count:3990 | 3990 |
207 | if (d->extra->autoFillBackground == enabled) evaluated: d->extra->autoFillBackground == enabled yes Evaluation Count:73 | yes Evaluation Count:4263 |
| 73-4263 |
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:4263 | 4263 |
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:13539 | no Evaluation Count:0 |
| 0-13539 |
248 | d_func()->init(parent, f); | - |
249 | } else { executed: } Execution Count:13539 | 13539 |
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:20092 | no Evaluation Count:0 |
| 0-20092 |
263 | d->init(parent, f); | - |
264 | } else { executed: } Execution Count:20092 | 20092 |
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:29680 | 29680 |
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:35072 | yes Evaluation Count:1385 |
evaluated: type == Qt::SubWindow yes Evaluation Count:13 | yes Evaluation Count:1372 |
partially evaluated: w yes Evaluation Count:35085 | no Evaluation Count:0 |
evaluated: !w->parent() yes Evaluation Count:5275 | yes Evaluation Count:29810 |
| 0-35085 |
294 | type = Qt::Window; | - |
295 | flags |= Qt::Window; | - |
296 | } executed: } Execution Count:5275 | 5275 |
297 | | - |
298 | if (flags & Qt::CustomizeWindowHint) { partially evaluated: flags & Qt::CustomizeWindowHint no Evaluation Count:0 | yes Evaluation Count:36457 |
| 0-36457 |
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:2807 | yes Evaluation Count:33650 |
evaluated: !(flags & Qt::FramelessWindowHint) yes Evaluation Count:2599 | yes Evaluation Count:208 |
| 0-33650 |
314 | | - |
315 | | - |
316 | | - |
317 | flags |= Qt::WindowSystemMenuHint; | - |
318 | flags |= Qt::WindowTitleHint; | - |
319 | } executed: } Execution Count:2599 | 2599 |
320 | if (customize) evaluated: customize yes Evaluation Count:2807 | yes Evaluation Count:33650 |
| 2807-33650 |
321 | ; executed: ; Execution Count:2807 | 2807 |
322 | else if (type == Qt::Dialog || type == Qt::Sheet) evaluated: type == Qt::Dialog yes Evaluation Count:261 | yes Evaluation Count:33389 |
evaluated: type == Qt::Sheet yes Evaluation Count:1 | yes Evaluation Count:33388 |
| 1-33389 |
323 | | - |
324 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; Execution Count:262 | 262 |
325 | | - |
326 | | - |
327 | | - |
328 | else if (type == Qt::Tool) evaluated: type == Qt::Tool yes Evaluation Count:3 | yes Evaluation Count:33385 |
| 3-33385 |
329 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; Execution Count:3 | 3 |
330 | else | - |
331 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | | 33385 |
332 | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; Execution Count:33385 | 33385 |
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:33631 |
| 0-33631 |
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:33631 | no Evaluation Count:0 |
| 0-33631 |
344 | allWidgets->insert(q); executed: allWidgets->insert(q); Execution Count:33631 | 33631 |
345 | | - |
346 | QWidget *desktopWidget = 0; | - |
347 | if (parentWidget && parentWidget->windowType() == Qt::Desktop) { evaluated: parentWidget yes Evaluation Count:27895 | yes Evaluation Count:5736 |
partially evaluated: parentWidget->windowType() == Qt::Desktop no Evaluation Count:0 | yes Evaluation Count:27895 |
| 0-27895 |
348 | desktopWidget = parentWidget; | - |
349 | parentWidget = 0; | - |
350 | } | 0 |
351 | | - |
352 | q->data = &data; | - |
353 | | - |
354 | | - |
355 | if (!parent) { partially evaluated: !parent yes Evaluation Count:33631 | no Evaluation Count:0 |
| 0-33631 |
356 | qt_noop(); | - |
357 | | - |
358 | } executed: } Execution Count:33631 | 33631 |
359 | if (desktopWidget) { partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:33631 |
| 0-33631 |
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) partially evaluated: f & Qt::MSWindowsOwnDC no Evaluation Count:0 | yes Evaluation Count:33631 |
| 0-33631 |
383 | q->setAttribute(Qt::WA_NativeWindow); never executed: q->setAttribute(Qt::WA_NativeWindow); | 0 |
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:27895 | yes Evaluation Count:5736 |
| 5736-27895 |
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:104 | yes Evaluation Count:33527 |
| 104-33527 |
399 | q->create(); executed: q->create(); Execution Count:104 | 104 |
400 | else if (parentWidget) evaluated: parentWidget yes Evaluation Count:27895 | yes Evaluation Count:5632 |
| 5632-27895 |
401 | q->setParent(parentWidget, data.window_flags); executed: q->setParent(parentWidget, data.window_flags); Execution Count:27895 | 27895 |
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:5632 | 5632 |
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:6067 | yes Evaluation Count:27564 |
| 6067-27564 |
418 | QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; executed: QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; Execution Count:6067 | 6067 |
419 | | - |
420 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)) partially evaluated: QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) no Evaluation Count:0 | yes Evaluation Count:33631 |
| 0-33631 |
421 | q->create(); never executed: q->create(); | 0 |
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:33631 | 33631 |
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:999 | yes Evaluation Count:997 |
| 997-999 |
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:678 | yes Evaluation Count:321 |
evaluated: !child->isHidden() yes Evaluation Count:426 | yes Evaluation Count:252 |
partially evaluated: !child->isWindow() yes Evaluation Count:426 | no Evaluation Count:0 |
partially evaluated: !child->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:426 | no Evaluation Count:0 |
| 0-678 |
439 | child->d_func()->createRecursively(); executed: child->d_func()->createRecursively(); Execution Count:426 | 426 |
440 | } executed: } Execution Count:999 | 999 |
441 | } executed: } Execution Count:997 | 997 |
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()) partially evaluated: testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:7553 |
never evaluated: window == 0 never evaluated: internalWinId() | 0-7553 |
446 | return; | 0 |
447 | | - |
448 | if (d->data.in_destructor) partially evaluated: d->data.in_destructor no Evaluation Count:0 | yes Evaluation Count:7553 |
| 0-7553 |
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:5840 | yes Evaluation Count:1713 |
evaluated: type == Qt::SubWindow yes Evaluation Count:119 | yes Evaluation Count:1594 |
partially evaluated: !parentWidget() no Evaluation Count:0 | yes Evaluation Count:5959 |
| 0-5959 |
455 | type = Qt::Window; | - |
456 | flags |= Qt::Window; | - |
457 | } | 0 |
458 | | - |
459 | if (QWidget *parent = parentWidget()) { evaluated: QWidget *parent = parentWidget() yes Evaluation Count:6045 | yes Evaluation Count:1508 |
| 1508-6045 |
460 | if (type & Qt::Window) { evaluated: type & Qt::Window yes Evaluation Count:86 | yes Evaluation Count:5959 |
| 86-5959 |
461 | if (!parent->testAttribute(Qt::WA_WState_Created)) evaluated: !parent->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:37 | yes Evaluation Count:49 |
| 37-49 |
462 | parent->createWinId(); executed: parent->createWinId(); Execution Count:37 | 37 |
463 | } else if (testAttribute(Qt::WA_NativeWindow) && !parent->internalWinId() evaluated: testAttribute(Qt::WA_NativeWindow) yes Evaluation Count:4 | yes Evaluation Count:5955 |
partially evaluated: !parent->internalWinId() no Evaluation Count:0 | yes Evaluation Count:4 |
executed: } Execution Count:86 | 0-5955 |
464 | && !testAttribute(Qt::WA_DontCreateNativeAncestors)) { never evaluated: !testAttribute(Qt::WA_DontCreateNativeAncestors) | 0 |
465 | | - |
466 | | - |
467 | | - |
468 | d->createWinId(window); | - |
469 | | - |
470 | qt_noop(); | - |
471 | qt_noop(); | - |
472 | return; | 0 |
473 | } | - |
474 | } | - |
475 | | - |
476 | | - |
477 | static int paintOnScreenEnv = -1; | - |
478 | if (paintOnScreenEnv == -1) evaluated: paintOnScreenEnv == -1 yes Evaluation Count:93 | yes Evaluation Count:7460 |
| 93-7460 |
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:93 |
executed: paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 ? 1 : 0; Execution Count:93 | 0-93 |
480 | if (paintOnScreenEnv == 1) partially evaluated: paintOnScreenEnv == 1 no Evaluation Count:0 | yes Evaluation Count:7553 |
| 0-7553 |
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:7553 |
| 0-7553 |
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:1590 | yes Evaluation Count:5959 |
evaluated: windowType() != Qt::Desktop yes Evaluation Count:1485 | yes Evaluation Count:105 |
| 105-5959 |
492 | d->topData()->backingStoreTracker.destroy(); | - |
493 | if (hasBackingStoreSupport()) partially evaluated: hasBackingStoreSupport() yes Evaluation Count:1485 | no Evaluation Count:0 |
| 0-1485 |
494 | d->topData()->backingStoreTracker.create(this); executed: d->topData()->backingStoreTracker.create(this); Execution Count:1485 | 1485 |
495 | } executed: } Execution Count:1485 | 1485 |
496 | | - |
497 | d->setModal_sys(); | - |
498 | | - |
499 | if (!isWindow() && parentWidget() && parentWidget()->testAttribute(Qt::WA_DropSiteRegistered)) evaluated: !isWindow() yes Evaluation Count:5959 | yes Evaluation Count:1590 |
partially evaluated: parentWidget() yes Evaluation Count:5959 | no Evaluation Count:0 |
evaluated: parentWidget()->testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:419 | yes Evaluation Count:5540 |
| 0-5959 |
500 | setAttribute(Qt::WA_DropSiteRegistered, true); executed: setAttribute(Qt::WA_DropSiteRegistered, true); Execution Count:419 | 419 |
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:7549 |
| 0-7549 |
509 | d->setWindowIcon_sys(); never executed: d->setWindowIcon_sys(); | 0 |
510 | | - |
511 | if (isWindow() && !d->topData()->iconText.isEmpty()) evaluated: isWindow() yes Evaluation Count:1590 | yes Evaluation Count:5959 |
partially evaluated: !d->topData()->iconText.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1590 |
| 0-5959 |
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:1590 | yes Evaluation Count:5959 |
evaluated: !d->topData()->caption.isEmpty() yes Evaluation Count:60 | yes Evaluation Count:1530 |
| 60-5959 |
514 | d->setWindowTitle_helper(d->topData()->caption); executed: d->setWindowTitle_helper(d->topData()->caption); Execution Count:60 | 60 |
515 | if (windowType() != Qt::Desktop) { evaluated: windowType() != Qt::Desktop yes Evaluation Count:7444 | yes Evaluation Count:105 |
| 105-7444 |
516 | d->updateSystemBackground(); | - |
517 | | - |
518 | if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon)) evaluated: isWindow() yes Evaluation Count:1485 | yes Evaluation Count:5959 |
partially evaluated: !testAttribute(Qt::WA_SetWindowIcon) yes Evaluation Count:1485 | no Evaluation Count:0 |
| 0-5959 |
519 | d->setWindowIcon_sys(); executed: d->setWindowIcon_sys(); Execution Count:1485 | 1485 |
520 | } executed: } Execution Count:7444 | 7444 |
521 | | - |
522 | | - |
523 | | - |
524 | | - |
525 | | - |
526 | | - |
527 | d->updateFrameStrut(); | - |
528 | } executed: } Execution Count:7549 | 7549 |
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:3420 | 3420 |
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:3102 | yes Evaluation Count:29326 |
| 3102-29326 |
550 | QActionPrivate *apriv = d->actions.at(i)->d_func(); | - |
551 | apriv->widgets.removeAll(this); | - |
552 | } executed: } Execution Count:3102 | 3102 |
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:29153 | yes Evaluation Count:173 |
evaluated: testAttribute(Qt::WA_GrabbedShortcut) yes Evaluation Count:1096 | yes Evaluation Count:28057 |
| 173-29153 |
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:1096 | 1096 |
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:25605 | yes Evaluation Count:3721 |
| 3721-25605 |
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:25605 | 25605 |
576 | | - |
577 | | - |
578 | if (true) { partially evaluated: true yes Evaluation Count:29326 | no Evaluation Count:0 |
| 0-29326 |
579 | clearFocus(); | - |
580 | } else { executed: } Execution Count:29326 | 29326 |
581 | | - |
582 | } | 0 |
583 | | - |
584 | d->setDirtyOpaqueRegion(); | - |
585 | | - |
586 | if (isWindow() && isVisible() && internalWinId()) { evaluated: isWindow() yes Evaluation Count:3721 | yes Evaluation Count:25605 |
evaluated: isVisible() yes Evaluation Count:1137 | yes Evaluation Count:2584 |
partially evaluated: internalWinId() yes Evaluation Count:1137 | no Evaluation Count:0 |
| 0-25605 |
587 | if (true) { partially evaluated: true yes Evaluation Count:1137 | no Evaluation Count:0 |
| 0-1137 |
588 | d->close_helper(QWidgetPrivate::CloseNoEvent); | - |
589 | } else { executed: } Execution Count:1137 | 1137 |
590 | | - |
591 | if (true) { | 0 |
592 | hide(); | - |
593 | } else { | 0 |
594 | | - |
595 | } | 0 |
596 | } | - |
597 | } | - |
598 | | - |
599 | | - |
600 | | - |
601 | | - |
602 | | - |
603 | | - |
604 | else if (isVisible()) { evaluated: isVisible() yes Evaluation Count:383 | yes Evaluation Count:27806 |
| 383-27806 |
605 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - |
606 | } executed: } Execution Count:383 | 383 |
607 | | - |
608 | if (QWidgetBackingStore *bs = d->maybeBackingStore()) { evaluated: QWidgetBackingStore *bs = d->maybeBackingStore() yes Evaluation Count:12069 | yes Evaluation Count:17257 |
| 12069-17257 |
609 | bs->removeDirtyWidget(this); | - |
610 | if (testAttribute(Qt::WA_StaticContents)) partially evaluated: testAttribute(Qt::WA_StaticContents) no Evaluation Count:0 | yes Evaluation Count:12069 |
| 0-12069 |
611 | bs->removeStaticWidget(this); never executed: bs->removeStaticWidget(this); | 0 |
612 | } executed: } Execution Count:12069 | 12069 |
613 | | - |
614 | delete d->needsFlush; | - |
615 | d->needsFlush = 0; | - |
616 | | - |
617 | | - |
618 | | - |
619 | bool blocked = d->blockSig; | - |
620 | d->blockSig = 0; | - |
621 | | - |
622 | if (d->isSignalConnected(0)) { evaluated: d->isSignalConnected(0) yes Evaluation Count:1276 | yes Evaluation Count:28050 |
| 1276-28050 |
623 | if (true) { partially evaluated: true yes Evaluation Count:1276 | no Evaluation Count:0 |
| 0-1276 |
624 | destroyed(this); | - |
625 | } else { executed: } Execution Count:1276 | 1276 |
626 | | - |
627 | | - |
628 | QMessageLogger("kernel/qwidget.cpp", 1443, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); | - |
629 | qt_noop(); | - |
630 | } | 0 |
631 | } | - |
632 | | - |
633 | if (d->declarativeData) { partially evaluated: d->declarativeData no Evaluation Count:0 | yes Evaluation Count:29326 |
| 0-29326 |
634 | QAbstractDeclarativeData::destroyed(d->declarativeData, this); | - |
635 | d->declarativeData = 0; | - |
636 | } | 0 |
637 | | - |
638 | d->blockSig = blocked; | - |
639 | if (!d->children.isEmpty()) evaluated: !d->children.isEmpty() yes Evaluation Count:13392 | yes Evaluation Count:15934 |
| 13392-15934 |
640 | d->deleteChildren(); executed: d->deleteChildren(); Execution Count:13392 | 13392 |
641 | | - |
642 | QApplication::removePostedEvents(this); | - |
643 | | - |
644 | if (true) { partially evaluated: true yes Evaluation Count:29326 | no Evaluation Count:0 |
| 0-29326 |
645 | destroy(); | - |
646 | } else { executed: } Execution Count:29326 | 29326 |
647 | | - |
648 | } | 0 |
649 | --QWidgetPrivate::instanceCounter; | - |
650 | | - |
651 | if (QWidgetPrivate::allWidgets) evaluated: QWidgetPrivate::allWidgets yes Evaluation Count:29153 | yes Evaluation Count:173 |
| 173-29153 |
652 | QWidgetPrivate::allWidgets->remove(this); executed: QWidgetPrivate::allWidgets->remove(this); Execution Count:29153 | 29153 |
653 | | - |
654 | if (true) { partially evaluated: true yes Evaluation Count:29326 | no Evaluation Count:0 |
| 0-29326 |
655 | QEvent e(QEvent::Destroy); | - |
656 | QCoreApplication::sendEvent(this, &e); | - |
657 | } else { executed: } Execution Count:29326 | 29326 |
658 | | - |
659 | } | 0 |
660 | } | - |
661 | | - |
662 | int QWidgetPrivate::instanceCounter = 0; | - |
663 | int QWidgetPrivate::maxInstances = 0; | - |
664 | | - |
665 | void QWidgetPrivate::setWinId(WId id) | - |
666 | { | - |
667 | QWidget * const q = q_func(); | - |
668 | | - |
669 | | - |
670 | | - |
671 | | - |
672 | | - |
673 | bool userDesktopWidget = qt_desktopWidget != 0 && qt_desktopWidget != q && q->windowType() == Qt::Desktop; evaluated: qt_desktopWidget != 0 yes Evaluation Count:57206 | yes Evaluation Count:11166 |
evaluated: qt_desktopWidget != q yes Evaluation Count:57121 | yes Evaluation Count:85 |
evaluated: q->windowType() == Qt::Desktop yes Evaluation Count:92 | yes Evaluation Count:57029 |
| 85-57206 |
674 | if (mapper && data.winid && !userDesktopWidget) { evaluated: mapper yes Evaluation Count:67839 | yes Evaluation Count:533 |
evaluated: data.winid yes Evaluation Count:1445 | yes Evaluation Count:66394 |
evaluated: !userDesktopWidget yes Evaluation Count:1442 | yes Evaluation Count:3 |
| 3-67839 |
675 | mapper->remove(data.winid); | - |
676 | } executed: } Execution Count:1442 | 1442 |
677 | | - |
678 | const WId oldWinId = data.winid; | - |
679 | | - |
680 | data.winid = id; | - |
681 | | - |
682 | | - |
683 | | - |
684 | if (mapper && id && !userDesktopWidget) { evaluated: mapper yes Evaluation Count:67839 | yes Evaluation Count:533 |
evaluated: id yes Evaluation Count:1594 | yes Evaluation Count:66245 |
evaluated: !userDesktopWidget yes Evaluation Count:1592 | yes Evaluation Count:2 |
| 2-67839 |
685 | mapper->insert(data.winid, q); | - |
686 | } executed: } Execution Count:1592 | 1592 |
687 | | - |
688 | if(oldWinId != id) { evaluated: oldWinId != id yes Evaluation Count:3140 | yes Evaluation Count:65232 |
| 3140-65232 |
689 | QEvent e(QEvent::WinIdChange); | - |
690 | QCoreApplication::sendEvent(q, &e); | - |
691 | } executed: } Execution Count:3140 | 3140 |
692 | } executed: } Execution Count:68372 | 68372 |
693 | | - |
694 | void QWidgetPrivate::createTLExtra() | - |
695 | { | - |
696 | if (!extra) evaluated: !extra yes Evaluation Count:1976 | yes Evaluation Count:16998 |
| 1976-16998 |
697 | createExtra(); executed: createExtra(); Execution Count:1976 | 1976 |
698 | if (!extra->topextra) { evaluated: !extra->topextra yes Evaluation Count:2248 | yes Evaluation Count:16726 |
| 2248-16726 |
699 | QTLWExtra* x = extra->topextra = new QTLWExtra; | - |
700 | x->icon = 0; | - |
701 | x->backingStore = 0; | - |
702 | x->sharedPainter = 0; | - |
703 | x->incw = x->inch = 0; | - |
704 | x->basew = x->baseh = 0; | - |
705 | x->frameStrut.setCoords(0, 0, 0, 0); | - |
706 | x->normalGeometry = QRect(0,0,-1,-1); | - |
707 | x->savedFlags = 0; | - |
708 | x->opacity = 255; | - |
709 | x->posIncludesFrame = 0; | - |
710 | x->sizeAdjusted = false; | - |
711 | x->inTopLevelResize = false; | - |
712 | x->inRepaint = false; | - |
713 | x->embedded = 0; | - |
714 | | - |
715 | | - |
716 | | - |
717 | createTLSysExtra(); | - |
718 | | - |
719 | | - |
720 | | - |
721 | | - |
722 | } executed: } Execution Count:2248 | 2248 |
723 | } executed: } Execution Count:18974 | 18974 |
724 | | - |
725 | | - |
726 | | - |
727 | | - |
728 | | - |
729 | | - |
730 | void QWidgetPrivate::createExtra() | - |
731 | { | - |
732 | if (!extra) { evaluated: !extra yes Evaluation Count:10895 | yes Evaluation Count:16780 |
| 10895-16780 |
733 | extra = new QWExtra; | - |
734 | extra->glContext = 0; | - |
735 | extra->topextra = 0; | - |
736 | | - |
737 | extra->proxyWidget = 0; | - |
738 | | - |
739 | | - |
740 | extra->curs = 0; | - |
741 | | - |
742 | extra->minw = 0; | - |
743 | extra->minh = 0; | - |
744 | extra->maxw = ((1<<24)-1); | - |
745 | extra->maxh = ((1<<24)-1); | - |
746 | extra->customDpiX = 0; | - |
747 | extra->customDpiY = 0; | - |
748 | extra->explicitMinSize = 0; | - |
749 | extra->explicitMaxSize = 0; | - |
750 | extra->autoFillBackground = 0; | - |
751 | extra->nativeChildrenForced = 0; | - |
752 | extra->inRenderWithPainter = 0; | - |
753 | extra->hasMask = 0; | - |
754 | createSysExtra(); | - |
755 | | - |
756 | | - |
757 | | - |
758 | | - |
759 | } executed: } Execution Count:10895 | 10895 |
760 | } executed: } Execution Count:27675 | 27675 |
761 | | - |
762 | | - |
763 | | - |
764 | | - |
765 | | - |
766 | | - |
767 | | - |
768 | void QWidgetPrivate::deleteExtra() | - |
769 | { | - |
770 | if (extra) { partially evaluated: extra yes Evaluation Count:10038 | no Evaluation Count:0 |
| 0-10038 |
771 | | - |
772 | delete extra->curs; | - |
773 | | - |
774 | deleteSysExtra(); | - |
775 | | - |
776 | | - |
777 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style)) evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style) yes Evaluation Count:35 | yes Evaluation Count:10003 |
| 35-10003 |
778 | proxy->deref(); executed: proxy->deref(); Execution Count:35 | 35 |
779 | | - |
780 | if (extra->topextra) { evaluated: extra->topextra yes Evaluation Count:2157 | yes Evaluation Count:7881 |
| 2157-7881 |
781 | deleteTLSysExtra(); | - |
782 | | - |
783 | delete extra->topextra->icon; | - |
784 | delete extra->topextra; | - |
785 | } executed: } Execution Count:2157 | 2157 |
786 | delete extra; | - |
787 | | - |
788 | extra = 0; | - |
789 | } executed: } Execution Count:10038 | 10038 |
790 | } executed: } Execution Count:10038 | 10038 |
791 | | - |
792 | | - |
793 | | - |
794 | | - |
795 | | - |
796 | | - |
797 | bool QWidgetPrivate::isOverlapped(const QRect &rect) const | - |
798 | { | - |
799 | const QWidget * const q = q_func(); | - |
800 | | - |
801 | const QWidget *w = q; | - |
802 | QRect r = rect; | - |
803 | while (w) { partially evaluated: w yes Evaluation Count:3072 | no Evaluation Count:0 |
| 0-3072 |
804 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:1231 | yes Evaluation Count:1841 |
| 1231-1841 |
805 | return false; executed: return false; Execution Count:1231 | 1231 |
806 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - |
807 | bool above = false; | - |
808 | for (int i = 0; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:10148 | yes Evaluation Count:1833 |
| 1833-10148 |
809 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - |
810 | if (!sibling || !sibling->isVisible() || sibling->isWindow()) evaluated: !sibling yes Evaluation Count:2760 | yes Evaluation Count:7388 |
evaluated: !sibling->isVisible() yes Evaluation Count:1544 | yes Evaluation Count:5844 |
partially evaluated: sibling->isWindow() no Evaluation Count:0 | yes Evaluation Count:5844 |
| 0-7388 |
811 | continue; executed: continue; Execution Count:4304 | 4304 |
812 | if (!above) { evaluated: !above yes Evaluation Count:2588 | yes Evaluation Count:3256 |
| 2588-3256 |
813 | above = (sibling == w); | - |
814 | continue; executed: continue; Execution Count:2588 | 2588 |
815 | } | - |
816 | | - |
817 | if (qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r)) { evaluated: qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r) yes Evaluation Count:8 | yes Evaluation Count:3248 |
| 8-3248 |
818 | const QWExtra *siblingExtra = sibling->d_func()->extra; | - |
819 | if (siblingExtra && siblingExtra->hasMask && !sibling->d_func()->graphicsEffect partially evaluated: siblingExtra yes Evaluation Count:8 | no Evaluation Count:0 |
evaluated: siblingExtra->hasMask yes Evaluation Count:1 | yes Evaluation Count:7 |
partially evaluated: !sibling->d_func()->graphicsEffect yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-8 |
820 | && !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 |
821 | continue; never executed: continue; | 0 |
822 | } | - |
823 | return true; executed: return true; Execution Count:8 | 8 |
824 | } | - |
825 | } executed: } Execution Count:3248 | 3248 |
826 | w = w->parentWidget(); | - |
827 | r.translate(pd->data.crect.topLeft()); | - |
828 | } executed: } Execution Count:1833 | 1833 |
829 | return false; never executed: return false; | 0 |
830 | } | - |
831 | | - |
832 | void QWidgetPrivate::syncBackingStore() | - |
833 | { | - |
834 | if (paintOnScreen()) { partially evaluated: paintOnScreen() no Evaluation Count:0 | yes Evaluation Count:4008 |
| 0-4008 |
835 | repaint_sys(dirty); | - |
836 | dirty = QRegion(); | - |
837 | } else if (QWidgetBackingStore *bs = maybeBackingStore()) { partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:4008 | no Evaluation Count:0 |
| 0-4008 |
838 | bs->sync(); | - |
839 | } executed: } Execution Count:4008 | 4008 |
840 | } | - |
841 | | - |
842 | void QWidgetPrivate::syncBackingStore(const QRegion ®ion) | - |
843 | { | - |
844 | if (paintOnScreen()) partially evaluated: paintOnScreen() no Evaluation Count:0 | yes Evaluation Count:1659 |
| 0-1659 |
845 | repaint_sys(region); never executed: repaint_sys(region); | 0 |
846 | else if (QWidgetBackingStore *bs = maybeBackingStore()) { partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:1659 | no Evaluation Count:0 |
| 0-1659 |
847 | bs->sync(q_func(), region); | - |
848 | } executed: } Execution Count:1659 | 1659 |
849 | } | - |
850 | | - |
851 | void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) | - |
852 | { | - |
853 | QWidget * const q = q_func(); | - |
854 | | - |
855 | if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->updatesEnabled()) evaluated: enable yes Evaluation Count:42370 | yes Evaluation Count:13089 |
evaluated: !q->isWindow() yes Evaluation Count:41393 | yes Evaluation Count:977 |
partially evaluated: q->parentWidget() yes Evaluation Count:41393 | no Evaluation Count:0 |
partially evaluated: !q->parentWidget()->updatesEnabled() no Evaluation Count:0 | yes Evaluation Count:41393 |
| 0-42370 |
856 | return; | 0 |
857 | | - |
858 | if (enable != q->testAttribute(Qt::WA_UpdatesDisabled)) evaluated: enable != q->testAttribute(Qt::WA_UpdatesDisabled) yes Evaluation Count:29910 | yes Evaluation Count:25549 |
| 25549-29910 |
859 | return; executed: return; Execution Count:29910 | 29910 |
860 | | - |
861 | q->setAttribute(Qt::WA_UpdatesDisabled, !enable); | - |
862 | if (enable) evaluated: enable yes Evaluation Count:12540 | yes Evaluation Count:13009 |
| 12540-13009 |
863 | q->update(); executed: q->update(); Execution Count:12540 | 12540 |
864 | | - |
865 | Qt::WidgetAttribute attribute = enable ? Qt::WA_ForceUpdatesDisabled : Qt::WA_UpdatesDisabled; evaluated: enable yes Evaluation Count:12540 | yes Evaluation Count:13009 |
| 12540-13009 |
866 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:33367 | yes Evaluation Count:25549 |
| 25549-33367 |
867 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
868 | if (w && !w->isWindow() && !w->testAttribute(attribute)) evaluated: w yes Evaluation Count:23550 | yes Evaluation Count:9817 |
evaluated: !w->isWindow() yes Evaluation Count:23344 | yes Evaluation Count:206 |
evaluated: !w->testAttribute(attribute) yes Evaluation Count:23292 | yes Evaluation Count:52 |
| 52-23550 |
869 | w->d_func()->setUpdatesEnabled_helper(enable); executed: w->d_func()->setUpdatesEnabled_helper(enable); Execution Count:23292 | 23292 |
870 | } executed: } Execution Count:33367 | 33367 |
871 | } executed: } Execution Count:25549 | 25549 |
872 | void QWidgetPrivate::propagatePaletteChange() | - |
873 | { | - |
874 | QWidget * const q = q_func(); | - |
875 | | - |
876 | | - |
877 | if (!q->parentWidget() && extra && extra->proxyWidget) { evaluated: !q->parentWidget() yes Evaluation Count:674 | yes Evaluation Count:15942 |
evaluated: extra yes Evaluation Count:125 | yes Evaluation Count:549 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:125 |
| 0-15942 |
878 | QGraphicsProxyWidget *p = extra->proxyWidget; | - |
879 | inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve(); | - |
880 | } else | 0 |
881 | | - |
882 | if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { evaluated: q->isWindow() yes Evaluation Count:684 | yes Evaluation Count:15932 |
partially evaluated: !q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:684 | no Evaluation Count:0 |
| 0-15932 |
883 | inheritedPaletteResolveMask = 0; | - |
884 | } executed: } Execution Count:684 | 684 |
885 | int mask = data.pal.resolve() | inheritedPaletteResolveMask; | - |
886 | | - |
887 | QEvent pc(QEvent::PaletteChange); | - |
888 | QApplication::sendEvent(q, &pc); | - |
889 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:2036 | yes Evaluation Count:16616 |
| 2036-16616 |
890 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
891 | if (w && !w->testAttribute(Qt::WA_StyleSheet) evaluated: w yes Evaluation Count:986 | yes Evaluation Count:1050 |
partially evaluated: !w->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:986 | no Evaluation Count:0 |
| 0-1050 |
892 | && (!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))) { evaluated: !w->isWindow() yes Evaluation Count:848 | yes Evaluation Count:138 |
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation) no Evaluation Count:0 | yes Evaluation Count:138 |
| 0-848 |
893 | QWidgetPrivate *wd = w->d_func(); | - |
894 | wd->inheritedPaletteResolveMask = mask; | - |
895 | wd->resolvePalette(); | - |
896 | } executed: } Execution Count:848 | 848 |
897 | } executed: } Execution Count:2036 | 2036 |
898 | } executed: } Execution Count:16616 | 16616 |
899 | | - |
900 | | - |
901 | | - |
902 | | - |
903 | QRect QWidgetPrivate::clipRect() const | - |
904 | { | - |
905 | const QWidget * const q = q_func(); | - |
906 | const QWidget * w = q; | - |
907 | if (!w->isVisible()) evaluated: !w->isVisible() yes Evaluation Count:548 | yes Evaluation Count:19435 |
| 548-19435 |
908 | return QRect(); executed: return QRect(); Execution Count:548 | 548 |
909 | QRect r = effectiveRectFor(q->rect()); | - |
910 | int ox = 0; | - |
911 | int oy = 0; | - |
912 | while (w partially evaluated: w yes Evaluation Count:41113 | no Evaluation Count:0 |
| 0-41113 |
913 | && w->isVisible() evaluated: w->isVisible() yes Evaluation Count:41107 | yes Evaluation Count:6 |
| 6-41107 |
914 | && !w->isWindow() evaluated: !w->isWindow() yes Evaluation Count:21678 | yes Evaluation Count:19429 |
| 19429-21678 |
915 | && w->parentWidget()) { partially evaluated: w->parentWidget() yes Evaluation Count:21678 | no Evaluation Count:0 |
| 0-21678 |
916 | ox -= w->x(); | - |
917 | oy -= w->y(); | - |
918 | w = w->parentWidget(); | - |
919 | r &= QRect(ox, oy, w->width(), w->height()); | - |
920 | } executed: } Execution Count:21678 | 21678 |
921 | return r; executed: return r; Execution Count:19435 | 19435 |
922 | } | - |
923 | | - |
924 | | - |
925 | | - |
926 | | - |
927 | QRegion QWidgetPrivate::clipRegion() const | - |
928 | { | - |
929 | const QWidget * const q = q_func(); | - |
930 | if (!q->isVisible()) never evaluated: !q->isVisible() | 0 |
931 | return QRegion(); never executed: return QRegion(); | 0 |
932 | QRegion r(q->rect()); | - |
933 | const QWidget * w = q; | - |
934 | const QWidget *ignoreUpTo; | - |
935 | int ox = 0; | - |
936 | int oy = 0; | - |
937 | while (w | 0 |
938 | && w->isVisible() never evaluated: w->isVisible() | 0 |
939 | && !w->isWindow() never evaluated: !w->isWindow() | 0 |
940 | && w->parentWidget()) { never evaluated: w->parentWidget() | 0 |
941 | ox -= w->x(); | - |
942 | oy -= w->y(); | - |
943 | ignoreUpTo = w; | - |
944 | w = w->parentWidget(); | - |
945 | r &= QRegion(ox, oy, w->width(), w->height()); | - |
946 | | - |
947 | int i = 0; | - |
948 | 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 |
949 | ; | 0 |
950 | for ( ; i < w->d_func()->children.size(); ++i) { never evaluated: i < w->d_func()->children.size() | 0 |
951 | 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 |
952 | if(sibling->isVisible() && !sibling->isWindow()) { never evaluated: sibling->isVisible() never evaluated: !sibling->isWindow() | 0 |
953 | QRect siblingRect(ox+sibling->x(), oy+sibling->y(), | - |
954 | sibling->width(), sibling->height()); | - |
955 | if (qRectIntersects(siblingRect, q->rect())) never evaluated: qRectIntersects(siblingRect, q->rect()) | 0 |
956 | r -= QRegion(siblingRect); never executed: r -= QRegion(siblingRect); | 0 |
957 | } | 0 |
958 | } | 0 |
959 | } | 0 |
960 | } | 0 |
961 | return r; never executed: return r; | 0 |
962 | } | - |
963 | | - |
964 | void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion ®ion) | - |
965 | { | - |
966 | | - |
967 | | - |
968 | | - |
969 | QPaintEngine *paintEngine = paintDevice->paintEngine(); | - |
970 | | - |
971 | | - |
972 | | - |
973 | | - |
974 | | - |
975 | | - |
976 | | - |
977 | paintEngine->d_func()->systemClip = region; | - |
978 | | - |
979 | } executed: } Execution Count:17440 | 17440 |
980 | | - |
981 | | - |
982 | void QWidgetPrivate::invalidateGraphicsEffectsRecursively() | - |
983 | { | - |
984 | QWidget * const q = q_func(); | - |
985 | QWidget *w = q; | - |
986 | do { | - |
987 | if (w->graphicsEffect()) { partially evaluated: w->graphicsEffect() no Evaluation Count:0 | yes Evaluation Count:535252 |
| 0-535252 |
988 | QWidgetEffectSourcePrivate *sourced = | - |
989 | static_cast<QWidgetEffectSourcePrivate *>(w->graphicsEffect()->source()->d_func()); | - |
990 | if (!sourced->updateDueToGraphicsEffect) never evaluated: !sourced->updateDueToGraphicsEffect | 0 |
991 | w->graphicsEffect()->source()->d_func()->invalidateCache(); never executed: w->graphicsEffect()->source()->d_func()->invalidateCache(); | 0 |
992 | } | 0 |
993 | w = w->parentWidget(); | - |
994 | } while (w); executed: } Execution Count:535252 evaluated: w yes Evaluation Count:324677 | yes Evaluation Count:210575 |
| 210575-535252 |
995 | } executed: } Execution Count:210575 | 210575 |
996 | | - |
997 | | - |
998 | void QWidgetPrivate::setDirtyOpaqueRegion() | - |
999 | { | - |
1000 | QWidget * const q = q_func(); | - |
1001 | | - |
1002 | dirtyOpaqueChildren = true; | - |
1003 | | - |
1004 | | - |
1005 | invalidateGraphicsEffectsRecursively(); | - |
1006 | | - |
1007 | | - |
1008 | if (q->isWindow()) evaluated: q->isWindow() yes Evaluation Count:20459 | yes Evaluation Count:123846 |
| 20459-123846 |
1009 | return; executed: return; Execution Count:20459 | 20459 |
1010 | | - |
1011 | QWidget *parent = q->parentWidget(); | - |
1012 | if (!parent) partially evaluated: !parent no Evaluation Count:0 | yes Evaluation Count:123846 |
| 0-123846 |
1013 | return; | 0 |
1014 | | - |
1015 | | - |
1016 | QWidgetPrivate *pd = parent->d_func(); | - |
1017 | if (!pd->dirtyOpaqueChildren) evaluated: !pd->dirtyOpaqueChildren yes Evaluation Count:1532 | yes Evaluation Count:122314 |
| 1532-122314 |
1018 | pd->setDirtyOpaqueRegion(); executed: pd->setDirtyOpaqueRegion(); Execution Count:1532 | 1532 |
1019 | } executed: } Execution Count:123846 | 123846 |
1020 | | - |
1021 | const QRegion &QWidgetPrivate::getOpaqueChildren() const | - |
1022 | { | - |
1023 | if (!dirtyOpaqueChildren) evaluated: !dirtyOpaqueChildren yes Evaluation Count:4790 | yes Evaluation Count:5380 |
| 4790-5380 |
1024 | return opaqueChildren; executed: return opaqueChildren; Execution Count:4790 | 4790 |
1025 | | - |
1026 | QWidgetPrivate *that = const_cast<QWidgetPrivate*>(this); | - |
1027 | that->opaqueChildren = QRegion(); | - |
1028 | | - |
1029 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:13990 | yes Evaluation Count:5380 |
| 5380-13990 |
1030 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
1031 | if (!child || !child->isVisible() || child->isWindow()) evaluated: !child yes Evaluation Count:4827 | yes Evaluation Count:9163 |
evaluated: !child->isVisible() yes Evaluation Count:3170 | yes Evaluation Count:5993 |
evaluated: child->isWindow() yes Evaluation Count:12 | yes Evaluation Count:5981 |
| 12-9163 |
1032 | continue; executed: continue; Execution Count:8009 | 8009 |
1033 | | - |
1034 | const QPoint offset = child->geometry().topLeft(); | - |
1035 | QWidgetPrivate *childd = child->d_func(); | - |
1036 | QRegion r = childd->isOpaque ? child->rect() : childd->getOpaqueChildren(); evaluated: childd->isOpaque yes Evaluation Count:1954 | yes Evaluation Count:4027 |
| 1954-4027 |
1037 | if (childd->extra && childd->extra->hasMask) evaluated: childd->extra yes Evaluation Count:3127 | yes Evaluation Count:2854 |
partially evaluated: childd->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:3127 |
| 0-3127 |
1038 | r &= childd->extra->mask; never executed: r &= childd->extra->mask; | 0 |
1039 | if (r.isEmpty()) evaluated: r.isEmpty() yes Evaluation Count:2741 | yes Evaluation Count:3240 |
| 2741-3240 |
1040 | continue; executed: continue; Execution Count:2741 | 2741 |
1041 | r.translate(offset); | - |
1042 | that->opaqueChildren += r; | - |
1043 | } executed: } Execution Count:3240 | 3240 |
1044 | | - |
1045 | that->opaqueChildren &= q_func()->rect(); | - |
1046 | that->dirtyOpaqueChildren = false; | - |
1047 | | - |
1048 | return that->opaqueChildren; executed: return that->opaqueChildren; Execution Count:5380 | 5380 |
1049 | } | - |
1050 | | - |
1051 | void QWidgetPrivate::subtractOpaqueChildren(QRegion &source, const QRect &clipRect) const | - |
1052 | { | - |
1053 | if (children.isEmpty() || clipRect.isEmpty()) evaluated: children.isEmpty() yes Evaluation Count:7812 | yes Evaluation Count:6072 |
evaluated: clipRect.isEmpty() yes Evaluation Count:5 | yes Evaluation Count:6067 |
| 5-7812 |
1054 | return; executed: return; Execution Count:7817 | 7817 |
1055 | | - |
1056 | const QRegion &r = getOpaqueChildren(); | - |
1057 | if (!r.isEmpty()) evaluated: !r.isEmpty() yes Evaluation Count:2995 | yes Evaluation Count:3072 |
| 2995-3072 |
1058 | source -= (r & clipRect); executed: source -= (r & clipRect); Execution Count:2995 | 2995 |
1059 | } executed: } Execution Count:6067 | 6067 |
1060 | | - |
1061 | | - |
1062 | void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirtySiblingsAbove, | - |
1063 | bool alsoNonOpaque) const | - |
1064 | { | - |
1065 | const QWidget * const q = q_func(); | - |
1066 | static int disableSubtractOpaqueSiblings = qgetenv("QT_NO_SUBTRACTOPAQUESIBLINGS").toInt(); | - |
1067 | if (disableSubtractOpaqueSiblings || q->isWindow()) partially evaluated: disableSubtractOpaqueSiblings no Evaluation Count:0 | yes Evaluation Count:6758 |
evaluated: q->isWindow() yes Evaluation Count:780 | yes Evaluation Count:5978 |
| 0-6758 |
1068 | return; executed: return; Execution Count:780 | 780 |
1069 | | - |
1070 | | - |
1071 | | - |
1072 | | - |
1073 | | - |
1074 | | - |
1075 | QRect clipBoundingRect; | - |
1076 | bool dirtyClipBoundingRect = true; | - |
1077 | | - |
1078 | QRegion parentClip; | - |
1079 | bool dirtyParentClip = true; | - |
1080 | | - |
1081 | QPoint parentOffset = data.crect.topLeft(); | - |
1082 | | - |
1083 | const QWidget *w = q; | - |
1084 | | - |
1085 | while (w) { partially evaluated: w yes Evaluation Count:15615 | no Evaluation Count:0 |
| 0-15615 |
1086 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:5695 | yes Evaluation Count:9920 |
| 5695-9920 |
1087 | break; executed: break; Execution Count:5695 | 5695 |
1088 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - |
1089 | const int myIndex = pd->children.indexOf(const_cast<QWidget *>(w)); | - |
1090 | const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->data->crect); | - |
1091 | for (int i = myIndex + 1; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:16831 | yes Evaluation Count:9637 |
| 9637-16831 |
1092 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - |
1093 | if (!sibling || !sibling->isVisible() || sibling->isWindow()) evaluated: !sibling yes Evaluation Count:7626 | yes Evaluation Count:9205 |
evaluated: !sibling->isVisible() yes Evaluation Count:3251 | yes Evaluation Count:5954 |
evaluated: sibling->isWindow() yes Evaluation Count:13 | yes Evaluation Count:5941 |
| 13-9205 |
1094 | continue; executed: continue; Execution Count:10890 | 10890 |
1095 | | - |
1096 | const QRect siblingGeometry = sibling->d_func()->effectiveRectFor(sibling->data->crect); | - |
1097 | if (!qRectIntersects(siblingGeometry, widgetGeometry)) evaluated: !qRectIntersects(siblingGeometry, widgetGeometry) yes Evaluation Count:5384 | yes Evaluation Count:557 |
| 557-5384 |
1098 | continue; executed: continue; Execution Count:5384 | 5384 |
1099 | | - |
1100 | if (dirtyClipBoundingRect) { evaluated: dirtyClipBoundingRect yes Evaluation Count:531 | yes Evaluation Count:26 |
| 26-531 |
1101 | clipBoundingRect = sourceRegion.boundingRect(); | - |
1102 | dirtyClipBoundingRect = false; | - |
1103 | } executed: } Execution Count:531 | 531 |
1104 | | - |
1105 | if (!qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset))) evaluated: !qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset)) yes Evaluation Count:62 | yes Evaluation Count:495 |
| 62-495 |
1106 | continue; executed: continue; Execution Count:62 | 62 |
1107 | | - |
1108 | if (dirtyParentClip) { evaluated: dirtyParentClip yes Evaluation Count:494 | yes Evaluation Count:1 |
| 1-494 |
1109 | parentClip = sourceRegion.translated(parentOffset); | - |
1110 | dirtyParentClip = false; | - |
1111 | } executed: } Execution Count:494 | 494 |
1112 | | - |
1113 | const QPoint siblingPos(sibling->data->crect.topLeft()); | - |
1114 | const QRect siblingClipRect(sibling->d_func()->clipRect()); | - |
1115 | QRegion siblingDirty(parentClip); | - |
1116 | siblingDirty &= (siblingClipRect.translated(siblingPos)); | - |
1117 | const bool hasMask = sibling->d_func()->extra && sibling->d_func()->extra->hasMask evaluated: sibling->d_func()->extra yes Evaluation Count:479 | yes Evaluation Count:16 |
partially evaluated: sibling->d_func()->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:479 |
| 0-479 |
1118 | && !sibling->d_func()->graphicsEffect; never evaluated: !sibling->d_func()->graphicsEffect | 0 |
1119 | if (hasMask) partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:495 |
| 0-495 |
1120 | siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); never executed: siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); | 0 |
1121 | if (siblingDirty.isEmpty()) partially evaluated: siblingDirty.isEmpty() no Evaluation Count:0 | yes Evaluation Count:495 |
| 0-495 |
1122 | continue; never executed: continue; | 0 |
1123 | | - |
1124 | if (sibling->d_func()->isOpaque || alsoNonOpaque) { evaluated: sibling->d_func()->isOpaque yes Evaluation Count:412 | yes Evaluation Count:83 |
partially evaluated: alsoNonOpaque no Evaluation Count:0 | yes Evaluation Count:83 |
| 0-412 |
1125 | if (hasMask) { partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:412 |
| 0-412 |
1126 | siblingDirty.translate(-parentOffset); | - |
1127 | sourceRegion -= siblingDirty; | - |
1128 | } else { | 0 |
1129 | sourceRegion -= siblingGeometry.translated(-parentOffset); | - |
1130 | } executed: } Execution Count:412 | 412 |
1131 | } else { | - |
1132 | if (hasDirtySiblingsAbove) evaluated: hasDirtySiblingsAbove yes Evaluation Count:16 | yes Evaluation Count:67 |
| 16-67 |
1133 | *hasDirtySiblingsAbove = true; executed: *hasDirtySiblingsAbove = true; Execution Count:16 | 16 |
1134 | if (sibling->d_func()->children.isEmpty()) evaluated: sibling->d_func()->children.isEmpty() yes Evaluation Count:7 | yes Evaluation Count:76 |
| 7-76 |
1135 | continue; executed: continue; Execution Count:7 | 7 |
1136 | QRegion opaqueSiblingChildren(sibling->d_func()->getOpaqueChildren()); | - |
1137 | opaqueSiblingChildren.translate(-parentOffset + siblingPos); | - |
1138 | sourceRegion -= opaqueSiblingChildren; | - |
1139 | } executed: } Execution Count:76 | 76 |
1140 | if (sourceRegion.isEmpty()) evaluated: sourceRegion.isEmpty() yes Evaluation Count:283 | yes Evaluation Count:205 |
| 205-283 |
1141 | return; executed: return; Execution Count:283 | 283 |
1142 | | - |
1143 | dirtyClipBoundingRect = true; | - |
1144 | dirtyParentClip = true; | - |
1145 | } executed: } Execution Count:205 | 205 |
1146 | | - |
1147 | w = w->parentWidget(); | - |
1148 | parentOffset += pd->data.crect.topLeft(); | - |
1149 | dirtyParentClip = true; | - |
1150 | } executed: } Execution Count:9637 | 9637 |
1151 | } executed: } Execution Count:5695 | 5695 |
1152 | | - |
1153 | void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const | - |
1154 | { | - |
1155 | const QWidget * const q = q_func(); | - |
1156 | | - |
1157 | const QWidget *w = q; | - |
1158 | QPoint offset; | - |
1159 | | - |
1160 | | - |
1161 | if (graphicsEffect) { partially evaluated: graphicsEffect no Evaluation Count:0 | yes Evaluation Count:4474 |
| 0-4474 |
1162 | w = q->parentWidget(); | - |
1163 | offset -= data.crect.topLeft(); | - |
1164 | } | 0 |
1165 | | - |
1166 | | - |
1167 | while (w) { partially evaluated: w yes Evaluation Count:11491 | no Evaluation Count:0 |
| 0-11491 |
1168 | const QWidgetPrivate *wd = w->d_func(); | - |
1169 | if (wd->extra && wd->extra->hasMask) evaluated: wd->extra yes Evaluation Count:9030 | yes Evaluation Count:2461 |
partially evaluated: wd->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:9030 |
| 0-9030 |
1170 | region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask; never executed: region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask; never evaluated: (w != q) | 0 |
1171 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:4474 | yes Evaluation Count:7017 |
| 4474-7017 |
1172 | return; executed: return; Execution Count:4474 | 4474 |
1173 | offset -= wd->data.crect.topLeft(); | - |
1174 | w = w->parentWidget(); | - |
1175 | } executed: } Execution Count:7017 | 7017 |
1176 | } | 0 |
1177 | | - |
1178 | bool QWidgetPrivate::paintOnScreen() const | - |
1179 | { | - |
1180 | | - |
1181 | | - |
1182 | | - |
1183 | const QWidget * const q = q_func(); | - |
1184 | if (q->testAttribute(Qt::WA_PaintOnScreen) partially evaluated: q->testAttribute(Qt::WA_PaintOnScreen) no Evaluation Count:0 | yes Evaluation Count:83569 |
| 0-83569 |
1185 | || (!q->isWindow() && q->window()->testAttribute(Qt::WA_PaintOnScreen))) { evaluated: !q->isWindow() yes Evaluation Count:63154 | yes Evaluation Count:20415 |
partially evaluated: q->window()->testAttribute(Qt::WA_PaintOnScreen) no Evaluation Count:0 | yes Evaluation Count:63154 |
| 0-63154 |
1186 | return true; never executed: return true; | 0 |
1187 | } | - |
1188 | | - |
1189 | return !qt_enable_backingstore; executed: return !qt_enable_backingstore; Execution Count:83569 | 83569 |
1190 | | - |
1191 | } | - |
1192 | | - |
1193 | void QWidgetPrivate::updateIsOpaque() | - |
1194 | { | - |
1195 | | - |
1196 | setDirtyOpaqueRegion(); | - |
1197 | | - |
1198 | | - |
1199 | if (graphicsEffect) { partially evaluated: graphicsEffect no Evaluation Count:0 | yes Evaluation Count:68329 |
| 0-68329 |
1200 | | - |
1201 | setOpaque(false); | - |
1202 | return; | 0 |
1203 | } | - |
1204 | | - |
1205 | | - |
1206 | QWidget * const q = q_func(); | - |
1207 | | - |
1208 | | - |
1209 | | - |
1210 | | - |
1211 | | - |
1212 | | - |
1213 | | - |
1214 | if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) { evaluated: q->testAttribute(Qt::WA_OpaquePaintEvent) yes Evaluation Count:8199 | yes Evaluation Count:60130 |
evaluated: q->testAttribute(Qt::WA_PaintOnScreen) yes Evaluation Count:213 | yes Evaluation Count:59917 |
| 213-60130 |
1215 | setOpaque(true); | - |
1216 | return; executed: return; Execution Count:8412 | 8412 |
1217 | } | - |
1218 | | - |
1219 | const QPalette &pal = q->palette(); | - |
1220 | | - |
1221 | if (q->autoFillBackground()) { evaluated: q->autoFillBackground() yes Evaluation Count:15078 | yes Evaluation Count:44839 |
| 15078-44839 |
1222 | const QBrush &autoFillBrush = pal.brush(q->backgroundRole()); | - |
1223 | if (autoFillBrush.style() != Qt::NoBrush && autoFillBrush.isOpaque()) { partially evaluated: autoFillBrush.style() != Qt::NoBrush yes Evaluation Count:15078 | no Evaluation Count:0 |
evaluated: autoFillBrush.isOpaque() yes Evaluation Count:15065 | yes Evaluation Count:13 |
| 0-15078 |
1224 | setOpaque(true); | - |
1225 | return; executed: return; Execution Count:15065 | 15065 |
1226 | } | - |
1227 | } executed: } Execution Count:13 | 13 |
1228 | | - |
1229 | if (q->isWindow() && !q->testAttribute(Qt::WA_NoSystemBackground)) { evaluated: q->isWindow() yes Evaluation Count:3069 | yes Evaluation Count:41783 |
evaluated: !q->testAttribute(Qt::WA_NoSystemBackground) yes Evaluation Count:3058 | yes Evaluation Count:11 |
| 11-41783 |
1230 | const QBrush &windowBrush = q->palette().brush(QPalette::Window); | - |
1231 | if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) { partially evaluated: windowBrush.style() != Qt::NoBrush yes Evaluation Count:3058 | no Evaluation Count:0 |
partially evaluated: windowBrush.isOpaque() yes Evaluation Count:3058 | no Evaluation Count:0 |
| 0-3058 |
1232 | setOpaque(true); | - |
1233 | return; executed: return; Execution Count:3058 | 3058 |
1234 | } | - |
1235 | } | 0 |
1236 | setOpaque(false); | - |
1237 | } executed: } Execution Count:41794 | 41794 |
1238 | | - |
1239 | void QWidgetPrivate::setOpaque(bool opaque) | - |
1240 | { | - |
1241 | if (isOpaque != opaque) { evaluated: isOpaque != opaque yes Evaluation Count:20386 | yes Evaluation Count:53575 |
| 20386-53575 |
1242 | isOpaque = opaque; | - |
1243 | updateIsTranslucent(); | - |
1244 | } executed: } Execution Count:20386 | 20386 |
1245 | } executed: } Execution Count:73961 | 73961 |
1246 | | - |
1247 | void QWidgetPrivate::updateIsTranslucent() | - |
1248 | { | - |
1249 | QWidget * const q = q_func(); | - |
1250 | if (QWindow *window = q->windowHandle()) partially evaluated: QWindow *window = q->windowHandle() no Evaluation Count:0 | yes Evaluation Count:20389 |
| 0-20389 |
1251 | window->setOpacity(isOpaque ? qreal(1.0) : qreal(0.0)); never executed: window->setOpacity(isOpaque ? qreal(1.0) : qreal(0.0)); | 0 |
1252 | } executed: } Execution Count:20389 | 20389 |
1253 | | - |
1254 | static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush) | - |
1255 | { | - |
1256 | qt_noop(); | - |
1257 | | - |
1258 | if (brush.style() == Qt::TexturePattern) { partially evaluated: brush.style() == Qt::TexturePattern no Evaluation Count:0 | yes Evaluation Count:4440 |
| 0-4440 |
1259 | | - |
1260 | | - |
1261 | | - |
1262 | | - |
1263 | | - |
1264 | | - |
1265 | | - |
1266 | { | - |
1267 | const QRect rect(rgn.boundingRect()); | - |
1268 | painter->setClipRegion(rgn); | - |
1269 | painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); | - |
1270 | } | - |
1271 | | - |
1272 | | - |
1273 | } else if (brush.gradient() evaluated: brush.gradient() yes Evaluation Count:4 | yes Evaluation Count:4436 |
| 0-4436 |
1274 | && brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode) { partially evaluated: brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1275 | painter->save(); | - |
1276 | painter->setClipRegion(rgn); | - |
1277 | painter->fillRect(0, 0, painter->device()->width(), painter->device()->height(), brush); | - |
1278 | painter->restore(); | - |
1279 | } else { | 0 |
1280 | const QVector<QRect> &rects = rgn.rects(); | - |
1281 | for (int i = 0; i < rects.size(); ++i) evaluated: i < rects.size() yes Evaluation Count:7664 | yes Evaluation Count:4440 |
| 4440-7664 |
1282 | painter->fillRect(rects.at(i), brush); executed: painter->fillRect(rects.at(i), brush); Execution Count:7664 | 7664 |
1283 | } executed: } Execution Count:4440 | 4440 |
1284 | } | - |
1285 | | - |
1286 | void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int flags) const | - |
1287 | { | - |
1288 | const QWidget * const q = q_func(); | - |
1289 | | - |
1290 | | - |
1291 | bool resetBrushOrigin = false; | - |
1292 | QPointF oldBrushOrigin; | - |
1293 | | - |
1294 | QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent); | - |
1295 | if (scrollArea && scrollArea->viewport() == q) { evaluated: scrollArea yes Evaluation Count:1999 | yes Evaluation Count:2441 |
partially evaluated: scrollArea->viewport() == q yes Evaluation Count:1999 | no Evaluation Count:0 |
| 0-2441 |
1296 | QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr.data(); | - |
1297 | QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate); | - |
1298 | oldBrushOrigin = painter->brushOrigin(); | - |
1299 | resetBrushOrigin = true; | - |
1300 | painter->setBrushOrigin(-priv->contentsOffset()); | - |
1301 | | - |
1302 | } executed: } Execution Count:1999 | 1999 |
1303 | | - |
1304 | | - |
1305 | const QBrush autoFillBrush = q->palette().brush(q->backgroundRole()); | - |
1306 | | - |
1307 | if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.isOpaque())) { evaluated: (flags & DrawAsRoot) yes Evaluation Count:2050 | yes Evaluation Count:2390 |
evaluated: q->autoFillBackground() yes Evaluation Count:7 | yes Evaluation Count:2043 |
partially evaluated: autoFillBrush.isOpaque() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-2390 |
1308 | const QBrush bg = q->palette().brush(QPalette::Window); | - |
1309 | if (!(flags & DontSetCompositionMode)) { evaluated: !(flags & DontSetCompositionMode) yes Evaluation Count:1999 | yes Evaluation Count:44 |
| 44-1999 |
1310 | | - |
1311 | QPainter::CompositionMode oldMode = painter->compositionMode(); | - |
1312 | painter->setCompositionMode(QPainter::CompositionMode_Source); | - |
1313 | fillRegion(painter, rgn, bg); | - |
1314 | painter->setCompositionMode(oldMode); | - |
1315 | } else { executed: } Execution Count:1999 | 1999 |
1316 | fillRegion(painter, rgn, bg); | - |
1317 | } executed: } Execution Count:44 | 44 |
1318 | } | - |
1319 | | - |
1320 | if (q->autoFillBackground()) evaluated: q->autoFillBackground() yes Evaluation Count:2397 | yes Evaluation Count:2043 |
| 2043-2397 |
1321 | fillRegion(painter, rgn, autoFillBrush); executed: fillRegion(painter, rgn, autoFillBrush); Execution Count:2397 | 2397 |
1322 | | - |
1323 | if (q->testAttribute(Qt::WA_StyledBackground)) { partially evaluated: q->testAttribute(Qt::WA_StyledBackground) no Evaluation Count:0 | yes Evaluation Count:4440 |
| 0-4440 |
1324 | painter->setClipRegion(rgn); | - |
1325 | QStyleOption opt; | - |
1326 | opt.initFrom(q); | - |
1327 | q->style()->drawPrimitive(QStyle::PE_Widget, &opt, painter, q); | - |
1328 | } | 0 |
1329 | | - |
1330 | | - |
1331 | if (resetBrushOrigin) evaluated: resetBrushOrigin yes Evaluation Count:1999 | yes Evaluation Count:2441 |
| 1999-2441 |
1332 | painter->setBrushOrigin(oldBrushOrigin); executed: painter->setBrushOrigin(oldBrushOrigin); Execution Count:1999 | 1999 |
1333 | | - |
1334 | } executed: } Execution Count:4440 | 4440 |
1335 | extern QWidget *qt_button_down; | - |
1336 | | - |
1337 | | - |
1338 | void QWidgetPrivate::deactivateWidgetCleanup() | - |
1339 | { | - |
1340 | QWidget * const q = q_func(); | - |
1341 | | - |
1342 | if (QApplication::activeWindow() == q) evaluated: QApplication::activeWindow() == q yes Evaluation Count:624 | yes Evaluation Count:34211 |
| 624-34211 |
1343 | QApplication::setActiveWindow(0); executed: QApplication::setActiveWindow(0); Execution Count:624 | 624 |
1344 | | - |
1345 | if (q == qt_button_down) partially evaluated: q == qt_button_down no Evaluation Count:0 | yes Evaluation Count:34835 |
| 0-34835 |
1346 | qt_button_down = 0; never executed: qt_button_down = 0; | 0 |
1347 | } executed: } Execution Count:34835 | 34835 |
1348 | QWidget *QWidget::find(WId id) | - |
1349 | { | - |
1350 | return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0; never executed: return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0; | 0 |
1351 | } | - |
1352 | WId QWidget::winId() const | - |
1353 | { | - |
1354 | if (!testAttribute(Qt::WA_WState_Created) || !internalWinId()) { evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1 | yes Evaluation Count:11 |
partially evaluated: !internalWinId() no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
1355 | | - |
1356 | | - |
1357 | | - |
1358 | QWidget *that = const_cast<QWidget*>(this); | - |
1359 | that->setAttribute(Qt::WA_NativeWindow); | - |
1360 | that->d_func()->createWinId(); | - |
1361 | return that->data->winid; executed: return that->data->winid; Execution Count:1 | 1 |
1362 | } | - |
1363 | return data->winid; executed: return data->winid; Execution Count:11 | 11 |
1364 | } | - |
1365 | | - |
1366 | | - |
1367 | void QWidgetPrivate::createWinId(WId winid) | - |
1368 | { | - |
1369 | QWidget * const q = q_func(); | - |
1370 | | - |
1371 | | - |
1372 | | - |
1373 | | - |
1374 | const bool forceNativeWindow = q->testAttribute(Qt::WA_NativeWindow); | - |
1375 | if (!q->testAttribute(Qt::WA_WState_Created) || (forceNativeWindow && !q->internalWinId())) { partially evaluated: !q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:62 | no Evaluation Count:0 |
never evaluated: forceNativeWindow never evaluated: !q->internalWinId() | 0-62 |
1376 | if (!q->isWindow()) { evaluated: !q->isWindow() yes Evaluation Count:3 | yes Evaluation Count:59 |
| 3-59 |
1377 | QWidget *parent = q->parentWidget(); | - |
1378 | QWidgetPrivate *pd = parent->d_func(); | - |
1379 | if (forceNativeWindow && !q->testAttribute(Qt::WA_DontCreateNativeAncestors)) evaluated: forceNativeWindow yes Evaluation Count:2 | yes Evaluation Count:1 |
partially evaluated: !q->testAttribute(Qt::WA_DontCreateNativeAncestors) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1380 | parent->setAttribute(Qt::WA_NativeWindow); executed: parent->setAttribute(Qt::WA_NativeWindow); Execution Count:2 | 2 |
1381 | if (!parent->internalWinId()) { partially evaluated: !parent->internalWinId() yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
1382 | pd->createWinId(); | - |
1383 | } executed: } Execution Count:3 | 3 |
1384 | | - |
1385 | for (int i = 0; i < pd->children.size(); ++i) { evaluated: i < pd->children.size() yes Evaluation Count:6 | yes Evaluation Count:3 |
| 3-6 |
1386 | QWidget *w = qobject_cast<QWidget *>(pd->children.at(i)); | - |
1387 | if (w && !w->isWindow() && (!w->testAttribute(Qt::WA_WState_Created) partially evaluated: w yes Evaluation Count:6 | no Evaluation Count:0 |
partially evaluated: !w->isWindow() yes Evaluation Count:6 | no Evaluation Count:0 |
partially evaluated: !w->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
1388 | || (!w->internalWinId() && w->testAttribute(Qt::WA_NativeWindow)))) { never evaluated: !w->internalWinId() never evaluated: w->testAttribute(Qt::WA_NativeWindow) | 0 |
1389 | if (w!=q) { evaluated: w!=q yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
1390 | w->create(); | - |
1391 | } else { executed: } Execution Count:3 | 3 |
1392 | w->create(winid); | - |
1393 | | - |
1394 | | - |
1395 | if (winid) partially evaluated: winid no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
1396 | w->raise(); never executed: w->raise(); | 0 |
1397 | } executed: } Execution Count:3 | 3 |
1398 | } | - |
1399 | } executed: } Execution Count:6 | 6 |
1400 | } else { executed: } Execution Count:3 | 3 |
1401 | q->create(); | - |
1402 | } executed: } Execution Count:59 | 59 |
1403 | } | - |
1404 | } executed: } Execution Count:62 | 62 |
1405 | void QWidget::createWinId() | - |
1406 | { | - |
1407 | QWidgetPrivate * const d = d_func(); | - |
1408 | | - |
1409 | | - |
1410 | | - |
1411 | | - |
1412 | d->createWinId(); | - |
1413 | } executed: } Execution Count:58 | 58 |
1414 | WId QWidget::effectiveWinId() const | - |
1415 | { | - |
1416 | const WId id = internalWinId(); | - |
1417 | if (id || !testAttribute(Qt::WA_WState_Created)) evaluated: id yes Evaluation Count:54 | yes Evaluation Count:62 |
partially evaluated: !testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:62 |
| 0-62 |
1418 | return id; executed: return id; Execution Count:54 | 54 |
1419 | if (const QWidget *realParent = nativeParentWidget()) partially evaluated: const QWidget *realParent = nativeParentWidget() yes Evaluation Count:62 | no Evaluation Count:0 |
| 0-62 |
1420 | return realParent->internalWinId(); executed: return realParent->internalWinId(); Execution Count:62 | 62 |
1421 | return 0; never executed: return 0; | 0 |
1422 | } | - |
1423 | QString QWidget::styleSheet() const | - |
1424 | { | - |
1425 | const QWidgetPrivate * const d = d_func(); | - |
1426 | if (!d->extra) evaluated: !d->extra yes Evaluation Count:30601 | yes Evaluation Count:336 |
| 336-30601 |
1427 | return QString(); executed: return QString(); Execution Count:30601 | 30601 |
1428 | return d->extra->styleSheet; executed: return d->extra->styleSheet; Execution Count:336 | 336 |
1429 | } | - |
1430 | | - |
1431 | void QWidget::setStyleSheet(const QString& styleSheet) | - |
1432 | { | - |
1433 | QWidgetPrivate * const d = d_func(); | - |
1434 | d->createExtra(); | - |
1435 | | - |
1436 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(d->extra->style); | - |
1437 | d->extra->styleSheet = styleSheet; | - |
1438 | if (styleSheet.isEmpty()) { partially evaluated: styleSheet.isEmpty() no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-13 |
1439 | if (!proxy) | 0 |
1440 | return; | 0 |
1441 | | - |
1442 | d->inheritStyle(); | - |
1443 | return; | 0 |
1444 | } | - |
1445 | | - |
1446 | if (proxy) { partially evaluated: proxy no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-13 |
1447 | proxy->repolish(this); | - |
1448 | return; | 0 |
1449 | } | - |
1450 | | - |
1451 | if (testAttribute(Qt::WA_SetStyle)) { partially evaluated: testAttribute(Qt::WA_SetStyle) no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-13 |
1452 | d->setStyle_helper(new QStyleSheetStyle(d->extra->style), true); | - |
1453 | } else { | 0 |
1454 | d->setStyle_helper(new QStyleSheetStyle(0), true); | - |
1455 | } executed: } Execution Count:13 | 13 |
1456 | } | - |
1457 | | - |
1458 | | - |
1459 | | - |
1460 | | - |
1461 | | - |
1462 | | - |
1463 | | - |
1464 | QStyle *QWidget::style() const | - |
1465 | { | - |
1466 | const QWidgetPrivate * const d = d_func(); | - |
1467 | | - |
1468 | if (d->extra && d->extra->style) evaluated: d->extra yes Evaluation Count:431801 | yes Evaluation Count:683210 |
evaluated: d->extra->style yes Evaluation Count:822 | yes Evaluation Count:430979 |
| 822-683210 |
1469 | return d->extra->style; executed: return d->extra->style; Execution Count:822 | 822 |
1470 | return QApplication::style(); executed: return QApplication::style(); Execution Count:1114189 | 1114189 |
1471 | } | - |
1472 | void QWidget::setStyle(QStyle *style) | - |
1473 | { | - |
1474 | QWidgetPrivate * const d = d_func(); | - |
1475 | setAttribute(Qt::WA_SetStyle, style != 0); | - |
1476 | d->createExtra(); | - |
1477 | | - |
1478 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style)) { partially evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style) no Evaluation Count:0 | yes Evaluation Count:55 |
| 0-55 |
1479 | | - |
1480 | | - |
1481 | proxy->ref(); | - |
1482 | d->setStyle_helper(style, false); | - |
1483 | } 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:55 |
partially evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() no Evaluation Count:0 | yes Evaluation Count:55 |
| 0-55 |
1484 | | - |
1485 | d->setStyle_helper(new QStyleSheetStyle(style), true); | - |
1486 | } else | 0 |
1487 | | - |
1488 | d->setStyle_helper(style, false); executed: d->setStyle_helper(style, false); Execution Count:55 | 55 |
1489 | } | - |
1490 | | - |
1491 | void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool | - |
1492 | | - |
1493 | | - |
1494 | | - |
1495 | ) | - |
1496 | { | - |
1497 | QWidget * const q = q_func(); | - |
1498 | QStyle *oldStyle = q->style(); | - |
1499 | | - |
1500 | QPointer<QStyle> origStyle; | - |
1501 | { | - |
1502 | createExtra(); | - |
1503 | | - |
1504 | | - |
1505 | origStyle = extra->style.data(); | - |
1506 | | - |
1507 | extra->style = newStyle; | - |
1508 | } | - |
1509 | | - |
1510 | | - |
1511 | if (q->windowType() != Qt::Desktop) { partially evaluated: q->windowType() != Qt::Desktop yes Evaluation Count:93 | no Evaluation Count:0 |
| 0-93 |
1512 | if (polished) { evaluated: polished yes Evaluation Count:28 | yes Evaluation Count:65 |
| 28-65 |
1513 | oldStyle->unpolish(q); | - |
1514 | | - |
1515 | | - |
1516 | | - |
1517 | | - |
1518 | q->style()->polish(q); | - |
1519 | | - |
1520 | | - |
1521 | | - |
1522 | | - |
1523 | } executed: } Execution Count:28 | 28 |
1524 | } executed: } Execution Count:93 | 93 |
1525 | | - |
1526 | if (propagate) { evaluated: propagate yes Evaluation Count:38 | yes Evaluation Count:55 |
| 38-55 |
1527 | | - |
1528 | const QObjectList childrenList = children; | - |
1529 | for (int i = 0; i < childrenList.size(); ++i) { evaluated: i < childrenList.size() yes Evaluation Count:24 | yes Evaluation Count:38 |
| 24-38 |
1530 | QWidget *c = qobject_cast<QWidget*>(childrenList.at(i)); | - |
1531 | if (c) evaluated: c yes Evaluation Count:21 | yes Evaluation Count:3 |
| 3-21 |
1532 | c->d_func()->inheritStyle(); executed: c->d_func()->inheritStyle(); Execution Count:21 | 21 |
1533 | } executed: } Execution Count:24 | 24 |
1534 | } executed: } Execution Count:38 | 38 |
1535 | | - |
1536 | | - |
1537 | if (!qobject_cast<QStyleSheetStyle*>(newStyle)) { evaluated: !qobject_cast<QStyleSheetStyle*>(newStyle) yes Evaluation Count:56 | yes Evaluation Count:37 |
| 37-56 |
1538 | if (const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data())) { partially evaluated: const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data()) no Evaluation Count:0 | yes Evaluation Count:56 |
| 0-56 |
1539 | cssStyle->clearWidgetFont(q); | - |
1540 | } | 0 |
1541 | } executed: } Execution Count:56 | 56 |
1542 | | - |
1543 | | - |
1544 | QEvent e(QEvent::StyleChange); | - |
1545 | QApplication::sendEvent(q, &e); | - |
1546 | | - |
1547 | | - |
1548 | | - |
1549 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data())) partially evaluated: QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data()) no Evaluation Count:0 | yes Evaluation Count:93 |
| 0-93 |
1550 | proxy->deref(); never executed: proxy->deref(); | 0 |
1551 | | - |
1552 | } executed: } Execution Count:93 | 93 |
1553 | | - |
1554 | | - |
1555 | void QWidgetPrivate::inheritStyle() | - |
1556 | { | - |
1557 | | - |
1558 | QWidget * const q = q_func(); | - |
1559 | | - |
1560 | QStyleSheetStyle *proxy = extra ? qobject_cast<QStyleSheetStyle *>(extra->style) : 0; evaluated: extra yes Evaluation Count:233 | yes Evaluation Count:30595 |
| 233-30595 |
1561 | | - |
1562 | if (!q->styleSheet().isEmpty()) { partially evaluated: !q->styleSheet().isEmpty() no Evaluation Count:0 | yes Evaluation Count:30828 |
| 0-30828 |
1563 | qt_noop(); | - |
1564 | proxy->repolish(q); | - |
1565 | return; | 0 |
1566 | } | - |
1567 | | - |
1568 | QStyle *origStyle = proxy ? proxy->base : (extra ? (QStyle*)extra->style : 0); partially evaluated: proxy no Evaluation Count:0 | yes Evaluation Count:30828 |
| 0-30828 |
1569 | QWidget *parent = q->parentWidget(); | - |
1570 | QStyle *parentStyle = (parent && parent->d_func()->extra) ? (QStyle*)parent->d_func()->extra->style : 0; evaluated: parent yes Evaluation Count:30401 | yes Evaluation Count:427 |
evaluated: parent->d_func()->extra yes Evaluation Count:2502 | yes Evaluation Count:27899 |
| 427-30401 |
1571 | | - |
1572 | | - |
1573 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() || qobject_cast<QStyleSheetStyle *>(parentStyle)) { evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty() yes Evaluation Count:1 | yes Evaluation Count:30827 |
evaluated: qobject_cast<QStyleSheetStyle *>(parentStyle) yes Evaluation Count:24 | yes Evaluation Count:30803 |
| 1-30827 |
1574 | QStyle *newStyle = parentStyle; | - |
1575 | if (q->testAttribute(Qt::WA_SetStyle)) partially evaluated: q->testAttribute(Qt::WA_SetStyle) no Evaluation Count:0 | yes Evaluation Count:25 |
| 0-25 |
1576 | newStyle = new QStyleSheetStyle(origStyle); never executed: newStyle = new QStyleSheetStyle(origStyle); | 0 |
1577 | else if (QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle)) evaluated: QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle) yes Evaluation Count:24 | yes Evaluation Count:1 |
| 1-24 |
1578 | newProxy->ref(); executed: newProxy->ref(); Execution Count:24 | 24 |
1579 | | - |
1580 | setStyle_helper(newStyle, true); | - |
1581 | return; executed: return; Execution Count:25 | 25 |
1582 | } | - |
1583 | | - |
1584 | | - |
1585 | | - |
1586 | if (origStyle == (extra ? (QStyle*)extra->style : 0)) partially evaluated: origStyle == (extra ? (QStyle*)extra->style : 0) yes Evaluation Count:30803 | no Evaluation Count:0 |
evaluated: extra yes Evaluation Count:233 | yes Evaluation Count:30570 |
| 0-30803 |
1587 | return; executed: return; Execution Count:30803 | 30803 |
1588 | | - |
1589 | | - |
1590 | | - |
1591 | | - |
1592 | if (!q->testAttribute(Qt::WA_SetStyle)) never evaluated: !q->testAttribute(Qt::WA_SetStyle) | 0 |
1593 | origStyle = 0; never executed: origStyle = 0; | 0 |
1594 | | - |
1595 | setStyle_helper(origStyle, true); | - |
1596 | | - |
1597 | } | 0 |
1598 | Qt::WindowModality QWidget::windowModality() const | - |
1599 | { | - |
1600 | return static_cast<Qt::WindowModality>(data->window_modality); executed: return static_cast<Qt::WindowModality>(data->window_modality); Execution Count:1643 | 1643 |
1601 | } | - |
1602 | | - |
1603 | void QWidget::setWindowModality(Qt::WindowModality windowModality) | - |
1604 | { | - |
1605 | data->window_modality = windowModality; | - |
1606 | | - |
1607 | setAttribute(Qt::WA_ShowModal, (data->window_modality != Qt::NonModal)); | - |
1608 | setAttribute(Qt::WA_SetWindowModality, true); | - |
1609 | } executed: } Execution Count:1 | 1 |
1610 | bool QWidget::isMinimized() const | - |
1611 | { return data->window_state & Qt::WindowMinimized; } executed: return data->window_state & Qt::WindowMinimized; Execution Count:46943 | 46943 |
1612 | void QWidget::showMinimized() | - |
1613 | { | - |
1614 | bool isMin = isMinimized(); | - |
1615 | if (isMin && isVisible()) evaluated: isMin yes Evaluation Count:2 | yes Evaluation Count:29 |
evaluated: isVisible() yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1-29 |
1616 | return; executed: return; Execution Count:1 | 1 |
1617 | | - |
1618 | ensurePolished(); | - |
1619 | | - |
1620 | if (!isMin) evaluated: !isMin yes Evaluation Count:29 | yes Evaluation Count:1 |
| 1-29 |
1621 | setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); executed: setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); Execution Count:29 | 29 |
1622 | setVisible(true); | - |
1623 | } executed: } Execution Count:30 | 30 |
1624 | bool QWidget::isMaximized() const | - |
1625 | { return data->window_state & Qt::WindowMaximized; } executed: return data->window_state & Qt::WindowMaximized; Execution Count:32813 | 32813 |
1626 | Qt::WindowStates QWidget::windowState() const | - |
1627 | { | - |
1628 | return Qt::WindowStates(data->window_state); executed: return Qt::WindowStates(data->window_state); Execution Count:32670 | 32670 |
1629 | } | - |
1630 | void QWidget::overrideWindowState(Qt::WindowStates newstate) | - |
1631 | { | - |
1632 | QWindowStateChangeEvent e(Qt::WindowStates(data->window_state), true); | - |
1633 | data->window_state = newstate; | - |
1634 | QApplication::sendEvent(this, &e); | - |
1635 | } executed: } Execution Count:2054 | 2054 |
1636 | bool QWidget::isFullScreen() const | - |
1637 | { return data->window_state & Qt::WindowFullScreen; } executed: return data->window_state & Qt::WindowFullScreen; Execution Count:8 | 8 |
1638 | void QWidget::showFullScreen() | - |
1639 | { | - |
1640 | ensurePolished(); | - |
1641 | | - |
1642 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized)) | - |
1643 | | Qt::WindowFullScreen); | - |
1644 | setVisible(true); | - |
1645 | activateWindow(); | - |
1646 | } executed: } Execution Count:5 | 5 |
1647 | void QWidget::showMaximized() | - |
1648 | { | - |
1649 | ensurePolished(); | - |
1650 | | - |
1651 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | - |
1652 | | Qt::WindowMaximized); | - |
1653 | setVisible(true); | - |
1654 | } executed: } Execution Count:67 | 67 |
1655 | void QWidget::showNormal() | - |
1656 | { | - |
1657 | ensurePolished(); | - |
1658 | | - |
1659 | setWindowState(windowState() & ~(Qt::WindowMinimized | - |
1660 | | Qt::WindowMaximized | - |
1661 | | Qt::WindowFullScreen)); | - |
1662 | setVisible(true); | - |
1663 | } executed: } Execution Count:67 | 67 |
1664 | bool QWidget::isEnabledTo(const QWidget *ancestor) const | - |
1665 | { | - |
1666 | const QWidget * w = this; | - |
1667 | while (!w->testAttribute(Qt::WA_ForceDisabled) never evaluated: !w->testAttribute(Qt::WA_ForceDisabled) | 0 |
1668 | && !w->isWindow() never evaluated: !w->isWindow() | 0 |
1669 | && w->parentWidget() never evaluated: w->parentWidget() | 0 |
1670 | && w->parentWidget() != ancestor) never evaluated: w->parentWidget() != ancestor | 0 |
1671 | w = w->parentWidget(); never executed: w = w->parentWidget(); | 0 |
1672 | return !w->testAttribute(Qt::WA_ForceDisabled); never executed: return !w->testAttribute(Qt::WA_ForceDisabled); | 0 |
1673 | } | - |
1674 | void QWidget::addAction(QAction *action) | - |
1675 | { | - |
1676 | insertAction(0, action); | - |
1677 | } executed: } Execution Count:2402 | 2402 |
1678 | | - |
1679 | | - |
1680 | | - |
1681 | | - |
1682 | | - |
1683 | | - |
1684 | void QWidget::addActions(QList<QAction*> actions) | - |
1685 | { | - |
1686 | for(int i = 0; i < actions.count(); i++) evaluated: i < actions.count() yes Evaluation Count:1172 | yes Evaluation Count:184 |
| 184-1172 |
1687 | insertAction(0, actions.at(i)); executed: insertAction(0, actions.at(i)); Execution Count:1172 | 1172 |
1688 | } executed: } Execution Count:184 | 184 |
1689 | void QWidget::insertAction(QAction *before, QAction *action) | - |
1690 | { | - |
1691 | if(!action) { partially evaluated: !action no Evaluation Count:0 | yes Evaluation Count:3574 |
| 0-3574 |
1692 | QMessageLogger("kernel/qwidget.cpp", 2937, __PRETTY_FUNCTION__).warning("QWidget::insertAction: Attempt to insert null action"); | - |
1693 | return; | 0 |
1694 | } | - |
1695 | | - |
1696 | QWidgetPrivate * const d = d_func(); | - |
1697 | if(d->actions.contains(action)) partially evaluated: d->actions.contains(action) no Evaluation Count:0 | yes Evaluation Count:3574 |
| 0-3574 |
1698 | removeAction(action); never executed: removeAction(action); | 0 |
1699 | | - |
1700 | int pos = d->actions.indexOf(before); | - |
1701 | if (pos < 0) { partially evaluated: pos < 0 yes Evaluation Count:3574 | no Evaluation Count:0 |
| 0-3574 |
1702 | before = 0; | - |
1703 | pos = d->actions.size(); | - |
1704 | } executed: } Execution Count:3574 | 3574 |
1705 | d->actions.insert(pos, action); | - |
1706 | | - |
1707 | QActionPrivate *apriv = action->d_func(); | - |
1708 | apriv->widgets.append(this); | - |
1709 | | - |
1710 | QActionEvent e(QEvent::ActionAdded, action, before); | - |
1711 | QApplication::sendEvent(this, &e); | - |
1712 | } executed: } Execution Count:3574 | 3574 |
1713 | void QWidget::insertActions(QAction *before, QList<QAction*> actions) | - |
1714 | { | - |
1715 | for(int i = 0; i < actions.count(); ++i) never evaluated: i < actions.count() | 0 |
1716 | insertAction(before, actions.at(i)); never executed: insertAction(before, actions.at(i)); | 0 |
1717 | } | 0 |
1718 | | - |
1719 | | - |
1720 | | - |
1721 | | - |
1722 | | - |
1723 | void QWidget::removeAction(QAction *action) | - |
1724 | { | - |
1725 | if (!action) partially evaluated: !action no Evaluation Count:0 | yes Evaluation Count:369 |
| 0-369 |
1726 | return; | 0 |
1727 | | - |
1728 | QWidgetPrivate * const d = d_func(); | - |
1729 | | - |
1730 | QActionPrivate *apriv = action->d_func(); | - |
1731 | apriv->widgets.removeAll(this); | - |
1732 | | - |
1733 | if (d->actions.removeAll(action)) { evaluated: d->actions.removeAll(action) yes Evaluation Count:360 | yes Evaluation Count:9 |
| 9-360 |
1734 | QActionEvent e(QEvent::ActionRemoved, action); | - |
1735 | QApplication::sendEvent(this, &e); | - |
1736 | } executed: } Execution Count:360 | 360 |
1737 | } executed: } Execution Count:369 | 369 |
1738 | | - |
1739 | | - |
1740 | | - |
1741 | | - |
1742 | | - |
1743 | | - |
1744 | QList<QAction*> QWidget::actions() const | - |
1745 | { | - |
1746 | const QWidgetPrivate * const d = d_func(); | - |
1747 | return d->actions; executed: return d->actions; Execution Count:637 | 637 |
1748 | } | - |
1749 | void QWidget::setEnabled(bool enable) | - |
1750 | { | - |
1751 | QWidgetPrivate * const d = d_func(); | - |
1752 | setAttribute(Qt::WA_ForceDisabled, !enable); | - |
1753 | d->setEnabled_helper(enable); | - |
1754 | } executed: } Execution Count:6266 | 6266 |
1755 | | - |
1756 | void QWidgetPrivate::setEnabled_helper(bool enable) | - |
1757 | { | - |
1758 | QWidget * const q = q_func(); | - |
1759 | | - |
1760 | if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->isEnabled()) evaluated: enable yes Evaluation Count:33345 | yes Evaluation Count:2920 |
evaluated: !q->isWindow() yes Evaluation Count:33265 | yes Evaluation Count:80 |
partially evaluated: q->parentWidget() yes Evaluation Count:33265 | no Evaluation Count:0 |
evaluated: !q->parentWidget()->isEnabled() yes Evaluation Count:1 | yes Evaluation Count:33264 |
| 0-33345 |
1761 | return; executed: return; Execution Count:1 | 1 |
1762 | | - |
1763 | if (enable != q->testAttribute(Qt::WA_Disabled)) evaluated: enable != q->testAttribute(Qt::WA_Disabled) yes Evaluation Count:33909 | yes Evaluation Count:2355 |
| 2355-33909 |
1764 | return; executed: return; Execution Count:33909 | 33909 |
1765 | | - |
1766 | q->setAttribute(Qt::WA_Disabled, !enable); | - |
1767 | updateSystemBackground(); | - |
1768 | | - |
1769 | if (!enable && q->window()->focusWidget() == q) { evaluated: !enable yes Evaluation Count:1468 | yes Evaluation Count:887 |
evaluated: q->window()->focusWidget() == q yes Evaluation Count:89 | yes Evaluation Count:1379 |
| 89-1468 |
1770 | bool parentIsEnabled = (!q->parentWidget() || q->parentWidget()->isEnabled()); partially evaluated: !q->parentWidget() no Evaluation Count:0 | yes Evaluation Count:89 |
evaluated: q->parentWidget()->isEnabled() yes Evaluation Count:88 | yes Evaluation Count:1 |
| 0-89 |
1771 | if (!parentIsEnabled || !q->focusNextChild()) evaluated: !parentIsEnabled yes Evaluation Count:1 | yes Evaluation Count:88 |
partially evaluated: !q->focusNextChild() yes Evaluation Count:88 | no Evaluation Count:0 |
| 0-88 |
1772 | q->clearFocus(); executed: q->clearFocus(); Execution Count:89 | 89 |
1773 | } executed: } Execution Count:89 | 89 |
1774 | | - |
1775 | Qt::WidgetAttribute attribute = enable ? Qt::WA_ForceDisabled : Qt::WA_Disabled; evaluated: enable yes Evaluation Count:887 | yes Evaluation Count:1468 |
| 887-1468 |
1776 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:358 | yes Evaluation Count:2355 |
| 358-2355 |
1777 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
1778 | if (w && !w->testAttribute(attribute)) evaluated: w yes Evaluation Count:206 | yes Evaluation Count:152 |
evaluated: !w->testAttribute(attribute) yes Evaluation Count:194 | yes Evaluation Count:12 |
| 12-206 |
1779 | w->d_func()->setEnabled_helper(enable); executed: w->d_func()->setEnabled_helper(enable); Execution Count:194 | 194 |
1780 | } executed: } Execution Count:358 | 358 |
1781 | if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { evaluated: q->testAttribute(Qt::WA_SetCursor) yes Evaluation Count:13 | yes Evaluation Count:2342 |
evaluated: q->isWindow() yes Evaluation Count:57 | yes Evaluation Count:2285 |
| 13-2342 |
1782 | | - |
1783 | | - |
1784 | qt_qpa_set_cursor(q, false); | - |
1785 | } executed: } Execution Count:70 | 70 |
1786 | | - |
1787 | | - |
1788 | | - |
1789 | | - |
1790 | | - |
1791 | if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { evaluated: q->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:32 | yes Evaluation Count:2323 |
partially evaluated: q->hasFocus() no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-2323 |
1792 | QWidget *focusWidget = effectiveFocusWidget(); | - |
1793 | | - |
1794 | if (enable) { | 0 |
1795 | if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) never evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) | 0 |
1796 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | 0 |
1797 | } else { | 0 |
1798 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
1799 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
1800 | } | 0 |
1801 | } | - |
1802 | | - |
1803 | QEvent e(QEvent::EnabledChange); | - |
1804 | QApplication::sendEvent(q, &e); | - |
1805 | } executed: } Execution Count:2355 | 2355 |
1806 | bool QWidget::acceptDrops() const | - |
1807 | { | - |
1808 | return testAttribute(Qt::WA_AcceptDrops); executed: return testAttribute(Qt::WA_AcceptDrops); Execution Count:1002 | 1002 |
1809 | } | - |
1810 | | - |
1811 | void QWidget::setAcceptDrops(bool on) | - |
1812 | { | - |
1813 | setAttribute(Qt::WA_AcceptDrops, on); | - |
1814 | | - |
1815 | } executed: } Execution Count:3488 | 3488 |
1816 | void QWidget::setDisabled(bool disable) | - |
1817 | { | - |
1818 | setEnabled(!disable); | - |
1819 | } executed: } Execution Count:14 | 14 |
1820 | QRect QWidget::frameGeometry() const | - |
1821 | { | - |
1822 | const QWidgetPrivate * const d = d_func(); | - |
1823 | if (isWindow() && ! (windowType() == Qt::Popup)) { evaluated: isWindow() yes Evaluation Count:1145 | yes Evaluation Count:26 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:455 | yes Evaluation Count:690 |
| 26-1145 |
1824 | QRect fs = d->frameStrut(); | - |
1825 | return QRect(data->crect.x() - fs.left(), | 455 |
1826 | data->crect.y() - fs.top(), | 455 |
1827 | data->crect.width() + fs.left() + fs.right(), | 455 |
1828 | 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:455 | 455 |
1829 | } | - |
1830 | return data->crect; executed: return data->crect; Execution Count:716 | 716 |
1831 | } | - |
1832 | int QWidget::x() const | - |
1833 | { | - |
1834 | const QWidgetPrivate * const d = d_func(); | - |
1835 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:814 | yes Evaluation Count:21807 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:806 | yes Evaluation Count:8 |
| 8-21807 |
1836 | return data->crect.x() - d->frameStrut().left(); executed: return data->crect.x() - d->frameStrut().left(); Execution Count:806 | 806 |
1837 | return data->crect.x(); executed: return data->crect.x(); Execution Count:21815 | 21815 |
1838 | } | - |
1839 | int QWidget::y() const | - |
1840 | { | - |
1841 | const QWidgetPrivate * const d = d_func(); | - |
1842 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:807 | yes Evaluation Count:21748 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:805 | yes Evaluation Count:2 |
| 2-21748 |
1843 | return data->crect.y() - d->frameStrut().top(); executed: return data->crect.y() - d->frameStrut().top(); Execution Count:805 | 805 |
1844 | return data->crect.y(); executed: return data->crect.y(); Execution Count:21750 | 21750 |
1845 | } | - |
1846 | QPoint QWidget::pos() const | - |
1847 | { | - |
1848 | const QWidgetPrivate * const d = d_func(); | - |
1849 | QPoint result = data->crect.topLeft(); | - |
1850 | if (isWindow() && ! (windowType() == Qt::Popup)) evaluated: isWindow() yes Evaluation Count:3516 | yes Evaluation Count:9675 |
evaluated: ! (windowType() == Qt::Popup) yes Evaluation Count:3424 | yes Evaluation Count:92 |
| 92-9675 |
1851 | if (!d->maybeTopData() || !d->maybeTopData()->posIncludesFrame) evaluated: !d->maybeTopData() yes Evaluation Count:459 | yes Evaluation Count:2965 |
evaluated: !d->maybeTopData()->posIncludesFrame yes Evaluation Count:2648 | yes Evaluation Count:317 |
| 317-2965 |
1852 | result -= d->frameStrut().topLeft(); executed: result -= d->frameStrut().topLeft(); Execution Count:3107 | 3107 |
1853 | return result; executed: return result; Execution Count:13191 | 13191 |
1854 | } | - |
1855 | QRect QWidget::normalGeometry() const | - |
1856 | { | - |
1857 | const QWidgetPrivate * const d = d_func(); | - |
1858 | if (!d->extra || !d->extra->topextra) never evaluated: !d->extra never evaluated: !d->extra->topextra | 0 |
1859 | return QRect(); never executed: return QRect(); | 0 |
1860 | | - |
1861 | if (!isMaximized() && !isFullScreen()) never evaluated: !isMaximized() never evaluated: !isFullScreen() | 0 |
1862 | return geometry(); never executed: return geometry(); | 0 |
1863 | | - |
1864 | return d->topData()->normalGeometry; never executed: return d->topData()->normalGeometry; | 0 |
1865 | } | - |
1866 | QRect QWidget::childrenRect() const | - |
1867 | { | - |
1868 | const QWidgetPrivate * const d = d_func(); | - |
1869 | QRect r(0, 0, 0, 0); | - |
1870 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:418 | yes Evaluation Count:682 |
| 418-682 |
1871 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
1872 | if (w && !w->isWindow() && !w->isHidden()) evaluated: w yes Evaluation Count:414 | yes Evaluation Count:4 |
evaluated: !w->isWindow() yes Evaluation Count:409 | yes Evaluation Count:5 |
partially evaluated: !w->isHidden() yes Evaluation Count:409 | no Evaluation Count:0 |
| 0-414 |
1873 | r |= w->geometry(); executed: r |= w->geometry(); Execution Count:409 | 409 |
1874 | } executed: } Execution Count:418 | 418 |
1875 | return r; executed: return r; Execution Count:682 | 682 |
1876 | } | - |
1877 | QRegion QWidget::childrenRegion() const | - |
1878 | { | - |
1879 | const QWidgetPrivate * const d = d_func(); | - |
1880 | QRegion r; | - |
1881 | for (int i = 0; i < d->children.size(); ++i) { never evaluated: i < d->children.size() | 0 |
1882 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
1883 | if (w && !w->isWindow() && !w->isHidden()) { never evaluated: !w->isWindow() never evaluated: !w->isHidden() | 0 |
1884 | QRegion mask = w->mask(); | - |
1885 | if (mask.isEmpty()) never evaluated: mask.isEmpty() | 0 |
1886 | r |= w->geometry(); never executed: r |= w->geometry(); | 0 |
1887 | else | - |
1888 | r |= mask.translated(w->pos()); never executed: r |= mask.translated(w->pos()); | 0 |
1889 | } | - |
1890 | } | 0 |
1891 | return r; never executed: return r; | 0 |
1892 | } | - |
1893 | QSize QWidget::minimumSize() const | - |
1894 | { | - |
1895 | const QWidgetPrivate * const d = d_func(); | - |
1896 | 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:67878 | 67878 |
1897 | } | - |
1898 | QSize QWidget::maximumSize() const | - |
1899 | { | - |
1900 | const QWidgetPrivate * const d = d_func(); | - |
1901 | return d->extra ? QSize(d->extra->maxw, d->extra->maxh) | 68271 |
1902 | : 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:68271 | 68271 |
1903 | } | - |
1904 | QSize QWidget::sizeIncrement() const | - |
1905 | { | - |
1906 | const QWidgetPrivate * const d = d_func(); | - |
1907 | return (d->extra && d->extra->topextra) | 0 |
1908 | ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) | 0 |
1909 | : QSize(0, 0); never executed: return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0); | 0 |
1910 | } | - |
1911 | QSize QWidget::baseSize() const | - |
1912 | { | - |
1913 | const QWidgetPrivate * const d = d_func(); | - |
1914 | return (d->extra != 0 && d->extra->topextra != 0) | 0 |
1915 | ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) | 0 |
1916 | : 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 |
1917 | } | - |
1918 | | - |
1919 | bool QWidgetPrivate::setMinimumSize_helper(int &minw, int &minh) | - |
1920 | { | - |
1921 | QWidget * const q = q_func(); | - |
1922 | | - |
1923 | int mw = minw, mh = minh; | - |
1924 | if (mw == ((1<<24)-1)) evaluated: mw == ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:7246 |
| 2-7246 |
1925 | mw = 0; executed: mw = 0; Execution Count:2 | 2 |
1926 | if (mh == ((1<<24)-1)) evaluated: mh == ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:7247 |
| 1-7247 |
1927 | mh = 0; executed: mh = 0; Execution Count:1 | 1 |
1928 | if (minw > ((1<<24)-1) || minh > ((1<<24)-1)) { evaluated: minw > ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:7246 |
evaluated: minh > ((1<<24)-1) yes Evaluation Count:2 | yes Evaluation Count:7244 |
| 2-7246 |
1929 | QMessageLogger("kernel/qwidget.cpp", 3578, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) " | - |
1930 | "The largest allowed size is (%d,%d)", | - |
1931 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - |
1932 | ((1<<24)-1)); | - |
1933 | minw = mw = qMin<int>(minw, ((1<<24)-1)); | - |
1934 | minh = mh = qMin<int>(minh, ((1<<24)-1)); | - |
1935 | } executed: } Execution Count:4 | 4 |
1936 | if (minw < 0 || minh < 0) { evaluated: minw < 0 yes Evaluation Count:2 | yes Evaluation Count:7246 |
evaluated: minh < 0 yes Evaluation Count:2 | yes Evaluation Count:7244 |
| 2-7246 |
1937 | QMessageLogger("kernel/qwidget.cpp", 3586, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) Negative sizes (%d,%d) " | - |
1938 | "are not possible", | - |
1939 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), minw, minh); | - |
1940 | minw = mw = qMax(minw, 0); | - |
1941 | minh = mh = qMax(minh, 0); | - |
1942 | } executed: } Execution Count:4 | 4 |
1943 | createExtra(); | - |
1944 | if (extra->minw == mw && extra->minh == mh) evaluated: extra->minw == mw yes Evaluation Count:2953 | yes Evaluation Count:4295 |
evaluated: extra->minh == mh yes Evaluation Count:2725 | yes Evaluation Count:228 |
| 228-4295 |
1945 | return false; executed: return false; Execution Count:2725 | 2725 |
1946 | extra->minw = mw; | - |
1947 | extra->minh = mh; | - |
1948 | extra->explicitMinSize = (mw ? Qt::Horizontal : 0) | (mh ? Qt::Vertical : 0); evaluated: mw yes Evaluation Count:3672 | yes Evaluation Count:851 |
| 851-3672 |
1949 | return true; executed: return true; Execution Count:4523 | 4523 |
1950 | } | - |
1951 | void QWidget::setMinimumSize(int minw, int minh) | - |
1952 | { | - |
1953 | QWidgetPrivate * const d = d_func(); | - |
1954 | if (!d->setMinimumSize_helper(minw, minh)) evaluated: !d->setMinimumSize_helper(minw, minh) yes Evaluation Count:2612 | yes Evaluation Count:2813 |
| 2612-2813 |
1955 | return; executed: return; Execution Count:2612 | 2612 |
1956 | | - |
1957 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:648 | yes Evaluation Count:2165 |
| 648-2165 |
1958 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:648 | 648 |
1959 | if (minw > width() || minh > height()) { evaluated: minw > width() yes Evaluation Count:58 | yes Evaluation Count:2755 |
evaluated: minh > height() yes Evaluation Count:41 | yes Evaluation Count:2714 |
| 41-2755 |
1960 | bool resized = testAttribute(Qt::WA_Resized); | - |
1961 | bool maximized = isMaximized(); | - |
1962 | resize(qMax(minw,width()), qMax(minh,height())); | - |
1963 | setAttribute(Qt::WA_Resized, resized); | - |
1964 | if (maximized) partially evaluated: maximized no Evaluation Count:0 | yes Evaluation Count:99 |
| 0-99 |
1965 | data->window_state = data->window_state | Qt::WindowMaximized; never executed: data->window_state = data->window_state | Qt::WindowMaximized; | 0 |
1966 | } executed: } Execution Count:99 | 99 |
1967 | | - |
1968 | if (d->extra) { partially evaluated: d->extra yes Evaluation Count:2813 | no Evaluation Count:0 |
| 0-2813 |
1969 | if (d->extra->proxyWidget) partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:2813 |
| 0-2813 |
1970 | d->extra->proxyWidget->setMinimumSize(minw, minh); never executed: d->extra->proxyWidget->setMinimumSize(minw, minh); | 0 |
1971 | } executed: } Execution Count:2813 | 2813 |
1972 | | - |
1973 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - |
1974 | } executed: } Execution Count:2813 | 2813 |
1975 | | - |
1976 | bool QWidgetPrivate::setMaximumSize_helper(int &maxw, int &maxh) | - |
1977 | { | - |
1978 | QWidget * const q = q_func(); | - |
1979 | if (maxw > ((1<<24)-1) || maxh > ((1<<24)-1)) { evaluated: maxw > ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:3775 |
evaluated: maxh > ((1<<24)-1) yes Evaluation Count:1 | yes Evaluation Count:3774 |
| 1-3775 |
1980 | QMessageLogger("kernel/qwidget.cpp", 3638, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) " | - |
1981 | "The largest allowed size is (%d,%d)", | - |
1982 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - |
1983 | ((1<<24)-1)); | - |
1984 | maxw = qMin<int>(maxw, ((1<<24)-1)); | - |
1985 | maxh = qMin<int>(maxh, ((1<<24)-1)); | - |
1986 | } executed: } Execution Count:2 | 2 |
1987 | if (maxw < 0 || maxh < 0) { evaluated: maxw < 0 yes Evaluation Count:1 | yes Evaluation Count:3775 |
evaluated: maxh < 0 yes Evaluation Count:1 | yes Evaluation Count:3774 |
| 1-3775 |
1988 | QMessageLogger("kernel/qwidget.cpp", 3646, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) Negative sizes (%d,%d) " | - |
1989 | "are not possible", | - |
1990 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), maxw, maxh); | - |
1991 | maxw = qMax(maxw, 0); | - |
1992 | maxh = qMax(maxh, 0); | - |
1993 | } executed: } Execution Count:2 | 2 |
1994 | createExtra(); | - |
1995 | if (extra->maxw == maxw && extra->maxh == maxh) evaluated: extra->maxw == maxw yes Evaluation Count:1314 | yes Evaluation Count:2462 |
evaluated: extra->maxh == maxh yes Evaluation Count:1174 | yes Evaluation Count:140 |
| 140-2462 |
1996 | return false; executed: return false; Execution Count:1174 | 1174 |
1997 | extra->maxw = maxw; | - |
1998 | extra->maxh = maxh; | - |
1999 | extra->explicitMaxSize = (maxw != ((1<<24)-1) ? Qt::Horizontal : 0) | evaluated: maxw != ((1<<24)-1) yes Evaluation Count:2527 | yes Evaluation Count:75 |
| 75-2527 |
2000 | (maxh != ((1<<24)-1) ? Qt::Vertical : 0); | - |
2001 | return true; executed: return true; Execution Count:2602 | 2602 |
2002 | } | - |
2003 | void QWidget::setMaximumSize(int maxw, int maxh) | - |
2004 | { | - |
2005 | QWidgetPrivate * const d = d_func(); | - |
2006 | if (!d->setMaximumSize_helper(maxw, maxh)) evaluated: !d->setMaximumSize_helper(maxw, maxh) yes Evaluation Count:1061 | yes Evaluation Count:892 |
| 892-1061 |
2007 | return; executed: return; Execution Count:1061 | 1061 |
2008 | | - |
2009 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:193 | yes Evaluation Count:699 |
| 193-699 |
2010 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:193 | 193 |
2011 | if (maxw < width() || maxh < height()) { evaluated: maxw < width() yes Evaluation Count:41 | yes Evaluation Count:851 |
evaluated: maxh < height() yes Evaluation Count:74 | yes Evaluation Count:777 |
| 41-851 |
2012 | bool resized = testAttribute(Qt::WA_Resized); | - |
2013 | resize(qMin(maxw,width()), qMin(maxh,height())); | - |
2014 | setAttribute(Qt::WA_Resized, resized); | - |
2015 | } executed: } Execution Count:115 | 115 |
2016 | | - |
2017 | | - |
2018 | if (d->extra) { partially evaluated: d->extra yes Evaluation Count:892 | no Evaluation Count:0 |
| 0-892 |
2019 | if (d->extra->proxyWidget) partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:892 |
| 0-892 |
2020 | d->extra->proxyWidget->setMaximumSize(maxw, maxh); never executed: d->extra->proxyWidget->setMaximumSize(maxw, maxh); | 0 |
2021 | } executed: } Execution Count:892 | 892 |
2022 | | - |
2023 | | - |
2024 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - |
2025 | } executed: } Execution Count:892 | 892 |
2026 | | - |
2027 | | - |
2028 | | - |
2029 | | - |
2030 | | - |
2031 | | - |
2032 | | - |
2033 | void QWidget::setSizeIncrement(int w, int h) | - |
2034 | { | - |
2035 | QWidgetPrivate * const d = d_func(); | - |
2036 | d->createTLExtra(); | - |
2037 | QTLWExtra* x = d->topData(); | - |
2038 | if (x->incw == w && x->inch == h) never evaluated: x->incw == w never evaluated: x->inch == h | 0 |
2039 | return; | 0 |
2040 | x->incw = w; | - |
2041 | x->inch = h; | - |
2042 | if (isWindow()) never evaluated: isWindow() | 0 |
2043 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 |
2044 | } | 0 |
2045 | | - |
2046 | | - |
2047 | | - |
2048 | | - |
2049 | | - |
2050 | | - |
2051 | | - |
2052 | void QWidget::setBaseSize(int basew, int baseh) | - |
2053 | { | - |
2054 | QWidgetPrivate * const d = d_func(); | - |
2055 | d->createTLExtra(); | - |
2056 | QTLWExtra* x = d->topData(); | - |
2057 | if (x->basew == basew && x->baseh == baseh) never evaluated: x->basew == basew never evaluated: x->baseh == baseh | 0 |
2058 | return; | 0 |
2059 | x->basew = basew; | - |
2060 | x->baseh = baseh; | - |
2061 | if (isWindow()) never evaluated: isWindow() | 0 |
2062 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 |
2063 | } | 0 |
2064 | void QWidget::setFixedSize(const QSize & s) | - |
2065 | { | - |
2066 | setFixedSize(s.width(), s.height()); | - |
2067 | } executed: } Execution Count:890 | 890 |
2068 | void QWidget::setFixedSize(int w, int h) | - |
2069 | { | - |
2070 | QWidgetPrivate * const d = d_func(); | - |
2071 | bool minSizeSet = d->setMinimumSize_helper(w, h); | - |
2072 | bool maxSizeSet = d->setMaximumSize_helper(w, h); | - |
2073 | if (!minSizeSet && !maxSizeSet) evaluated: !minSizeSet yes Evaluation Count:113 | yes Evaluation Count:1710 |
partially evaluated: !maxSizeSet yes Evaluation Count:113 | no Evaluation Count:0 |
| 0-1710 |
2074 | return; executed: return; Execution Count:113 | 113 |
2075 | | - |
2076 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:980 | yes Evaluation Count:730 |
| 730-980 |
2077 | d->setConstraints_sys(); executed: d->setConstraints_sys(); Execution Count:980 | 980 |
2078 | else | - |
2079 | d->updateGeometry_helper(true); executed: d->updateGeometry_helper(true); Execution Count:730 | 730 |
2080 | | - |
2081 | if (w != ((1<<24)-1) || h != ((1<<24)-1)) partially evaluated: w != ((1<<24)-1) yes Evaluation Count:1710 | no Evaluation Count:0 |
never evaluated: h != ((1<<24)-1) | 0-1710 |
2082 | resize(w, h); executed: resize(w, h); Execution Count:1710 | 1710 |
2083 | } executed: } Execution Count:1710 | 1710 |
2084 | | - |
2085 | void QWidget::setMinimumWidth(int w) | - |
2086 | { | - |
2087 | QWidgetPrivate * const d = d_func(); | - |
2088 | d->createExtra(); | - |
2089 | uint expl = d->extra->explicitMinSize | (w ? Qt::Horizontal : 0); | - |
2090 | setMinimumSize(w, minimumSize().height()); | - |
2091 | d->extra->explicitMinSize = expl; | - |
2092 | } executed: } Execution Count:1685 | 1685 |
2093 | | - |
2094 | void QWidget::setMinimumHeight(int h) | - |
2095 | { | - |
2096 | QWidgetPrivate * const d = d_func(); | - |
2097 | d->createExtra(); | - |
2098 | uint expl = d->extra->explicitMinSize | (h ? Qt::Vertical : 0); | - |
2099 | setMinimumSize(minimumSize().width(), h); | - |
2100 | d->extra->explicitMinSize = expl; | - |
2101 | } executed: } Execution Count:478 | 478 |
2102 | | - |
2103 | void QWidget::setMaximumWidth(int w) | - |
2104 | { | - |
2105 | QWidgetPrivate * const d = d_func(); | - |
2106 | d->createExtra(); | - |
2107 | uint expl = d->extra->explicitMaxSize | (w == ((1<<24)-1) ? 0 : Qt::Horizontal); | - |
2108 | setMaximumSize(w, maximumSize().height()); | - |
2109 | d->extra->explicitMaxSize = expl; | - |
2110 | } executed: } Execution Count:501 | 501 |
2111 | | - |
2112 | void QWidget::setMaximumHeight(int h) | - |
2113 | { | - |
2114 | QWidgetPrivate * const d = d_func(); | - |
2115 | d->createExtra(); | - |
2116 | uint expl = d->extra->explicitMaxSize | (h == ((1<<24)-1) ? 0 : Qt::Vertical); | - |
2117 | setMaximumSize(maximumSize().width(), h); | - |
2118 | d->extra->explicitMaxSize = expl; | - |
2119 | } executed: } Execution Count:448 | 448 |
2120 | void QWidget::setFixedWidth(int w) | - |
2121 | { | - |
2122 | QWidgetPrivate * const d = d_func(); | - |
2123 | d->createExtra(); | - |
2124 | uint explMin = d->extra->explicitMinSize | Qt::Horizontal; | - |
2125 | uint explMax = d->extra->explicitMaxSize | Qt::Horizontal; | - |
2126 | setMinimumSize(w, minimumSize().height()); | - |
2127 | setMaximumSize(w, maximumSize().height()); | - |
2128 | d->extra->explicitMinSize = explMin; | - |
2129 | d->extra->explicitMaxSize = explMax; | - |
2130 | } executed: } Execution Count:6 | 6 |
2131 | void QWidget::setFixedHeight(int h) | - |
2132 | { | - |
2133 | QWidgetPrivate * const d = d_func(); | - |
2134 | d->createExtra(); | - |
2135 | uint explMin = d->extra->explicitMinSize | Qt::Vertical; | - |
2136 | uint explMax = d->extra->explicitMaxSize | Qt::Vertical; | - |
2137 | setMinimumSize(minimumSize().width(), h); | - |
2138 | setMaximumSize(maximumSize().width(), h); | - |
2139 | d->extra->explicitMinSize = explMin; | - |
2140 | d->extra->explicitMaxSize = explMax; | - |
2141 | } executed: } Execution Count:83 | 83 |
2142 | QPoint QWidget::mapTo(const QWidget * parent, const QPoint & pos) const | - |
2143 | { | - |
2144 | QPoint p = pos; | - |
2145 | if (parent) { partially evaluated: parent yes Evaluation Count:75191 | no Evaluation Count:0 |
| 0-75191 |
2146 | const QWidget * w = this; | - |
2147 | while (w != parent) { evaluated: w != parent yes Evaluation Count:96296 | yes Evaluation Count:75191 |
| 75191-96296 |
2148 | qt_noop(); | - |
2149 | | - |
2150 | p = w->mapToParent(p); | - |
2151 | w = w->parentWidget(); | - |
2152 | } executed: } Execution Count:96296 | 96296 |
2153 | } executed: } Execution Count:75191 | 75191 |
2154 | return p; executed: return p; Execution Count:75191 | 75191 |
2155 | } | - |
2156 | QPoint QWidget::mapFrom(const QWidget * parent, const QPoint & pos) const | - |
2157 | { | - |
2158 | QPoint p(pos); | - |
2159 | if (parent) { partially evaluated: parent yes Evaluation Count:348 | no Evaluation Count:0 |
| 0-348 |
2160 | const QWidget * w = this; | - |
2161 | while (w != parent) { evaluated: w != parent yes Evaluation Count:475 | yes Evaluation Count:348 |
| 348-475 |
2162 | qt_noop(); | - |
2163 | | - |
2164 | | - |
2165 | p = w->mapFromParent(p); | - |
2166 | w = w->parentWidget(); | - |
2167 | } executed: } Execution Count:475 | 475 |
2168 | } executed: } Execution Count:348 | 348 |
2169 | return p; executed: return p; Execution Count:348 | 348 |
2170 | } | - |
2171 | QPoint QWidget::mapToParent(const QPoint &pos) const | - |
2172 | { | - |
2173 | return pos + data->crect.topLeft(); executed: return pos + data->crect.topLeft(); Execution Count:96656 | 96656 |
2174 | } | - |
2175 | QPoint QWidget::mapFromParent(const QPoint &pos) const | - |
2176 | { | - |
2177 | return pos - data->crect.topLeft(); executed: return pos - data->crect.topLeft(); Execution Count:476 | 476 |
2178 | } | - |
2179 | QWidget *QWidget::window() const | - |
2180 | { | - |
2181 | QWidget *w = (QWidget *)this; | - |
2182 | QWidget *p = w->parentWidget(); | - |
2183 | while (!w->isWindow() && p) { evaluated: !w->isWindow() yes Evaluation Count:1807506 | yes Evaluation Count:1494151 |
evaluated: p yes Evaluation Count:1752827 | yes Evaluation Count:54679 |
| 54679-1807506 |
2184 | w = p; | - |
2185 | p = p->parentWidget(); | - |
2186 | } executed: } Execution Count:1752827 | 1752827 |
2187 | return w; executed: return w; Execution Count:1548830 | 1548830 |
2188 | } | - |
2189 | QWidget *QWidget::nativeParentWidget() const | - |
2190 | { | - |
2191 | QWidget *parent = parentWidget(); | - |
2192 | while (parent && !parent->internalWinId()) evaluated: parent yes Evaluation Count:12671 | yes Evaluation Count:1511 |
evaluated: !parent->internalWinId() yes Evaluation Count:5119 | yes Evaluation Count:7552 |
| 1511-12671 |
2193 | parent = parent->parentWidget(); executed: parent = parent->parentWidget(); Execution Count:5119 | 5119 |
2194 | return parent; executed: return parent; Execution Count:9063 | 9063 |
2195 | } | - |
2196 | QPalette::ColorRole QWidget::backgroundRole() const | - |
2197 | { | - |
2198 | | - |
2199 | const QWidget *w = this; | - |
2200 | do { | - |
2201 | QPalette::ColorRole role = w->d_func()->bg_role; | - |
2202 | if (role != QPalette::NoRole) evaluated: role != QPalette::NoRole yes Evaluation Count:29946 | yes Evaluation Count:24759 |
| 24759-29946 |
2203 | return role; executed: return role; Execution Count:29946 | 29946 |
2204 | if (w->isWindow() || w->windowType() == Qt::SubWindow) evaluated: w->isWindow() yes Evaluation Count:14031 | yes Evaluation Count:10728 |
partially evaluated: w->windowType() == Qt::SubWindow no Evaluation Count:0 | yes Evaluation Count:10728 |
| 0-14031 |
2205 | break; executed: break; Execution Count:14031 | 14031 |
2206 | w = w->parentWidget(); | - |
2207 | } while (w); partially evaluated: w yes Evaluation Count:10728 | no Evaluation Count:0 |
executed: } Execution Count:10728 | 0-10728 |
2208 | return QPalette::Window; executed: return QPalette::Window; Execution Count:14031 | 14031 |
2209 | } | - |
2210 | void QWidget::setBackgroundRole(QPalette::ColorRole role) | - |
2211 | { | - |
2212 | QWidgetPrivate * const d = d_func(); | - |
2213 | d->bg_role = role; | - |
2214 | d->updateSystemBackground(); | - |
2215 | d->propagatePaletteChange(); | - |
2216 | d->updateIsOpaque(); | - |
2217 | } executed: } Execution Count:13252 | 13252 |
2218 | QPalette::ColorRole QWidget::foregroundRole() const | - |
2219 | { | - |
2220 | const QWidgetPrivate * const d = d_func(); | - |
2221 | QPalette::ColorRole rl = QPalette::ColorRole(d->fg_role); | - |
2222 | if (rl != QPalette::NoRole) evaluated: rl != QPalette::NoRole yes Evaluation Count:1328 | yes Evaluation Count:12563 |
| 1328-12563 |
2223 | return rl; executed: return rl; Execution Count:1328 | 1328 |
2224 | QPalette::ColorRole role = QPalette::WindowText; | - |
2225 | switch (backgroundRole()) { | - |
2226 | case QPalette::Button: | - |
2227 | role = QPalette::ButtonText; | - |
2228 | break; executed: break; Execution Count:1034 | 1034 |
2229 | case QPalette::Base: | - |
2230 | role = QPalette::Text; | - |
2231 | break; executed: break; Execution Count:4150 | 4150 |
2232 | case QPalette::Dark: | - |
2233 | case QPalette::Shadow: | - |
2234 | role = QPalette::Light; | - |
2235 | break; | 0 |
2236 | case QPalette::Highlight: | - |
2237 | role = QPalette::HighlightedText; | - |
2238 | break; executed: break; Execution Count:84 | 84 |
2239 | case QPalette::ToolTipBase: | - |
2240 | role = QPalette::ToolTipText; | - |
2241 | break; | 0 |
2242 | default: | - |
2243 | ; | - |
2244 | } executed: } Execution Count:7295 | 7295 |
2245 | return role; executed: return role; Execution Count:12563 | 12563 |
2246 | } | - |
2247 | void QWidget::setForegroundRole(QPalette::ColorRole role) | - |
2248 | { | - |
2249 | QWidgetPrivate * const d = d_func(); | - |
2250 | d->fg_role = role; | - |
2251 | d->updateSystemBackground(); | - |
2252 | d->propagatePaletteChange(); | - |
2253 | } executed: } Execution Count:3216 | 3216 |
2254 | const QPalette &QWidget::palette() const | - |
2255 | { | - |
2256 | if (!isEnabled()) { evaluated: !isEnabled() yes Evaluation Count:823 | yes Evaluation Count:386830 |
| 823-386830 |
2257 | data->pal.setCurrentColorGroup(QPalette::Disabled); | - |
2258 | } else if ((!isVisible() || isActiveWindow()) evaluated: !isVisible() yes Evaluation Count:265743 | yes Evaluation Count:121087 |
evaluated: isActiveWindow() yes Evaluation Count:67310 | yes Evaluation Count:53777 |
executed: } Execution Count:823 | 823-265743 |
2259 | | - |
2260 | | - |
2261 | | - |
2262 | ) { | - |
2263 | data->pal.setCurrentColorGroup(QPalette::Active); | - |
2264 | } else { executed: } Execution Count:333053 | 333053 |
2265 | | - |
2266 | | - |
2267 | | - |
2268 | | - |
2269 | | - |
2270 | | - |
2271 | data->pal.setCurrentColorGroup(QPalette::Inactive); | - |
2272 | } executed: } Execution Count:53777 | 53777 |
2273 | return data->pal; executed: return data->pal; Execution Count:387653 | 387653 |
2274 | } | - |
2275 | | - |
2276 | void QWidget::setPalette(const QPalette &palette) | - |
2277 | { | - |
2278 | QWidgetPrivate * const d = d_func(); | - |
2279 | setAttribute(Qt::WA_SetPalette, palette.resolve() != 0); | - |
2280 | | - |
2281 | | - |
2282 | | - |
2283 | | - |
2284 | | - |
2285 | QPalette naturalPalette = d->naturalWidgetPalette(d->inheritedPaletteResolveMask); | - |
2286 | QPalette resolvedPalette = palette.resolve(naturalPalette); | - |
2287 | d->setPalette_helper(resolvedPalette); | - |
2288 | } executed: } Execution Count:458 | 458 |
2289 | QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const | - |
2290 | { | - |
2291 | const QWidget * const q = q_func(); | - |
2292 | QPalette naturalPalette = QApplication::palette(q); | - |
2293 | if (!q->testAttribute(Qt::WA_StyleSheet) evaluated: !q->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:32405 | yes Evaluation Count:4 |
| 4-32405 |
2294 | && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) evaluated: !q->isWindow() yes Evaluation Count:30815 | yes Evaluation Count:1590 |
evaluated: q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:536 | yes Evaluation Count:1054 |
| 536-30815 |
2295 | | - |
2296 | || (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:93 | yes Evaluation Count:961 |
evaluated: extra->proxyWidget yes Evaluation Count:8 | yes Evaluation Count:85 |
| 8-961 |
2297 | | - |
2298 | )) { | - |
2299 | if (QWidget *p = q->parentWidget()) { evaluated: QWidget *p = q->parentWidget() yes Evaluation Count:31351 | yes Evaluation Count:8 |
| 8-31351 |
2300 | if (!p->testAttribute(Qt::WA_StyleSheet)) { partially evaluated: !p->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:31351 | no Evaluation Count:0 |
| 0-31351 |
2301 | if (!naturalPalette.isCopyOf(QApplication::palette())) { evaluated: !naturalPalette.isCopyOf(QApplication::palette()) yes Evaluation Count:4 | yes Evaluation Count:31347 |
| 4-31347 |
2302 | QPalette inheritedPalette = p->palette(); | - |
2303 | inheritedPalette.resolve(inheritedMask); | - |
2304 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - |
2305 | } else { executed: } Execution Count:4 | 4 |
2306 | naturalPalette = p->palette(); | - |
2307 | } executed: } Execution Count:31347 | 31347 |
2308 | } | - |
2309 | } executed: } Execution Count:31351 | 31351 |
2310 | | - |
2311 | else if (extra && extra->proxyWidget) { partially evaluated: extra yes Evaluation Count:8 | no Evaluation Count:0 |
partially evaluated: extra->proxyWidget yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
2312 | QPalette inheritedPalette = extra->proxyWidget->palette(); | - |
2313 | inheritedPalette.resolve(inheritedMask); | - |
2314 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - |
2315 | } executed: } Execution Count:8 | 8 |
2316 | | - |
2317 | } | - |
2318 | naturalPalette.resolve(0); | - |
2319 | return naturalPalette; executed: return naturalPalette; Execution Count:32409 | 32409 |
2320 | } | - |
2321 | void QWidgetPrivate::resolvePalette() | - |
2322 | { | - |
2323 | QPalette naturalPalette = naturalWidgetPalette(inheritedPaletteResolveMask); | - |
2324 | QPalette resolvedPalette = data.pal.resolve(naturalPalette); | - |
2325 | setPalette_helper(resolvedPalette); | - |
2326 | } executed: } Execution Count:31951 | 31951 |
2327 | | - |
2328 | void QWidgetPrivate::setPalette_helper(const QPalette &palette) | - |
2329 | { | - |
2330 | QWidget * const q = q_func(); | - |
2331 | if (data.pal == palette && data.pal.resolve() == palette.resolve()) evaluated: data.pal == palette yes Evaluation Count:32274 | yes Evaluation Count:135 |
evaluated: data.pal.resolve() == palette.resolve() yes Evaluation Count:32261 | yes Evaluation Count:13 |
| 13-32274 |
2332 | return; executed: return; Execution Count:32261 | 32261 |
2333 | data.pal = palette; | - |
2334 | updateSystemBackground(); | - |
2335 | propagatePaletteChange(); | - |
2336 | updateIsOpaque(); | - |
2337 | q->update(); | - |
2338 | updateIsOpaque(); | - |
2339 | } executed: } Execution Count:148 | 148 |
2340 | void QWidget::setFont(const QFont &font) | - |
2341 | { | - |
2342 | QWidgetPrivate * const d = d_func(); | - |
2343 | | - |
2344 | | - |
2345 | const QStyleSheetStyle* style; | - |
2346 | if (d->extra && (style = qobject_cast<const QStyleSheetStyle*>(d->extra->style))) { evaluated: d->extra yes Evaluation Count:144 | yes Evaluation Count:84 |
partially evaluated: (style = qobject_cast<const QStyleSheetStyle*>(d->extra->style)) no Evaluation Count:0 | yes Evaluation Count:144 |
| 0-144 |
2347 | style->saveWidgetFont(this, font); | - |
2348 | } | 0 |
2349 | | - |
2350 | | - |
2351 | setAttribute(Qt::WA_SetFont, font.resolve() != 0); | - |
2352 | | - |
2353 | | - |
2354 | | - |
2355 | | - |
2356 | | - |
2357 | QFont naturalFont = d->naturalWidgetFont(d->inheritedFontResolveMask); | - |
2358 | QFont resolvedFont = font.resolve(naturalFont); | - |
2359 | d->setFont_helper(resolvedFont); | - |
2360 | } executed: } Execution Count:228 | 228 |
2361 | QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const | - |
2362 | { | - |
2363 | const QWidget * const q = q_func(); | - |
2364 | QFont naturalFont = QApplication::font(q); | - |
2365 | if (!q->testAttribute(Qt::WA_StyleSheet) evaluated: !q->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:31468 | yes Evaluation Count:1 |
| 1-31468 |
2366 | && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) evaluated: !q->isWindow() yes Evaluation Count:30139 | yes Evaluation Count:1329 |
evaluated: q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:270 | yes Evaluation Count:1059 |
| 270-30139 |
2367 | | - |
2368 | || (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:101 | yes Evaluation Count:958 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-958 |
2369 | | - |
2370 | )) { | - |
2371 | if (QWidget *p = q->parentWidget()) { partially evaluated: QWidget *p = q->parentWidget() yes Evaluation Count:30409 | no Evaluation Count:0 |
| 0-30409 |
2372 | if (!p->testAttribute(Qt::WA_StyleSheet)) { partially evaluated: !p->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:30409 | no Evaluation Count:0 |
| 0-30409 |
2373 | if (!naturalFont.isCopyOf(QApplication::font())) { evaluated: !naturalFont.isCopyOf(QApplication::font()) yes Evaluation Count:4 | yes Evaluation Count:30405 |
| 4-30405 |
2374 | QFont inheritedFont = p->font(); | - |
2375 | inheritedFont.resolve(inheritedMask); | - |
2376 | naturalFont = inheritedFont.resolve(naturalFont); | - |
2377 | } else { executed: } Execution Count:4 | 4 |
2378 | naturalFont = p->font(); | - |
2379 | } executed: } Execution Count:30405 | 30405 |
2380 | } | - |
2381 | } executed: } Execution Count:30409 | 30409 |
2382 | | - |
2383 | else if (extra && extra->proxyWidget) { never evaluated: extra->proxyWidget | 0 |
2384 | QFont inheritedFont = extra->proxyWidget->font(); | - |
2385 | inheritedFont.resolve(inheritedMask); | - |
2386 | naturalFont = inheritedFont.resolve(naturalFont); | - |
2387 | } | 0 |
2388 | | - |
2389 | } | - |
2390 | naturalFont.resolve(0); | - |
2391 | return naturalFont; executed: return naturalFont; Execution Count:31469 | 31469 |
2392 | } | - |
2393 | void QWidgetPrivate::resolveFont() | - |
2394 | { | - |
2395 | QFont naturalFont = naturalWidgetFont(inheritedFontResolveMask); | - |
2396 | QFont resolvedFont = data.fnt.resolve(naturalFont); | - |
2397 | setFont_helper(resolvedFont); | - |
2398 | } executed: } Execution Count:31241 | 31241 |
2399 | void QWidgetPrivate::updateFont(const QFont &font) | - |
2400 | { | - |
2401 | QWidget * const q = q_func(); | - |
2402 | | - |
2403 | const QStyleSheetStyle* cssStyle; | - |
2404 | cssStyle = extra ? qobject_cast<const QStyleSheetStyle*>(extra->style) : 0; evaluated: extra yes Evaluation Count:134 | yes Evaluation Count:248 |
| 134-248 |
2405 | | - |
2406 | | - |
2407 | data.fnt = QFont(font, q); | - |
2408 | | - |
2409 | | - |
2410 | | - |
2411 | | - |
2412 | | - |
2413 | | - |
2414 | if (!q->parentWidget() && extra && extra->proxyWidget) { evaluated: !q->parentWidget() yes Evaluation Count:33 | yes Evaluation Count:349 |
evaluated: extra yes Evaluation Count:22 | yes Evaluation Count:11 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-349 |
2415 | QGraphicsProxyWidget *p = extra->proxyWidget; | - |
2416 | inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve(); | - |
2417 | } else | 0 |
2418 | | - |
2419 | if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { evaluated: q->isWindow() yes Evaluation Count:33 | yes Evaluation Count:349 |
partially evaluated: !q->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:33 | no Evaluation Count:0 |
| 0-349 |
2420 | inheritedFontResolveMask = 0; | - |
2421 | } executed: } Execution Count:33 | 33 |
2422 | uint newMask = data.fnt.resolve() | inheritedFontResolveMask; | - |
2423 | | - |
2424 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:293 | yes Evaluation Count:382 |
| 293-382 |
2425 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
2426 | if (w) { evaluated: w yes Evaluation Count:164 | yes Evaluation Count:129 |
| 129-164 |
2427 | if (0) { partially evaluated: 0 no Evaluation Count:0 | yes Evaluation Count:164 |
| 0-164 |
2428 | | - |
2429 | } else if (w->testAttribute(Qt::WA_StyleSheet)) { partially evaluated: w->testAttribute(Qt::WA_StyleSheet) no Evaluation Count:0 | yes Evaluation Count:164 |
| 0-164 |
2430 | | - |
2431 | if (cssStyle) never evaluated: cssStyle | 0 |
2432 | cssStyle->updateStyleSheetFont(w); never executed: cssStyle->updateStyleSheetFont(w); | 0 |
2433 | | - |
2434 | } else if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))) { evaluated: !w->isWindow() yes Evaluation Count:139 | yes Evaluation Count:25 |
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation) no Evaluation Count:0 | yes Evaluation Count:25 |
| 0-139 |
2435 | | - |
2436 | QWidgetPrivate *wd = w->d_func(); | - |
2437 | wd->inheritedFontResolveMask = newMask; | - |
2438 | wd->resolveFont(); | - |
2439 | } executed: } Execution Count:139 | 139 |
2440 | } | - |
2441 | } executed: } Execution Count:293 | 293 |
2442 | | - |
2443 | | - |
2444 | if (cssStyle) { partially evaluated: cssStyle no Evaluation Count:0 | yes Evaluation Count:382 |
| 0-382 |
2445 | cssStyle->updateStyleSheetFont(q); | - |
2446 | } | 0 |
2447 | | - |
2448 | | - |
2449 | QEvent e(QEvent::FontChange); | - |
2450 | QApplication::sendEvent(q, &e); | - |
2451 | } executed: } Execution Count:382 | 382 |
2452 | | - |
2453 | void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction) | - |
2454 | { | - |
2455 | QWidget * const q = q_func(); | - |
2456 | | - |
2457 | if ( (direction == Qt::RightToLeft) == q->testAttribute(Qt::WA_RightToLeft)) evaluated: (direction == Qt::RightToLeft) == q->testAttribute(Qt::WA_RightToLeft) yes Evaluation Count:37309 | yes Evaluation Count:378 |
| 378-37309 |
2458 | return; executed: return; Execution Count:37309 | 37309 |
2459 | q->setAttribute(Qt::WA_RightToLeft, (direction == Qt::RightToLeft)); | - |
2460 | if (!children.isEmpty()) { evaluated: !children.isEmpty() yes Evaluation Count:246 | yes Evaluation Count:132 |
| 132-246 |
2461 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:1105 | yes Evaluation Count:246 |
| 246-1105 |
2462 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
2463 | if (w && !w->isWindow() && !w->testAttribute(Qt::WA_SetLayoutDirection)) evaluated: w yes Evaluation Count:327 | yes Evaluation Count:778 |
evaluated: !w->isWindow() yes Evaluation Count:194 | yes Evaluation Count:133 |
evaluated: !w->testAttribute(Qt::WA_SetLayoutDirection) yes Evaluation Count:193 | yes Evaluation Count:1 |
| 1-778 |
2464 | w->d_func()->setLayoutDirection_helper(direction); executed: w->d_func()->setLayoutDirection_helper(direction); Execution Count:193 | 193 |
2465 | } executed: } Execution Count:1105 | 1105 |
2466 | } executed: } Execution Count:246 | 246 |
2467 | QEvent e(QEvent::LayoutDirectionChange); | - |
2468 | QApplication::sendEvent(q, &e); | - |
2469 | } executed: } Execution Count:378 | 378 |
2470 | | - |
2471 | void QWidgetPrivate::resolveLayoutDirection() | - |
2472 | { | - |
2473 | const QWidget * const q = q_func(); | - |
2474 | if (!q->testAttribute(Qt::WA_SetLayoutDirection)) partially evaluated: !q->testAttribute(Qt::WA_SetLayoutDirection) yes Evaluation Count:36611 | no Evaluation Count:0 |
| 0-36611 |
2475 | setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); executed: setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); Execution Count:36611 | 36611 |
2476 | } executed: } Execution Count:36611 | 36611 |
2477 | void QWidget::setLayoutDirection(Qt::LayoutDirection direction) | - |
2478 | { | - |
2479 | QWidgetPrivate * const d = d_func(); | - |
2480 | | - |
2481 | if (direction == Qt::LayoutDirectionAuto) { partially evaluated: direction == Qt::LayoutDirectionAuto no Evaluation Count:0 | yes Evaluation Count:586 |
| 0-586 |
2482 | unsetLayoutDirection(); | - |
2483 | return; | 0 |
2484 | } | - |
2485 | | - |
2486 | setAttribute(Qt::WA_SetLayoutDirection); | - |
2487 | d->setLayoutDirection_helper(direction); | - |
2488 | } executed: } Execution Count:586 | 586 |
2489 | | - |
2490 | Qt::LayoutDirection QWidget::layoutDirection() const | - |
2491 | { | - |
2492 | return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight; executed: return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight; Execution Count:457997 | 457997 |
2493 | } | - |
2494 | | - |
2495 | void QWidget::unsetLayoutDirection() | - |
2496 | { | - |
2497 | QWidgetPrivate * const d = d_func(); | - |
2498 | setAttribute(Qt::WA_SetLayoutDirection, false); | - |
2499 | d->resolveLayoutDirection(); | - |
2500 | } | 0 |
2501 | QCursor QWidget::cursor() const | - |
2502 | { | - |
2503 | const QWidgetPrivate * const d = d_func(); | - |
2504 | if (testAttribute(Qt::WA_SetCursor)) evaluated: testAttribute(Qt::WA_SetCursor) yes Evaluation Count:40 | yes Evaluation Count:1983 |
| 40-1983 |
2505 | return (d->extra && d->extra->curs) | 40 |
2506 | ? *d->extra->curs | 40 |
2507 | : QCursor(Qt::ArrowCursor); executed: return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor); Execution Count:40 | 40 |
2508 | if (isWindow() || !parentWidget()) partially evaluated: isWindow() yes Evaluation Count:1983 | no Evaluation Count:0 |
never evaluated: !parentWidget() | 0-1983 |
2509 | return QCursor(Qt::ArrowCursor); executed: return QCursor(Qt::ArrowCursor); Execution Count:1983 | 1983 |
2510 | return parentWidget()->cursor(); never executed: return parentWidget()->cursor(); | 0 |
2511 | } | - |
2512 | | - |
2513 | void QWidget::setCursor(const QCursor &cursor) | - |
2514 | { | - |
2515 | QWidgetPrivate * const d = d_func(); | - |
2516 | | - |
2517 | | - |
2518 | if (cursor.shape() != Qt::ArrowCursor evaluated: cursor.shape() != Qt::ArrowCursor yes Evaluation Count:1786 | yes Evaluation Count:119 |
| 119-1786 |
2519 | || (d->extra && d->extra->curs)) evaluated: d->extra yes Evaluation Count:36 | yes Evaluation Count:83 |
evaluated: d->extra->curs yes Evaluation Count:13 | yes Evaluation Count:23 |
| 13-83 |
2520 | | - |
2521 | { | - |
2522 | d->createExtra(); | - |
2523 | QCursor *newCursor = new QCursor(cursor); | - |
2524 | delete d->extra->curs; | - |
2525 | d->extra->curs = newCursor; | - |
2526 | } executed: } Execution Count:1799 | 1799 |
2527 | setAttribute(Qt::WA_SetCursor); | - |
2528 | d->setCursor_sys(cursor); | - |
2529 | | - |
2530 | QEvent event(QEvent::CursorChange); | - |
2531 | QApplication::sendEvent(this, &event); | - |
2532 | } executed: } Execution Count:1905 | 1905 |
2533 | | - |
2534 | void QWidget::unsetCursor() | - |
2535 | { | - |
2536 | QWidgetPrivate * const d = d_func(); | - |
2537 | if (d->extra) { evaluated: d->extra yes Evaluation Count:41 | yes Evaluation Count:16 |
| 16-41 |
2538 | delete d->extra->curs; | - |
2539 | d->extra->curs = 0; | - |
2540 | } executed: } Execution Count:41 | 41 |
2541 | if (!isWindow()) evaluated: !isWindow() yes Evaluation Count:32 | yes Evaluation Count:25 |
| 25-32 |
2542 | setAttribute(Qt::WA_SetCursor, false); executed: setAttribute(Qt::WA_SetCursor, false); Execution Count:32 | 32 |
2543 | d->unsetCursor_sys(); | - |
2544 | | - |
2545 | QEvent event(QEvent::CursorChange); | - |
2546 | QApplication::sendEvent(this, &event); | - |
2547 | } executed: } Execution Count:57 | 57 |
2548 | void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, | - |
2549 | const QRegion &sourceRegion, RenderFlags renderFlags) | - |
2550 | { | - |
2551 | d_func()->render(target, targetOffset, sourceRegion, renderFlags, false); | - |
2552 | } executed: } Execution Count:44 | 44 |
2553 | void QWidget::render(QPainter *painter, const QPoint &targetOffset, | - |
2554 | const QRegion &sourceRegion, RenderFlags renderFlags) | - |
2555 | { | - |
2556 | if (!painter) { partially evaluated: !painter no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2557 | QMessageLogger("kernel/qwidget.cpp", 4665, __PRETTY_FUNCTION__).warning("QWidget::render: Null pointer to painter"); | - |
2558 | return; | 0 |
2559 | } | - |
2560 | | - |
2561 | if (!painter->isActive()) { partially evaluated: !painter->isActive() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2562 | QMessageLogger("kernel/qwidget.cpp", 4670, __PRETTY_FUNCTION__).warning("QWidget::render: Cannot render with an inactive painter"); | - |
2563 | return; | 0 |
2564 | } | - |
2565 | | - |
2566 | const qreal opacity = painter->opacity(); | - |
2567 | if (qFuzzyIsNull(opacity)) partially evaluated: qFuzzyIsNull(opacity) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2568 | return; | 0 |
2569 | | - |
2570 | QWidgetPrivate * const d = d_func(); | - |
2571 | const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter; partially evaluated: d->extra yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: d->extra->inRenderWithPainter no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2572 | const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags) partially evaluated: !inRenderWithPainter yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2573 | : sourceRegion; | - |
2574 | if (toBePainted.isEmpty()) partially evaluated: toBePainted.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2575 | return; | 0 |
2576 | | - |
2577 | if (!d->extra) partially evaluated: !d->extra no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2578 | d->createExtra(); never executed: d->createExtra(); | 0 |
2579 | d->extra->inRenderWithPainter = true; | - |
2580 | | - |
2581 | | - |
2582 | | - |
2583 | | - |
2584 | QPaintEngine *engine = painter->paintEngine(); | - |
2585 | qt_noop(); | - |
2586 | QPaintEnginePrivate *enginePriv = engine->d_func(); | - |
2587 | qt_noop(); | - |
2588 | QPaintDevice *target = engine->paintDevice(); | - |
2589 | qt_noop(); | - |
2590 | | - |
2591 | | - |
2592 | if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) { partially evaluated: !inRenderWithPainter yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: opacity < 1.0 no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: (target->devType() == QInternal::Printer) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2593 | d->render_helper(painter, targetOffset, toBePainted, renderFlags); | - |
2594 | d->extra->inRenderWithPainter = false; | - |
2595 | return; | 0 |
2596 | } | - |
2597 | | - |
2598 | | - |
2599 | QPainter *oldPainter = d->sharedPainter(); | - |
2600 | d->setSharedPainter(painter); | - |
2601 | | - |
2602 | | - |
2603 | const QTransform oldTransform = enginePriv->systemTransform; | - |
2604 | const QRegion oldSystemClip = enginePriv->systemClip; | - |
2605 | const QRegion oldSystemViewport = enginePriv->systemViewport; | - |
2606 | | - |
2607 | | - |
2608 | if (painter->hasClipping()) { partially evaluated: painter->hasClipping() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2609 | const QRegion painterClip = painter->deviceTransform().map(painter->clipRegion()); | - |
2610 | enginePriv->setSystemViewport(oldSystemClip.isEmpty() ? painterClip : oldSystemClip & painterClip); | - |
2611 | } else { | 0 |
2612 | enginePriv->setSystemViewport(oldSystemClip); | - |
2613 | } executed: } Execution Count:1 | 1 |
2614 | | - |
2615 | render(target, targetOffset, toBePainted, renderFlags); | - |
2616 | | - |
2617 | | - |
2618 | enginePriv->systemClip = oldSystemClip; | - |
2619 | enginePriv->setSystemViewport(oldSystemViewport); | - |
2620 | enginePriv->setSystemTransform(oldTransform); | - |
2621 | | - |
2622 | | - |
2623 | d->setSharedPainter(oldPainter); | - |
2624 | | - |
2625 | | - |
2626 | d->extra->inRenderWithPainter = false; | - |
2627 | } executed: } Execution Count:1 | 1 |
2628 | | - |
2629 | static void sendResizeEvents(QWidget *target) | - |
2630 | { | - |
2631 | QResizeEvent e(target->size(), QSize()); | - |
2632 | QApplication::sendEvent(target, &e); | - |
2633 | | - |
2634 | const QObjectList children = target->children(); | - |
2635 | for (int i = 0; i < children.size(); ++i) { never evaluated: i < children.size() | 0 |
2636 | QWidget *child = static_cast<QWidget*>(children.at(i)); | - |
2637 | if (child->isWidgetType() && !child->isWindow() && child->testAttribute(Qt::WA_PendingResizeEvent)) never evaluated: child->isWidgetType() never evaluated: !child->isWindow() never evaluated: child->testAttribute(Qt::WA_PendingResizeEvent) | 0 |
2638 | sendResizeEvents(child); never executed: sendResizeEvents(child); | 0 |
2639 | } | 0 |
2640 | } | 0 |
2641 | QPixmap QWidget::grab(const QRect &rectangle) | - |
2642 | { | - |
2643 | QWidgetPrivate * const d = d_func(); | - |
2644 | if (testAttribute(Qt::WA_PendingResizeEvent) || !testAttribute(Qt::WA_WState_Created)) partially evaluated: testAttribute(Qt::WA_PendingResizeEvent) no Evaluation Count:0 | yes Evaluation Count:41 |
partially evaluated: !testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
2645 | sendResizeEvents(this); never executed: sendResizeEvents(this); | 0 |
2646 | | - |
2647 | const QWidget::RenderFlags renderFlags = QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask; | - |
2648 | | - |
2649 | const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren; | - |
2650 | QRect r(rectangle); | - |
2651 | if (r.width() < 0 || r.height() < 0) { partially evaluated: r.width() < 0 yes Evaluation Count:41 | no Evaluation Count:0 |
never evaluated: r.height() < 0 | 0-41 |
2652 | | - |
2653 | | - |
2654 | r = d->prepareToRender(QRegion(), renderFlags).boundingRect(); | - |
2655 | r.setTopLeft(rectangle.topLeft()); | - |
2656 | } executed: } Execution Count:41 | 41 |
2657 | | - |
2658 | if (!r.intersects(rect())) partially evaluated: !r.intersects(rect()) no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
2659 | return QPixmap(); never executed: return QPixmap(); | 0 |
2660 | | - |
2661 | QPixmap res(r.size()); | - |
2662 | if (!d->isOpaque) evaluated: !d->isOpaque yes Evaluation Count:2 | yes Evaluation Count:39 |
| 2-39 |
2663 | res.fill(Qt::transparent); executed: res.fill(Qt::transparent); Execution Count:2 | 2 |
2664 | render(&res, QPoint(), QRegion(r), renderFlags); | - |
2665 | | - |
2666 | d->dirtyOpaqueChildren = oldDirtyOpaqueChildren; | - |
2667 | return res; executed: return res; Execution Count:41 | 41 |
2668 | } | - |
2669 | QGraphicsEffect *QWidget::graphicsEffect() const | - |
2670 | { | - |
2671 | const QWidgetPrivate * const d = d_func(); | - |
2672 | return d->graphicsEffect; executed: return d->graphicsEffect; Execution Count:535252 | 535252 |
2673 | } | - |
2674 | void QWidget::setGraphicsEffect(QGraphicsEffect *effect) | - |
2675 | { | - |
2676 | QWidgetPrivate * const d = d_func(); | - |
2677 | if (d->graphicsEffect == effect) never evaluated: d->graphicsEffect == effect | 0 |
2678 | return; | 0 |
2679 | | - |
2680 | if (d->graphicsEffect) { never evaluated: d->graphicsEffect | 0 |
2681 | d->invalidateBuffer(rect()); | - |
2682 | delete d->graphicsEffect; | - |
2683 | d->graphicsEffect = 0; | - |
2684 | } | 0 |
2685 | | - |
2686 | if (effect) { | 0 |
2687 | | - |
2688 | QGraphicsEffectSourcePrivate *sourced = new QWidgetEffectSourcePrivate(this); | - |
2689 | QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced); | - |
2690 | d->graphicsEffect = effect; | - |
2691 | effect->d_func()->setGraphicsEffectSource(source); | - |
2692 | update(); | - |
2693 | } | 0 |
2694 | | - |
2695 | d->updateIsOpaque(); | - |
2696 | } | 0 |
2697 | | - |
2698 | | - |
2699 | bool QWidgetPrivate::isAboutToShow() const | - |
2700 | { | - |
2701 | if (data.in_show) never evaluated: data.in_show | 0 |
2702 | return true; never executed: return true; | 0 |
2703 | | - |
2704 | const QWidget * const q = q_func(); | - |
2705 | if (q->isHidden()) never evaluated: q->isHidden() | 0 |
2706 | return false; never executed: return false; | 0 |
2707 | | - |
2708 | | - |
2709 | QWidget *parent = q->parentWidget(); | - |
2710 | return parent ? parent->d_func()->isAboutToShow() : false; never executed: return parent ? parent->d_func()->isAboutToShow() : false; | 0 |
2711 | } | - |
2712 | | - |
2713 | QRegion QWidgetPrivate::prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags) | - |
2714 | { | - |
2715 | QWidget * const q = q_func(); | - |
2716 | const bool isVisible = q->isVisible(); | - |
2717 | | - |
2718 | | - |
2719 | if (!isVisible && !isAboutToShow()) { partially evaluated: !isVisible no Evaluation Count:0 | yes Evaluation Count:85 |
never evaluated: !isAboutToShow() | 0-85 |
2720 | QWidget *topLevel = q->window(); | - |
2721 | (void)topLevel->d_func()->topData(); | - |
2722 | topLevel->ensurePolished(); | - |
2723 | | - |
2724 | | - |
2725 | | - |
2726 | QWidget *widget = q; | - |
2727 | QWidgetList hiddenWidgets; | - |
2728 | while (widget) { | 0 |
2729 | if (widget->isHidden()) { never evaluated: widget->isHidden() | 0 |
2730 | widget->setAttribute(Qt::WA_WState_Hidden, false); | - |
2731 | hiddenWidgets.append(widget); | - |
2732 | if (!widget->isWindow() && widget->parentWidget()->d_func()->layout) never evaluated: !widget->isWindow() never evaluated: widget->parentWidget()->d_func()->layout | 0 |
2733 | widget->d_func()->updateGeometry_helper(true); never executed: widget->d_func()->updateGeometry_helper(true); | 0 |
2734 | } | 0 |
2735 | widget = widget->parentWidget(); | - |
2736 | } | 0 |
2737 | | - |
2738 | | - |
2739 | if (topLevel->d_func()->layout) never evaluated: topLevel->d_func()->layout | 0 |
2740 | topLevel->d_func()->layout->activate(); never executed: topLevel->d_func()->layout->activate(); | 0 |
2741 | | - |
2742 | | - |
2743 | QTLWExtra *topLevelExtra = topLevel->d_func()->maybeTopData(); | - |
2744 | if (topLevelExtra && !topLevelExtra->sizeAdjusted never evaluated: topLevelExtra never evaluated: !topLevelExtra->sizeAdjusted | 0 |
2745 | && !topLevel->testAttribute(Qt::WA_Resized)) { never evaluated: !topLevel->testAttribute(Qt::WA_Resized) | 0 |
2746 | topLevel->adjustSize(); | - |
2747 | topLevel->setAttribute(Qt::WA_Resized, false); | - |
2748 | } | 0 |
2749 | | - |
2750 | | - |
2751 | topLevel->d_func()->activateChildLayoutsRecursively(); | - |
2752 | | - |
2753 | | - |
2754 | for (int i = 0; i < hiddenWidgets.size(); ++i) { never evaluated: i < hiddenWidgets.size() | 0 |
2755 | QWidget *widget = hiddenWidgets.at(i); | - |
2756 | widget->setAttribute(Qt::WA_WState_Hidden); | - |
2757 | if (!widget->isWindow() && widget->parentWidget()->d_func()->layout) never evaluated: !widget->isWindow() never evaluated: widget->parentWidget()->d_func()->layout | 0 |
2758 | widget->parentWidget()->d_func()->layout->invalidate(); never executed: widget->parentWidget()->d_func()->layout->invalidate(); | 0 |
2759 | } | 0 |
2760 | } else if (isVisible) { partially evaluated: isVisible yes Evaluation Count:85 | no Evaluation Count:0 |
| 0-85 |
2761 | q->window()->d_func()->sendPendingMoveAndResizeEvents(true, true); | - |
2762 | } executed: } Execution Count:85 | 85 |
2763 | | - |
2764 | | - |
2765 | QRegion toBePainted = !region.isEmpty() ? region : QRegion(q->rect()); evaluated: !region.isEmpty() yes Evaluation Count:42 | yes Evaluation Count:43 |
| 42-43 |
2766 | if (!(renderFlags & QWidget::IgnoreMask) && extra && extra->hasMask) evaluated: !(renderFlags & QWidget::IgnoreMask) yes Evaluation Count:3 | yes Evaluation Count:82 |
evaluated: extra yes Evaluation Count:1 | yes Evaluation Count:2 |
partially evaluated: extra->hasMask no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-82 |
2767 | toBePainted &= extra->mask; never executed: toBePainted &= extra->mask; | 0 |
2768 | return toBePainted; executed: return toBePainted; Execution Count:85 | 85 |
2769 | } | - |
2770 | | - |
2771 | void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &toBePainted, | - |
2772 | QWidget::RenderFlags renderFlags) | - |
2773 | { | - |
2774 | qt_noop(); | - |
2775 | qt_noop(); | - |
2776 | | - |
2777 | QWidget * const q = q_func(); | - |
2778 | | - |
2779 | const QTransform originalTransform = painter->worldTransform(); | - |
2780 | const bool useDeviceCoordinates = originalTransform.isScaling(); | - |
2781 | if (!useDeviceCoordinates) { never evaluated: !useDeviceCoordinates | 0 |
2782 | | - |
2783 | | - |
2784 | const QRect rect = toBePainted.boundingRect(); | - |
2785 | const QSize size = rect.size(); | - |
2786 | if (size.isNull()) never evaluated: size.isNull() | 0 |
2787 | return; | 0 |
2788 | | - |
2789 | QPixmap pixmap(size); | - |
2790 | if (!(renderFlags & QWidget::DrawWindowBackground) || !isOpaque) never evaluated: !(renderFlags & QWidget::DrawWindowBackground) never evaluated: !isOpaque | 0 |
2791 | pixmap.fill(Qt::transparent); never executed: pixmap.fill(Qt::transparent); | 0 |
2792 | q->render(&pixmap, QPoint(), toBePainted, renderFlags); | - |
2793 | | - |
2794 | const bool restore = !(painter->renderHints() & QPainter::SmoothPixmapTransform); | - |
2795 | painter->setRenderHints(QPainter::SmoothPixmapTransform, true); | - |
2796 | | - |
2797 | painter->drawPixmap(targetOffset, pixmap); | - |
2798 | | - |
2799 | if (restore) | 0 |
2800 | painter->setRenderHints(QPainter::SmoothPixmapTransform, false); never executed: painter->setRenderHints(QPainter::SmoothPixmapTransform, false); | 0 |
2801 | | - |
2802 | | - |
2803 | } else { | 0 |
2804 | | - |
2805 | QTransform transform = originalTransform; | - |
2806 | transform.translate(targetOffset.x(), targetOffset.y()); | - |
2807 | | - |
2808 | QPaintDevice *device = painter->device(); | - |
2809 | qt_noop(); | - |
2810 | | - |
2811 | | - |
2812 | const QRectF rect(toBePainted.boundingRect()); | - |
2813 | QRect deviceRect = transform.mapRect(QRectF(0, 0, rect.width(), rect.height())).toAlignedRect(); | - |
2814 | deviceRect &= QRect(0, 0, device->width(), device->height()); | - |
2815 | | - |
2816 | QPixmap pixmap(deviceRect.size()); | - |
2817 | pixmap.fill(Qt::transparent); | - |
2818 | | - |
2819 | | - |
2820 | QPainter pixmapPainter(&pixmap); | - |
2821 | pixmapPainter.setRenderHints(painter->renderHints()); | - |
2822 | transform *= QTransform::fromTranslate(-deviceRect.x(), -deviceRect.y()); | - |
2823 | pixmapPainter.setTransform(transform); | - |
2824 | | - |
2825 | q->render(&pixmapPainter, QPoint(), toBePainted, renderFlags); | - |
2826 | pixmapPainter.end(); | - |
2827 | | - |
2828 | | - |
2829 | painter->setTransform(QTransform()); | - |
2830 | painter->drawPixmap(deviceRect.topLeft(), pixmap); | - |
2831 | painter->setTransform(originalTransform); | - |
2832 | } | 0 |
2833 | | - |
2834 | } | - |
2835 | | - |
2836 | void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, | - |
2837 | QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - |
2838 | { | - |
2839 | if (rgn.isEmpty()) evaluated: rgn.isEmpty() yes Evaluation Count:377 | yes Evaluation Count:9715 |
| 377-9715 |
2840 | return; executed: return; Execution Count:377 | 377 |
2841 | QWidget * const q = q_func(); | - |
2842 | | - |
2843 | if (graphicsEffect && graphicsEffect->isEnabled()) { partially evaluated: graphicsEffect no Evaluation Count:0 | yes Evaluation Count:9715 |
never evaluated: graphicsEffect->isEnabled() | 0-9715 |
2844 | QGraphicsEffectSource *source = graphicsEffect->d_func()->source; | - |
2845 | QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *> | - |
2846 | (source->d_func()); | - |
2847 | if (!sourced->context) { never evaluated: !sourced->context | 0 |
2848 | QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, backingStore); | - |
2849 | sourced->context = &context; | - |
2850 | if (!sharedPainter) { never evaluated: !sharedPainter | 0 |
2851 | setSystemClip(pdev, rgn.translated(offset)); | - |
2852 | QPainter p(pdev); | - |
2853 | p.translate(offset); | - |
2854 | context.painter = &p; | - |
2855 | graphicsEffect->draw(&p); | - |
2856 | setSystemClip(pdev, QRegion()); | - |
2857 | } else { | 0 |
2858 | context.painter = sharedPainter; | - |
2859 | if (sharedPainter->worldTransform() != sourced->lastEffectTransform) { never evaluated: sharedPainter->worldTransform() != sourced->lastEffectTransform | 0 |
2860 | sourced->invalidateCache(); | - |
2861 | sourced->lastEffectTransform = sharedPainter->worldTransform(); | - |
2862 | } | 0 |
2863 | sharedPainter->save(); | - |
2864 | sharedPainter->translate(offset); | - |
2865 | graphicsEffect->draw(sharedPainter); | - |
2866 | sharedPainter->restore(); | - |
2867 | } | 0 |
2868 | sourced->context = 0; | - |
2869 | return; | 0 |
2870 | } | - |
2871 | } | 0 |
2872 | | - |
2873 | | - |
2874 | const bool asRoot = flags & DrawAsRoot; | - |
2875 | const bool alsoOnScreen = flags & DrawPaintOnScreen; | - |
2876 | const bool recursive = flags & DrawRecursive; | - |
2877 | const bool alsoInvisible = flags & DrawInvisible; | - |
2878 | | - |
2879 | qt_noop(); | - |
2880 | | - |
2881 | QRegion toBePainted(rgn); | - |
2882 | if (asRoot && !alsoInvisible) evaluated: asRoot yes Evaluation Count:2334 | yes Evaluation Count:7381 |
evaluated: !alsoInvisible yes Evaluation Count:2290 | yes Evaluation Count:44 |
| 44-7381 |
2883 | toBePainted &= clipRect(); executed: toBePainted &= clipRect(); Execution Count:2290 | 2290 |
2884 | if (!(flags & DontSubtractOpaqueChildren)) partially evaluated: !(flags & DontSubtractOpaqueChildren) yes Evaluation Count:9715 | no Evaluation Count:0 |
| 0-9715 |
2885 | subtractOpaqueChildren(toBePainted, q->rect()); executed: subtractOpaqueChildren(toBePainted, q->rect()); Execution Count:9715 | 9715 |
2886 | | - |
2887 | if (!toBePainted.isEmpty()) { evaluated: !toBePainted.isEmpty() yes Evaluation Count:8720 | yes Evaluation Count:995 |
| 995-8720 |
2888 | bool onScreen = paintOnScreen(); | - |
2889 | if (!onScreen || alsoOnScreen) { partially evaluated: !onScreen yes Evaluation Count:8720 | no Evaluation Count:0 |
never evaluated: alsoOnScreen | 0-8720 |
2890 | | - |
2891 | if (q->testAttribute(Qt::WA_WState_InPaintEvent)) partially evaluated: q->testAttribute(Qt::WA_WState_InPaintEvent) no Evaluation Count:0 | yes Evaluation Count:8720 |
| 0-8720 |
2892 | QMessageLogger("kernel/qwidget.cpp", 5061, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); never executed: QMessageLogger("kernel/qwidget.cpp", 5061, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); | 0 |
2893 | q->setAttribute(Qt::WA_WState_InPaintEvent); | - |
2894 | | - |
2895 | | - |
2896 | | - |
2897 | | - |
2898 | | - |
2899 | QPaintEngine *paintEngine = pdev->paintEngine(); | - |
2900 | if (paintEngine) { partially evaluated: paintEngine yes Evaluation Count:8720 | no Evaluation Count:0 |
| 0-8720 |
2901 | setRedirected(pdev, -offset); | - |
2902 | if (sharedPainter) evaluated: sharedPainter yes Evaluation Count:1 | yes Evaluation Count:8719 |
| 1-8719 |
2903 | setSystemClip(pdev, toBePainted); executed: setSystemClip(pdev, toBePainted); Execution Count:1 | 1 |
2904 | else | - |
2905 | paintEngine->d_func()->systemRect = q->data->crect; executed: paintEngine->d_func()->systemRect = q->data->crect; Execution Count:8719 | 8719 |
2906 | | - |
2907 | | - |
2908 | if ((asRoot || q->autoFillBackground() || onScreen || q->testAttribute(Qt::WA_StyledBackground)) evaluated: asRoot yes Evaluation Count:2053 | yes Evaluation Count:6667 |
evaluated: q->autoFillBackground() yes Evaluation Count:2390 | yes Evaluation Count:4277 |
partially evaluated: onScreen no Evaluation Count:0 | yes Evaluation Count:4277 |
partially evaluated: q->testAttribute(Qt::WA_StyledBackground) no Evaluation Count:0 | yes Evaluation Count:4277 |
| 0-6667 |
2909 | && !q->testAttribute(Qt::WA_OpaquePaintEvent) && !q->testAttribute(Qt::WA_NoSystemBackground)) { evaluated: !q->testAttribute(Qt::WA_OpaquePaintEvent) yes Evaluation Count:4442 | yes Evaluation Count:1 |
evaluated: !q->testAttribute(Qt::WA_NoSystemBackground) yes Evaluation Count:4440 | yes Evaluation Count:2 |
| 1-4442 |
2910 | QPainter p(q); | - |
2911 | paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0); | - |
2912 | } executed: } Execution Count:4440 | 4440 |
2913 | | - |
2914 | if (!sharedPainter) evaluated: !sharedPainter yes Evaluation Count:8719 | yes Evaluation Count:1 |
| 1-8719 |
2915 | setSystemClip(pdev, toBePainted.translated(offset)); executed: setSystemClip(pdev, toBePainted.translated(offset)); Execution Count:8719 | 8719 |
2916 | | - |
2917 | if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) { partially evaluated: !onScreen yes Evaluation Count:8720 | no Evaluation Count:0 |
evaluated: !asRoot yes Evaluation Count:6667 | yes Evaluation Count:2053 |
evaluated: !isOpaque yes Evaluation Count:3552 | yes Evaluation Count:3115 |
partially evaluated: q->testAttribute(Qt::WA_TintedBackground) no Evaluation Count:0 | yes Evaluation Count:3552 |
| 0-8720 |
2918 | QPainter p(q); | - |
2919 | QColor tint = q->palette().window().color(); | - |
2920 | tint.setAlphaF(qreal(.6)); | - |
2921 | p.fillRect(toBePainted.boundingRect(), tint); | - |
2922 | } | 0 |
2923 | } executed: } Execution Count:8720 | 8720 |
2924 | QPaintEvent e(toBePainted); | - |
2925 | QCoreApplication::sendSpontaneousEvent(q, &e); | - |
2926 | | - |
2927 | | - |
2928 | if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) evaluated: backingStore yes Evaluation Count:8356 | yes Evaluation Count:364 |
partially evaluated: !onScreen yes Evaluation Count:8356 | no Evaluation Count:0 |
evaluated: !asRoot yes Evaluation Count:6347 | yes Evaluation Count:2009 |
evaluated: q->internalWinId() yes Evaluation Count:9 | yes Evaluation Count:6338 |
evaluated: !q->nativeParentWidget()->isWindow() yes Evaluation Count:2 | yes Evaluation Count:6336 |
| 0-8356 |
2929 | backingStore->markDirtyOnScreen(toBePainted, q, offset); executed: backingStore->markDirtyOnScreen(toBePainted, q, offset); Execution Count:11 | 11 |
2930 | | - |
2931 | | - |
2932 | if (paintEngine) { partially evaluated: paintEngine yes Evaluation Count:8720 | no Evaluation Count:0 |
| 0-8720 |
2933 | | - |
2934 | | - |
2935 | | - |
2936 | | - |
2937 | restoreRedirected(); | - |
2938 | if (!sharedPainter) evaluated: !sharedPainter yes Evaluation Count:8719 | yes Evaluation Count:1 |
| 1-8719 |
2939 | paintEngine->d_func()->systemRect = QRect(); executed: paintEngine->d_func()->systemRect = QRect(); Execution Count:8719 | 8719 |
2940 | else | - |
2941 | paintEngine->d_func()->currentClipDevice = 0; executed: paintEngine->d_func()->currentClipDevice = 0; Execution Count:1 | 1 |
2942 | | - |
2943 | setSystemClip(pdev, QRegion()); | - |
2944 | } executed: } Execution Count:8720 | 8720 |
2945 | q->setAttribute(Qt::WA_WState_InPaintEvent, false); | - |
2946 | if (q->paintingActive()) partially evaluated: q->paintingActive() no Evaluation Count:0 | yes Evaluation Count:8720 |
| 0-8720 |
2947 | QMessageLogger("kernel/qwidget.cpp", 5134, __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", 5134, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); | 0 |
2948 | | - |
2949 | if (paintEngine && paintEngine->autoDestruct()) { partially evaluated: paintEngine yes Evaluation Count:8720 | no Evaluation Count:0 |
partially evaluated: paintEngine->autoDestruct() no Evaluation Count:0 | yes Evaluation Count:8720 |
| 0-8720 |
2950 | delete paintEngine; | - |
2951 | } | 0 |
2952 | | - |
2953 | | - |
2954 | | - |
2955 | | - |
2956 | | - |
2957 | } else if (q->isWindow()) { never evaluated: q->isWindow() executed: } Execution Count:8720 | 0-8720 |
2958 | QPaintEngine *engine = pdev->paintEngine(); | - |
2959 | if (engine) { | 0 |
2960 | QPainter p(pdev); | - |
2961 | p.setClipRegion(toBePainted); | - |
2962 | const QBrush bg = q->palette().brush(QPalette::Window); | - |
2963 | if (bg.style() == Qt::TexturePattern) never evaluated: bg.style() == Qt::TexturePattern | 0 |
2964 | p.drawTiledPixmap(q->rect(), bg.texture()); never executed: p.drawTiledPixmap(q->rect(), bg.texture()); | 0 |
2965 | else | - |
2966 | p.fillRect(q->rect(), bg); never executed: p.fillRect(q->rect(), bg); | 0 |
2967 | | - |
2968 | if (engine->autoDestruct()) never evaluated: engine->autoDestruct() | 0 |
2969 | delete engine; never executed: delete engine; | 0 |
2970 | } | 0 |
2971 | } | 0 |
2972 | } | - |
2973 | | - |
2974 | if (recursive && !children.isEmpty()) { partially evaluated: recursive yes Evaluation Count:9715 | no Evaluation Count:0 |
evaluated: !children.isEmpty() yes Evaluation Count:4604 | yes Evaluation Count:5111 |
| 0-9715 |
2975 | paintSiblingsRecursive(pdev, children, children.size() - 1, rgn, offset, flags & ~DrawAsRoot | - |
2976 | , sharedPainter, backingStore); | - |
2977 | } executed: } Execution Count:4604 | 4604 |
2978 | } executed: } Execution Count:9715 | 9715 |
2979 | | - |
2980 | void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, | - |
2981 | const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, | - |
2982 | bool readyToRender) | - |
2983 | { | - |
2984 | if (!target) { partially evaluated: !target no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
2985 | QMessageLogger("kernel/qwidget.cpp", 5172, __PRETTY_FUNCTION__).warning("QWidget::render: null pointer to paint device"); | - |
2986 | return; | 0 |
2987 | } | - |
2988 | | - |
2989 | const bool inRenderWithPainter = extra && extra->inRenderWithPainter; evaluated: extra yes Evaluation Count:42 | yes Evaluation Count:2 |
evaluated: extra->inRenderWithPainter yes Evaluation Count:1 | yes Evaluation Count:41 |
| 1-42 |
2990 | QRegion paintRegion = !inRenderWithPainter && !readyToRender evaluated: !inRenderWithPainter yes Evaluation Count:43 | yes Evaluation Count:1 |
partially evaluated: !readyToRender yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
2991 | ? prepareToRender(sourceRegion, renderFlags) | - |
2992 | : sourceRegion; | - |
2993 | if (paintRegion.isEmpty()) partially evaluated: paintRegion.isEmpty() no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
2994 | return; | 0 |
2995 | | - |
2996 | | - |
2997 | QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; evaluated: inRenderWithPainter yes Evaluation Count:1 | yes Evaluation Count:43 |
| 1-43 |
2998 | | - |
2999 | | - |
3000 | | - |
3001 | if (target->devType() == QInternal::Widget) { partially evaluated: target->devType() == QInternal::Widget no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
3002 | QWidgetPrivate *targetPrivate = static_cast<QWidget *>(target)->d_func(); | - |
3003 | if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { never evaluated: targetPrivate->extra never evaluated: targetPrivate->extra->inRenderWithPainter | 0 |
3004 | QPainter *targetPainter = targetPrivate->sharedPainter(); | - |
3005 | if (targetPainter && targetPainter->isActive()) never evaluated: targetPainter never evaluated: targetPainter->isActive() | 0 |
3006 | setSharedPainter(targetPainter); never executed: setSharedPainter(targetPainter); | 0 |
3007 | } | 0 |
3008 | } | 0 |
3009 | | - |
3010 | | - |
3011 | | - |
3012 | | - |
3013 | | - |
3014 | QPoint offset = targetOffset; | - |
3015 | offset -= paintRegion.boundingRect().topLeft(); | - |
3016 | QPoint redirectionOffset; | - |
3017 | QPaintDevice *redirected = 0; | - |
3018 | | - |
3019 | if (target->devType() == QInternal::Widget) partially evaluated: target->devType() == QInternal::Widget no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
3020 | redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); never executed: redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); | 0 |
3021 | if (!redirected) partially evaluated: !redirected yes Evaluation Count:44 | no Evaluation Count:0 |
| 0-44 |
3022 | redirected = QPainter::redirected(target, &redirectionOffset); executed: redirected = QPainter::redirected(target, &redirectionOffset); Execution Count:44 | 44 |
3023 | | - |
3024 | if (redirected) { partially evaluated: redirected no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
3025 | target = redirected; | - |
3026 | offset -= redirectionOffset; | - |
3027 | } | 0 |
3028 | | - |
3029 | if (!inRenderWithPainter) { evaluated: !inRenderWithPainter yes Evaluation Count:43 | yes Evaluation Count:1 |
| 1-43 |
3030 | if (QPaintEngine *targetEngine = target->paintEngine()) { partially evaluated: QPaintEngine *targetEngine = target->paintEngine() yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
3031 | const QRegion targetSystemClip = targetEngine->systemClip(); | - |
3032 | if (!targetSystemClip.isEmpty()) partially evaluated: !targetSystemClip.isEmpty() no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
3033 | paintRegion &= targetSystemClip.translated(-offset); never executed: paintRegion &= targetSystemClip.translated(-offset); | 0 |
3034 | } executed: } Execution Count:43 | 43 |
3035 | } executed: } Execution Count:43 | 43 |
3036 | | - |
3037 | | - |
3038 | int flags = DrawPaintOnScreen | DrawInvisible; | - |
3039 | if (renderFlags & QWidget::DrawWindowBackground) partially evaluated: renderFlags & QWidget::DrawWindowBackground yes Evaluation Count:44 | no Evaluation Count:0 |
| 0-44 |
3040 | flags |= DrawAsRoot; executed: flags |= DrawAsRoot; Execution Count:44 | 44 |
3041 | | - |
3042 | if (renderFlags & QWidget::DrawChildren) partially evaluated: renderFlags & QWidget::DrawChildren yes Evaluation Count:44 | no Evaluation Count:0 |
| 0-44 |
3043 | flags |= DrawRecursive; executed: flags |= DrawRecursive; Execution Count:44 | 44 |
3044 | else | - |
3045 | flags |= DontSubtractOpaqueChildren; never executed: flags |= DontSubtractOpaqueChildren; | 0 |
3046 | | - |
3047 | flags |= DontSetCompositionMode; | - |
3048 | | - |
3049 | if (target->devType() == QInternal::Printer) { partially evaluated: target->devType() == QInternal::Printer no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
3050 | QPainter p(target); | - |
3051 | render_helper(&p, targetOffset, paintRegion, renderFlags); | - |
3052 | return; | 0 |
3053 | } | - |
3054 | | - |
3055 | | - |
3056 | | - |
3057 | drawWidget(target, paintRegion, offset, flags, sharedPainter()); | - |
3058 | | - |
3059 | | - |
3060 | if (oldSharedPainter) evaluated: oldSharedPainter yes Evaluation Count:1 | yes Evaluation Count:43 |
| 1-43 |
3061 | setSharedPainter(oldSharedPainter); executed: setSharedPainter(oldSharedPainter); Execution Count:1 | 1 |
3062 | | - |
3063 | | - |
3064 | | - |
3065 | | - |
3066 | } executed: } Execution Count:44 | 44 |
3067 | | - |
3068 | void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn, | - |
3069 | const QPoint &offset, int flags | - |
3070 | , QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - |
3071 | { | - |
3072 | QWidget *w = 0; | - |
3073 | QRect boundingRect; | - |
3074 | bool dirtyBoundingRect = true; | - |
3075 | const bool exludeOpaqueChildren = (flags & DontDrawOpaqueChildren); | - |
3076 | const bool excludeNativeChildren = (flags & DontDrawNativeChildren); | - |
3077 | | - |
3078 | do { | - |
3079 | QWidget *x = qobject_cast<QWidget*>(siblings.at(index)); | - |
3080 | if (x && !(exludeOpaqueChildren && x->d_func()->isOpaque) && !x->isHidden() && !x->isWindow() evaluated: x yes Evaluation Count:12130 | yes Evaluation Count:6573 |
evaluated: exludeOpaqueChildren yes Evaluation Count:1137 | yes Evaluation Count:10993 |
evaluated: x->d_func()->isOpaque yes Evaluation Count:247 | yes Evaluation Count:890 |
evaluated: !x->isHidden() yes Evaluation Count:8569 | yes Evaluation Count:3314 |
evaluated: !x->isWindow() yes Evaluation Count:8546 | yes Evaluation Count:23 |
| 23-12130 |
3081 | && !(excludeNativeChildren && x->internalWinId())) { partially evaluated: excludeNativeChildren no Evaluation Count:0 | yes Evaluation Count:8546 |
never evaluated: x->internalWinId() | 0-8546 |
3082 | if (dirtyBoundingRect) { evaluated: dirtyBoundingRect yes Evaluation Count:6600 | yes Evaluation Count:1946 |
| 1946-6600 |
3083 | boundingRect = rgn.boundingRect(); | - |
3084 | dirtyBoundingRect = false; | - |
3085 | } executed: } Execution Count:6600 | 6600 |
3086 | | - |
3087 | if (qRectIntersects(boundingRect, x->d_func()->effectiveRectFor(x->data->crect))) { evaluated: qRectIntersects(boundingRect, x->d_func()->effectiveRectFor(x->data->crect)) yes Evaluation Count:6076 | yes Evaluation Count:2470 |
| 2470-6076 |
3088 | w = x; | - |
3089 | break; executed: break; Execution Count:6076 | 6076 |
3090 | } | - |
3091 | } executed: } Execution Count:2470 | 2470 |
3092 | --index; | - |
3093 | } while (index >= 0); evaluated: index >= 0 yes Evaluation Count:10123 | yes Evaluation Count:2504 |
executed: } Execution Count:12627 | 2504-12627 |
3094 | | - |
3095 | if (!w) evaluated: !w yes Evaluation Count:2504 | yes Evaluation Count:6076 |
| 2504-6076 |
3096 | return; executed: return; Execution Count:2504 | 2504 |
3097 | | - |
3098 | QWidgetPrivate *wd = w->d_func(); | - |
3099 | const QPoint widgetPos(w->data->crect.topLeft()); | - |
3100 | const bool hasMask = wd->extra && wd->extra->hasMask && !wd->graphicsEffect; evaluated: wd->extra yes Evaluation Count:3148 | yes Evaluation Count:2928 |
partially evaluated: wd->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:3148 |
never evaluated: !wd->graphicsEffect | 0-3148 |
3101 | if (index > 0) { evaluated: index > 0 yes Evaluation Count:3976 | yes Evaluation Count:2100 |
| 2100-3976 |
3102 | QRegion wr(rgn); | - |
3103 | if (wd->isOpaque) evaluated: wd->isOpaque yes Evaluation Count:445 | yes Evaluation Count:3531 |
| 445-3531 |
3104 | wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect; partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:445 |
executed: wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect; Execution Count:445 | 0-445 |
3105 | paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags | - |
3106 | , sharedPainter, backingStore); | - |
3107 | } executed: } Execution Count:3976 | 3976 |
3108 | | - |
3109 | if (w->updatesEnabled() partially evaluated: w->updatesEnabled() yes Evaluation Count:6076 | no Evaluation Count:0 |
| 0-6076 |
3110 | | - |
3111 | && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget) evaluated: !w->d_func()->extra yes Evaluation Count:2928 | yes Evaluation Count:3148 |
partially evaluated: !w->d_func()->extra->proxyWidget yes Evaluation Count:3148 | no Evaluation Count:0 |
| 0-3148 |
3112 | | - |
3113 | ) { | - |
3114 | QRegion wRegion(rgn); | - |
3115 | wRegion &= wd->effectiveRectFor(w->data->crect); | - |
3116 | wRegion.translate(-widgetPos); | - |
3117 | if (hasMask) partially evaluated: hasMask no Evaluation Count:0 | yes Evaluation Count:6076 |
| 0-6076 |
3118 | wRegion &= wd->extra->mask; never executed: wRegion &= wd->extra->mask; | 0 |
3119 | wd->drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, backingStore); | - |
3120 | } executed: } Execution Count:6076 | 6076 |
3121 | } executed: } Execution Count:6076 | 6076 |
3122 | | - |
3123 | | - |
3124 | QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const | - |
3125 | { | - |
3126 | if (system != Qt::DeviceCoordinates) never evaluated: system != Qt::DeviceCoordinates | 0 |
3127 | return m_widget->rect(); never executed: return m_widget->rect(); | 0 |
3128 | | - |
3129 | if (!context) { never evaluated: !context | 0 |
3130 | | - |
3131 | QMessageLogger("kernel/qwidget.cpp", 5318, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context"); | - |
3132 | return QRectF(); never executed: return QRectF(); | 0 |
3133 | } | - |
3134 | | - |
3135 | return context->painter->worldTransform().mapRect(m_widget->rect()); never executed: return context->painter->worldTransform().mapRect(m_widget->rect()); | 0 |
3136 | } | - |
3137 | | - |
3138 | void QWidgetEffectSourcePrivate::draw(QPainter *painter) | - |
3139 | { | - |
3140 | if (!context || context->painter != painter) { never evaluated: !context never evaluated: context->painter != painter | 0 |
3141 | m_widget->render(painter); | - |
3142 | return; | 0 |
3143 | } | - |
3144 | | - |
3145 | | - |
3146 | | - |
3147 | QRegion toBePainted = context->rgn; | - |
3148 | toBePainted &= m_widget->rect(); | - |
3149 | QWidgetPrivate *wd = qt_widget_private(m_widget); | - |
3150 | if (wd->extra && wd->extra->hasMask) never evaluated: wd->extra never evaluated: wd->extra->hasMask | 0 |
3151 | toBePainted &= wd->extra->mask; never executed: toBePainted &= wd->extra->mask; | 0 |
3152 | | - |
3153 | wd->drawWidget(context->pdev, toBePainted, context->offset, context->flags, | - |
3154 | context->sharedPainter, context->backingStore); | - |
3155 | } | 0 |
3156 | | - |
3157 | QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset, | - |
3158 | QGraphicsEffect::PixmapPadMode mode) const | - |
3159 | { | - |
3160 | const bool deviceCoordinates = (system == Qt::DeviceCoordinates); | - |
3161 | if (!context && deviceCoordinates) { never evaluated: !context never evaluated: deviceCoordinates | 0 |
3162 | | - |
3163 | QMessageLogger("kernel/qwidget.cpp", 5350, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); | - |
3164 | return QPixmap(); never executed: return QPixmap(); | 0 |
3165 | } | - |
3166 | | - |
3167 | QPoint pixmapOffset; | - |
3168 | QRectF sourceRect = m_widget->rect(); | - |
3169 | | - |
3170 | if (deviceCoordinates) { never evaluated: deviceCoordinates | 0 |
3171 | const QTransform &painterTransform = context->painter->worldTransform(); | - |
3172 | sourceRect = painterTransform.mapRect(sourceRect); | - |
3173 | pixmapOffset = painterTransform.map(pixmapOffset); | - |
3174 | } | 0 |
3175 | | - |
3176 | QRect effectRect; | - |
3177 | | - |
3178 | if (mode == QGraphicsEffect::PadToEffectiveBoundingRect) never evaluated: mode == QGraphicsEffect::PadToEffectiveBoundingRect | 0 |
3179 | effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); never executed: effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); | 0 |
3180 | else if (mode == QGraphicsEffect::PadToTransparentBorder) never evaluated: mode == QGraphicsEffect::PadToTransparentBorder | 0 |
3181 | effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); never executed: effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); | 0 |
3182 | else | - |
3183 | effectRect = sourceRect.toAlignedRect(); never executed: effectRect = sourceRect.toAlignedRect(); | 0 |
3184 | | - |
3185 | if (offset) | 0 |
3186 | *offset = effectRect.topLeft(); never executed: *offset = effectRect.topLeft(); | 0 |
3187 | | - |
3188 | pixmapOffset -= effectRect.topLeft(); | - |
3189 | | - |
3190 | QPixmap pixmap(effectRect.size()); | - |
3191 | pixmap.fill(Qt::transparent); | - |
3192 | m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren); | - |
3193 | return pixmap; never executed: return pixmap; | 0 |
3194 | } | - |
3195 | QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin) | - |
3196 | { | - |
3197 | if (origin) { evaluated: origin yes Evaluation Count:5344 | yes Evaluation Count:5465 |
| 5344-5465 |
3198 | QWExtra *extra = origin->d_func()->extra; | - |
3199 | if (extra && extra->proxyWidget) evaluated: extra yes Evaluation Count:3746 | yes Evaluation Count:1598 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:3746 |
| 0-3746 |
3200 | return extra->proxyWidget; never executed: return extra->proxyWidget; | 0 |
3201 | return nearestGraphicsProxyWidget(origin->parentWidget()); executed: return nearestGraphicsProxyWidget(origin->parentWidget()); Execution Count:5344 | 5344 |
3202 | } | - |
3203 | return 0; executed: return 0; Execution Count:5465 | 5465 |
3204 | } | - |
3205 | void QWidgetPrivate::setLocale_helper(const QLocale &loc, bool forceUpdate) | - |
3206 | { | - |
3207 | QWidget * const q = q_func(); | - |
3208 | if (locale == loc && !forceUpdate) evaluated: locale == loc yes Evaluation Count:31091 | yes Evaluation Count:65 |
partially evaluated: !forceUpdate yes Evaluation Count:31091 | no Evaluation Count:0 |
| 0-31091 |
3209 | return; executed: return; Execution Count:31091 | 31091 |
3210 | | - |
3211 | locale = loc; | - |
3212 | | - |
3213 | if (!children.isEmpty()) { evaluated: !children.isEmpty() yes Evaluation Count:35 | yes Evaluation Count:30 |
| 30-35 |
3214 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:98 | yes Evaluation Count:35 |
| 35-98 |
3215 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - |
3216 | if (!w) evaluated: !w yes Evaluation Count:40 | yes Evaluation Count:58 |
| 40-58 |
3217 | continue; executed: continue; Execution Count:40 | 40 |
3218 | if (w->testAttribute(Qt::WA_SetLocale)) evaluated: w->testAttribute(Qt::WA_SetLocale) yes Evaluation Count:1 | yes Evaluation Count:57 |
| 1-57 |
3219 | continue; executed: continue; Execution Count:1 | 1 |
3220 | if (w->isWindow() && !w->testAttribute(Qt::WA_WindowPropagation)) evaluated: w->isWindow() yes Evaluation Count:2 | yes Evaluation Count:55 |
partially evaluated: !w->testAttribute(Qt::WA_WindowPropagation) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-55 |
3221 | continue; executed: continue; Execution Count:2 | 2 |
3222 | w->d_func()->setLocale_helper(loc, forceUpdate); | - |
3223 | } executed: } Execution Count:55 | 55 |
3224 | } executed: } Execution Count:35 | 35 |
3225 | QEvent e(QEvent::LocaleChange); | - |
3226 | QApplication::sendEvent(q, &e); | - |
3227 | } executed: } Execution Count:65 | 65 |
3228 | | - |
3229 | void QWidget::setLocale(const QLocale &locale) | - |
3230 | { | - |
3231 | QWidgetPrivate * const d = d_func(); | - |
3232 | | - |
3233 | setAttribute(Qt::WA_SetLocale); | - |
3234 | d->setLocale_helper(locale); | - |
3235 | } executed: } Execution Count:7 | 7 |
3236 | | - |
3237 | QLocale QWidget::locale() const | - |
3238 | { | - |
3239 | const QWidgetPrivate * const d = d_func(); | - |
3240 | | - |
3241 | return d->locale; executed: return d->locale; Execution Count:74698 | 74698 |
3242 | } | - |
3243 | | - |
3244 | void QWidgetPrivate::resolveLocale() | - |
3245 | { | - |
3246 | const QWidget * const q = q_func(); | - |
3247 | | - |
3248 | if (!q->testAttribute(Qt::WA_SetLocale)) { evaluated: !q->testAttribute(Qt::WA_SetLocale) yes Evaluation Count:31094 | yes Evaluation Count:1 |
| 1-31094 |
3249 | setLocale_helper(q->isWindow() | - |
3250 | ? QLocale() | - |
3251 | : q->parentWidget()->locale()); | - |
3252 | } executed: } Execution Count:31094 | 31094 |
3253 | } executed: } Execution Count:31095 | 31095 |
3254 | | - |
3255 | void QWidget::unsetLocale() | - |
3256 | { | - |
3257 | QWidgetPrivate * const d = d_func(); | - |
3258 | setAttribute(Qt::WA_SetLocale, false); | - |
3259 | d->resolveLocale(); | - |
3260 | } | 0 |
3261 | QString QWidget::windowTitle() const | - |
3262 | { | - |
3263 | const QWidgetPrivate * const d = d_func(); | - |
3264 | if (d->extra && d->extra->topextra) { evaluated: d->extra yes Evaluation Count:5104 | yes Evaluation Count:576 |
evaluated: d->extra->topextra yes Evaluation Count:4813 | yes Evaluation Count:291 |
| 291-5104 |
3265 | if (!d->extra->topextra->caption.isEmpty()) evaluated: !d->extra->topextra->caption.isEmpty() yes Evaluation Count:1275 | yes Evaluation Count:3538 |
| 1275-3538 |
3266 | return d->extra->topextra->caption; executed: return d->extra->topextra->caption; Execution Count:1275 | 1275 |
3267 | if (!d->extra->topextra->filePath.isEmpty()) evaluated: !d->extra->topextra->filePath.isEmpty() yes Evaluation Count:20 | yes Evaluation Count:3518 |
| 20-3518 |
3268 | return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); executed: return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); Execution Count:20 | 20 |
3269 | } executed: } Execution Count:3518 | 3518 |
3270 | return QString(); executed: return QString(); Execution Count:4385 | 4385 |
3271 | } | - |
3272 | QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widget) | - |
3273 | { | - |
3274 | qt_noop(); | - |
3275 | | - |
3276 | | - |
3277 | | - |
3278 | | - |
3279 | | - |
3280 | QString cap = title; | - |
3281 | | - |
3282 | | - |
3283 | if (cap.isEmpty()) evaluated: cap.isEmpty() yes Evaluation Count:3531 | yes Evaluation Count:276 |
| 276-3531 |
3284 | return cap; executed: return cap; Execution Count:3531 | 3531 |
3285 | | - |
3286 | QLatin1String placeHolder("[*]"); | - |
3287 | int index = cap.indexOf(placeHolder); | - |
3288 | | - |
3289 | | - |
3290 | while (index != -1) { evaluated: index != -1 yes Evaluation Count:13 | yes Evaluation Count:276 |
| 13-276 |
3291 | index += placeHolder.size(); | - |
3292 | int count = 1; | - |
3293 | while (cap.indexOf(placeHolder, index) == index) { partially evaluated: cap.indexOf(placeHolder, index) == index no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-13 |
3294 | ++count; | - |
3295 | index += placeHolder.size(); | - |
3296 | } | 0 |
3297 | | - |
3298 | if (count%2) { partially evaluated: count%2 yes Evaluation Count:13 | no Evaluation Count:0 |
| 0-13 |
3299 | int lastIndex = cap.lastIndexOf(placeHolder, index - 1); | - |
3300 | if (widget->isWindowModified() evaluated: widget->isWindowModified() yes Evaluation Count:3 | yes Evaluation Count:10 |
| 3-10 |
3301 | && widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget)) partially evaluated: widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
3302 | cap.replace(lastIndex, 3, QWidget::tr("*")); executed: cap.replace(lastIndex, 3, QWidget::tr("*")); Execution Count:3 | 3 |
3303 | else | - |
3304 | cap.remove(lastIndex, 3); executed: cap.remove(lastIndex, 3); Execution Count:10 | 10 |
3305 | } | - |
3306 | | - |
3307 | index = cap.indexOf(placeHolder, index); | - |
3308 | } executed: } Execution Count:13 | 13 |
3309 | | - |
3310 | cap.replace(QLatin1String("[*][*]"), placeHolder); | - |
3311 | | - |
3312 | return cap; executed: return cap; Execution Count:276 | 276 |
3313 | } | - |
3314 | | - |
3315 | void QWidgetPrivate::setWindowTitle_helper(const QString &title) | - |
3316 | { | - |
3317 | QWidget * const q = q_func(); | - |
3318 | if (q->testAttribute(Qt::WA_WState_Created)) evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1979 | yes Evaluation Count:270 |
| 270-1979 |
3319 | setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); executed: setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); Execution Count:1979 | 1979 |
3320 | } executed: } Execution Count:2249 | 2249 |
3321 | | - |
3322 | void QWidgetPrivate::setWindowIconText_helper(const QString &title) | - |
3323 | { | - |
3324 | QWidget * const q = q_func(); | - |
3325 | if (q->testAttribute(Qt::WA_WState_Created)) partially evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1776 | no Evaluation Count:0 |
| 0-1776 |
3326 | setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); executed: setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); Execution Count:1776 | 1776 |
3327 | } executed: } Execution Count:1776 | 1776 |
3328 | | - |
3329 | void QWidget::setWindowIconText(const QString &iconText) | - |
3330 | { | - |
3331 | if (QWidget::windowIconText() == iconText) never evaluated: QWidget::windowIconText() == iconText | 0 |
3332 | return; | 0 |
3333 | | - |
3334 | QWidgetPrivate * const d = d_func(); | - |
3335 | d->topData()->iconText = iconText; | - |
3336 | d->setWindowIconText_helper(iconText); | - |
3337 | | - |
3338 | QEvent e(QEvent::IconTextChange); | - |
3339 | QApplication::sendEvent(this, &e); | - |
3340 | } | 0 |
3341 | | - |
3342 | void QWidget::setWindowTitle(const QString &title) | - |
3343 | { | - |
3344 | if (QWidget::windowTitle() == title && !title.isEmpty() && !title.isNull()) evaluated: QWidget::windowTitle() == title yes Evaluation Count:337 | yes Evaluation Count:272 |
evaluated: !title.isEmpty() yes Evaluation Count:210 | yes Evaluation Count:127 |
partially evaluated: !title.isNull() yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-337 |
3345 | return; executed: return; Execution Count:210 | 210 |
3346 | | - |
3347 | QWidgetPrivate * const d = d_func(); | - |
3348 | d->topData()->caption = title; | - |
3349 | d->setWindowTitle_helper(title); | - |
3350 | | - |
3351 | QEvent e(QEvent::WindowTitleChange); | - |
3352 | QApplication::sendEvent(this, &e); | - |
3353 | } executed: } Execution Count:399 | 399 |
3354 | QIcon QWidget::windowIcon() const | - |
3355 | { | - |
3356 | const QWidget *w = this; | - |
3357 | while (w) { evaluated: w yes Evaluation Count:3612 | yes Evaluation Count:2106 |
| 2106-3612 |
3358 | const QWidgetPrivate *d = w->d_func(); | - |
3359 | if (d->extra && d->extra->topextra && d->extra->topextra->icon) evaluated: d->extra yes Evaluation Count:2929 | yes Evaluation Count:683 |
evaluated: d->extra->topextra yes Evaluation Count:2071 | yes Evaluation Count:858 |
evaluated: d->extra->topextra->icon yes Evaluation Count:248 | yes Evaluation Count:1823 |
| 248-2929 |
3360 | return *d->extra->topextra->icon; executed: return *d->extra->topextra->icon; Execution Count:248 | 248 |
3361 | w = w->parentWidget(); | - |
3362 | } executed: } Execution Count:3364 | 3364 |
3363 | return QApplication::windowIcon(); executed: return QApplication::windowIcon(); Execution Count:2106 | 2106 |
3364 | } | - |
3365 | | - |
3366 | void QWidgetPrivate::setWindowIcon_helper() | - |
3367 | { | - |
3368 | QEvent e(QEvent::WindowIconChange); | - |
3369 | QApplication::sendEvent(q_func(), &e); | - |
3370 | for (int i = 0; i < children.size(); ++i) { partially evaluated: i < children.size() no Evaluation Count:0 | yes Evaluation Count:124 |
| 0-124 |
3371 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - |
3372 | if (w && !w->isWindow()) never evaluated: !w->isWindow() | 0 |
3373 | QApplication::sendEvent(w, &e); never executed: QApplication::sendEvent(w, &e); | 0 |
3374 | } | 0 |
3375 | } executed: } Execution Count:124 | 124 |
3376 | | - |
3377 | void QWidget::setWindowIcon(const QIcon &icon) | - |
3378 | { | - |
3379 | QWidgetPrivate * const d = d_func(); | - |
3380 | | - |
3381 | setAttribute(Qt::WA_SetWindowIcon, !icon.isNull()); | - |
3382 | d->createTLExtra(); | - |
3383 | | - |
3384 | if (!d->extra->topextra->icon) partially evaluated: !d->extra->topextra->icon yes Evaluation Count:124 | no Evaluation Count:0 |
| 0-124 |
3385 | d->extra->topextra->icon = new QIcon(); executed: d->extra->topextra->icon = new QIcon(); Execution Count:124 | 124 |
3386 | *d->extra->topextra->icon = icon; | - |
3387 | | - |
3388 | d->setWindowIcon_sys(); | - |
3389 | d->setWindowIcon_helper(); | - |
3390 | } executed: } Execution Count:124 | 124 |
3391 | QString QWidget::windowIconText() const | - |
3392 | { | - |
3393 | const QWidgetPrivate * const d = d_func(); | - |
3394 | 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:1776 | 1776 |
3395 | } | - |
3396 | QString QWidget::windowFilePath() const | - |
3397 | { | - |
3398 | const QWidgetPrivate * const d = d_func(); | - |
3399 | 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 |
3400 | } | - |
3401 | | - |
3402 | void QWidget::setWindowFilePath(const QString &filePath) | - |
3403 | { | - |
3404 | if (filePath == windowFilePath()) evaluated: filePath == windowFilePath() yes Evaluation Count:3 | yes Evaluation Count:18 |
| 3-18 |
3405 | return; executed: return; Execution Count:3 | 3 |
3406 | | - |
3407 | QWidgetPrivate * const d = d_func(); | - |
3408 | | - |
3409 | d->createTLExtra(); | - |
3410 | d->extra->topextra->filePath = filePath; | - |
3411 | d->setWindowFilePath_helper(filePath); | - |
3412 | } executed: } Execution Count:18 | 18 |
3413 | | - |
3414 | void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath) | - |
3415 | { | - |
3416 | 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 |
3417 | | - |
3418 | | - |
3419 | | - |
3420 | QWidget * const q = q_func(); | - |
3421 | (void)filePath;; | - |
3422 | setWindowTitle_helper(q->windowTitle()); | - |
3423 | | - |
3424 | } executed: } Execution Count:14 | 14 |
3425 | | - |
3426 | | - |
3427 | | - |
3428 | } executed: } Execution Count:18 | 18 |
3429 | | - |
3430 | | - |
3431 | | - |
3432 | | - |
3433 | | - |
3434 | | - |
3435 | | - |
3436 | QString QWidget::windowRole() const | - |
3437 | { | - |
3438 | const QWidgetPrivate * const d = d_func(); | - |
3439 | 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 |
3440 | } | - |
3441 | | - |
3442 | | - |
3443 | | - |
3444 | | - |
3445 | | - |
3446 | void QWidget::setWindowRole(const QString &role) | - |
3447 | { | - |
3448 | | - |
3449 | | - |
3450 | | - |
3451 | | - |
3452 | | - |
3453 | (void)role; | - |
3454 | | - |
3455 | } | 0 |
3456 | void QWidget::setFocusProxy(QWidget * w) | - |
3457 | { | - |
3458 | QWidgetPrivate * const d = d_func(); | - |
3459 | if (!w && !d->extra) evaluated: !w yes Evaluation Count:717 | yes Evaluation Count:5177 |
evaluated: !d->extra yes Evaluation Count:422 | yes Evaluation Count:295 |
| 295-5177 |
3460 | return; executed: return; Execution Count:422 | 422 |
3461 | | - |
3462 | for (QWidget* fp = w; fp; fp = fp->focusProxy()) { evaluated: fp yes Evaluation Count:5177 | yes Evaluation Count:5472 |
| 5177-5472 |
3463 | if (fp == this) { partially evaluated: fp == this no Evaluation Count:0 | yes Evaluation Count:5177 |
| 0-5177 |
3464 | QMessageLogger("kernel/qwidget.cpp", 5795, __PRETTY_FUNCTION__).warning("QWidget: %s (%s) already in focus proxy chain", metaObject()->className(), objectName().toLocal8Bit().constData()); | - |
3465 | return; | 0 |
3466 | } | - |
3467 | } executed: } Execution Count:5177 | 5177 |
3468 | | - |
3469 | d->createExtra(); | - |
3470 | d->extra->focus_proxy = w; | - |
3471 | } executed: } Execution Count:5472 | 5472 |
3472 | QWidget * QWidget::focusProxy() const | - |
3473 | { | - |
3474 | const QWidgetPrivate * const d = d_func(); | - |
3475 | return d->extra ? (QWidget *)d->extra->focus_proxy : 0; executed: return d->extra ? (QWidget *)d->extra->focus_proxy : 0; Execution Count:10625 | 10625 |
3476 | } | - |
3477 | bool QWidget::hasFocus() const | - |
3478 | { | - |
3479 | const QWidget* w = this; | - |
3480 | while (w->d_func()->extra && w->d_func()->extra->focus_proxy) evaluated: w->d_func()->extra yes Evaluation Count:147935 | yes Evaluation Count:232424 |
evaluated: w->d_func()->extra->focus_proxy yes Evaluation Count:28149 | yes Evaluation Count:119786 |
| 28149-232424 |
3481 | w = w->d_func()->extra->focus_proxy; executed: w = w->d_func()->extra->focus_proxy; Execution Count:28149 | 28149 |
3482 | if (QWidget *window = w->window()) { partially evaluated: QWidget *window = w->window() yes Evaluation Count:352210 | no Evaluation Count:0 |
| 0-352210 |
3483 | | - |
3484 | QWExtra *e = window->d_func()->extra; | - |
3485 | if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w) evaluated: e yes Evaluation Count:235303 | yes Evaluation Count:116907 |
partially evaluated: e->proxyWidget no Evaluation Count:0 | yes Evaluation Count:235303 |
never evaluated: e->proxyWidget->hasFocus() never evaluated: window->focusWidget() == w | 0-235303 |
3486 | return true; never executed: return true; | 0 |
3487 | | - |
3488 | } executed: } Execution Count:352210 | 352210 |
3489 | return (QApplication::focusWidget() == w); executed: return (QApplication::focusWidget() == w); Execution Count:352210 | 352210 |
3490 | } | - |
3491 | void QWidget::setFocus(Qt::FocusReason reason) | - |
3492 | { | - |
3493 | if (!isEnabled()) evaluated: !isEnabled() yes Evaluation Count:2 | yes Evaluation Count:7672 |
| 2-7672 |
3494 | return; executed: return; Execution Count:2 | 2 |
3495 | | - |
3496 | QWidget *f = this; | - |
3497 | while (f->d_func()->extra && f->d_func()->extra->focus_proxy) evaluated: f->d_func()->extra yes Evaluation Count:6866 | yes Evaluation Count:837 |
evaluated: f->d_func()->extra->focus_proxy yes Evaluation Count:31 | yes Evaluation Count:6835 |
| 31-6866 |
3498 | f = f->d_func()->extra->focus_proxy; executed: f = f->d_func()->extra->focus_proxy; Execution Count:31 | 31 |
3499 | | - |
3500 | if (QApplication::focusWidget() == f evaluated: QApplication::focusWidget() == f yes Evaluation Count:6188 | yes Evaluation Count:1484 |
| 1484-6188 |
3501 | | - |
3502 | | - |
3503 | | - |
3504 | ) | - |
3505 | return; executed: return; Execution Count:6188 | 6188 |
3506 | | - |
3507 | | - |
3508 | QWidget *previousProxyFocus = 0; | - |
3509 | if (QWExtra *topData = window()->d_func()->extra) { evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:1383 | yes Evaluation Count:101 |
| 101-1383 |
3510 | if (topData->proxyWidget && topData->proxyWidget->hasFocus()) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1383 |
never evaluated: topData->proxyWidget->hasFocus() | 0-1383 |
3511 | previousProxyFocus = topData->proxyWidget->widget()->focusWidget(); | - |
3512 | if (previousProxyFocus && previousProxyFocus->focusProxy()) never evaluated: previousProxyFocus never evaluated: previousProxyFocus->focusProxy() | 0 |
3513 | previousProxyFocus = previousProxyFocus->focusProxy(); never executed: previousProxyFocus = previousProxyFocus->focusProxy(); | 0 |
3514 | if (previousProxyFocus == this && !topData->proxyWidget->d_func()->proxyIsGivingFocus) never evaluated: previousProxyFocus == this never evaluated: !topData->proxyWidget->d_func()->proxyIsGivingFocus | 0 |
3515 | return; | 0 |
3516 | } | 0 |
3517 | } executed: } Execution Count:1383 | 1383 |
3518 | | - |
3519 | | - |
3520 | | - |
3521 | | - |
3522 | if (QWExtra *topData = window()->d_func()->extra) { evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:1383 | yes Evaluation Count:101 |
| 101-1383 |
3523 | if (topData->proxyWidget && !topData->proxyWidget->hasFocus()) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1383 |
never evaluated: !topData->proxyWidget->hasFocus() | 0-1383 |
3524 | f->d_func()->updateFocusChild(); | - |
3525 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 1; | - |
3526 | topData->proxyWidget->setFocus(reason); | - |
3527 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 0; | - |
3528 | } | 0 |
3529 | } executed: } Execution Count:1383 | 1383 |
3530 | | - |
3531 | | - |
3532 | if (f->isActiveWindow()) { evaluated: f->isActiveWindow() yes Evaluation Count:619 | yes Evaluation Count:865 |
| 619-865 |
3533 | QWidget *prev = QApplicationPrivate::focus_widget; | - |
3534 | if (prev) { evaluated: prev yes Evaluation Count:194 | yes Evaluation Count:425 |
| 194-425 |
3535 | if (reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason evaluated: reason != Qt::PopupFocusReason yes Evaluation Count:184 | yes Evaluation Count:10 |
evaluated: reason != Qt::MenuBarFocusReason yes Evaluation Count:181 | yes Evaluation Count:3 |
| 3-184 |
3536 | && prev->testAttribute(Qt::WA_InputMethodEnabled)) { evaluated: prev->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:79 | yes Evaluation Count:102 |
| 79-102 |
3537 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
3538 | } executed: } Execution Count:79 | 79 |
3539 | | - |
3540 | if (reason != Qt::NoFocusReason) { evaluated: reason != Qt::NoFocusReason yes Evaluation Count:193 | yes Evaluation Count:1 |
| 1-193 |
3541 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, reason); | - |
3542 | QApplication::sendEvent(prev, &focusAboutToChange); | - |
3543 | } executed: } Execution Count:193 | 193 |
3544 | } executed: } Execution Count:194 | 194 |
3545 | | - |
3546 | f->d_func()->updateFocusChild(); | - |
3547 | | - |
3548 | QApplicationPrivate::setFocusWidget(f, reason); | - |
3549 | if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) evaluated: f->inherits("QMenuBar") yes Evaluation Count:16 | yes Evaluation Count:603 |
evaluated: f->inherits("QMenu") yes Evaluation Count:11 | yes Evaluation Count:592 |
partially evaluated: f->inherits("QMenuItem") no Evaluation Count:0 | yes Evaluation Count:592 |
| 0-603 |
3550 | | - |
3551 | { | - |
3552 | QAccessibleEvent event(f, QAccessible::Focus); | - |
3553 | QAccessible::updateAccessibility(&event); | - |
3554 | } executed: } Execution Count:592 | 592 |
3555 | | - |
3556 | | - |
3557 | if (QWExtra *topData = window()->d_func()->extra) { partially evaluated: QWExtra *topData = window()->d_func()->extra yes Evaluation Count:619 | no Evaluation Count:0 |
| 0-619 |
3558 | if (topData->proxyWidget) { partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:619 |
| 0-619 |
3559 | if (previousProxyFocus && previousProxyFocus != f) { never evaluated: previousProxyFocus never evaluated: previousProxyFocus != f | 0 |
3560 | | - |
3561 | QFocusEvent event(QEvent::FocusOut, reason); | - |
3562 | QPointer<QWidget> that = previousProxyFocus; | - |
3563 | QApplication::sendEvent(previousProxyFocus, &event); | - |
3564 | if (that) | 0 |
3565 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 |
3566 | } | 0 |
3567 | if (!isHidden()) { never evaluated: !isHidden() | 0 |
3568 | | - |
3569 | | - |
3570 | if (QWExtra *topData = window()->d_func()->extra) never evaluated: QWExtra *topData = window()->d_func()->extra | 0 |
3571 | if (topData->proxyWidget && topData->proxyWidget->hasFocus()) never evaluated: topData->proxyWidget never evaluated: topData->proxyWidget->hasFocus() | 0 |
3572 | topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); never executed: topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); | 0 |
3573 | | - |
3574 | | - |
3575 | QFocusEvent event(QEvent::FocusIn, reason); | - |
3576 | QPointer<QWidget> that = f; | - |
3577 | QApplication::sendEvent(f, &event); | - |
3578 | if (that) | 0 |
3579 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 |
3580 | } | 0 |
3581 | } | 0 |
3582 | } executed: } Execution Count:619 | 619 |
3583 | | - |
3584 | } else { executed: } Execution Count:619 | 619 |
3585 | f->d_func()->updateFocusChild(); | - |
3586 | } executed: } Execution Count:865 | 865 |
3587 | | - |
3588 | if (QTLWExtra *extra = f->window()->d_func()->maybeTopData()) { evaluated: QTLWExtra *extra = f->window()->d_func()->maybeTopData() yes Evaluation Count:1164 | yes Evaluation Count:320 |
| 320-1164 |
3589 | if (extra->window) partially evaluated: extra->window yes Evaluation Count:1164 | no Evaluation Count:0 |
| 0-1164 |
3590 | extra->window->focusObjectChanged(f); executed: extra->window->focusObjectChanged(f); Execution Count:1164 | 1164 |
3591 | } executed: } Execution Count:1164 | 1164 |
3592 | } executed: } Execution Count:1484 | 1484 |
3593 | | - |
3594 | | - |
3595 | void QWidgetPrivate::updateFocusChild() | - |
3596 | { | - |
3597 | QWidget * const q = q_func(); | - |
3598 | | - |
3599 | QWidget *w = q; | - |
3600 | if (q->isHidden()) { evaluated: q->isHidden() yes Evaluation Count:90 | yes Evaluation Count:1394 |
| 90-1394 |
3601 | while (w && w->isHidden()) { evaluated: w yes Evaluation Count:158 | yes Evaluation Count:58 |
evaluated: w->isHidden() yes Evaluation Count:126 | yes Evaluation Count:32 |
| 32-158 |
3602 | w->d_func()->focus_child = q; | - |
3603 | w = w->isWindow() ? 0 : w->parentWidget(); evaluated: w->isWindow() yes Evaluation Count:58 | yes Evaluation Count:68 |
| 58-68 |
3604 | } executed: } Execution Count:126 | 126 |
3605 | } else { executed: } Execution Count:90 | 90 |
3606 | while (w) { evaluated: w yes Evaluation Count:3623 | yes Evaluation Count:1394 |
| 1394-3623 |
3607 | w->d_func()->focus_child = q; | - |
3608 | w = w->isWindow() ? 0 : w->parentWidget(); evaluated: w->isWindow() yes Evaluation Count:1394 | yes Evaluation Count:2229 |
| 1394-2229 |
3609 | } executed: } Execution Count:3623 | 3623 |
3610 | } executed: } Execution Count:1394 | 1394 |
3611 | } | - |
3612 | void QWidget::clearFocus() | - |
3613 | { | - |
3614 | if (hasFocus()) { evaluated: hasFocus() yes Evaluation Count:422 | yes Evaluation Count:29149 |
| 422-29149 |
3615 | if (testAttribute(Qt::WA_InputMethodEnabled)) evaluated: testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:66 | yes Evaluation Count:356 |
| 66-356 |
3616 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); Execution Count:66 | 66 |
3617 | | - |
3618 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); | - |
3619 | QApplication::sendEvent(this, &focusAboutToChange); | - |
3620 | } executed: } Execution Count:422 | 422 |
3621 | | - |
3622 | QWidget *w = this; | - |
3623 | while (w) { evaluated: w yes Evaluation Count:91918 | yes Evaluation Count:29571 |
| 29571-91918 |
3624 | if (w->d_func()->focus_child == this) evaluated: w->d_func()->focus_child == this yes Evaluation Count:1712 | yes Evaluation Count:90206 |
| 1712-90206 |
3625 | w->d_func()->focus_child = 0; executed: w->d_func()->focus_child = 0; Execution Count:1712 | 1712 |
3626 | w = w->parentWidget(); | - |
3627 | } executed: } Execution Count:91918 | 91918 |
3628 | | - |
3629 | QWExtra *topData = d_func()->extra; | - |
3630 | if (topData && topData->proxyWidget) evaluated: topData yes Evaluation Count:10146 | yes Evaluation Count:19425 |
partially evaluated: topData->proxyWidget no Evaluation Count:0 | yes Evaluation Count:10146 |
| 0-19425 |
3631 | topData->proxyWidget->clearFocus(); never executed: topData->proxyWidget->clearFocus(); | 0 |
3632 | | - |
3633 | | - |
3634 | if (hasFocus()) { evaluated: hasFocus() yes Evaluation Count:422 | yes Evaluation Count:29149 |
| 422-29149 |
3635 | | - |
3636 | QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); | - |
3637 | | - |
3638 | | - |
3639 | | - |
3640 | | - |
3641 | | - |
3642 | { | - |
3643 | | - |
3644 | QAccessibleEvent event(this, QAccessible::Focus); | - |
3645 | QAccessible::updateAccessibility(&event); | - |
3646 | | - |
3647 | } | - |
3648 | } executed: } Execution Count:422 | 422 |
3649 | } executed: } Execution Count:29571 | 29571 |
3650 | bool QWidget::focusNextPrevChild(bool next) | - |
3651 | { | - |
3652 | QWidgetPrivate * const d = d_func(); | - |
3653 | QWidget* p = parentWidget(); | - |
3654 | bool isSubWindow = (windowType() == Qt::SubWindow); | - |
3655 | if (!isWindow() && !isSubWindow && p) evaluated: !isWindow() yes Evaluation Count:398 | yes Evaluation Count:183 |
evaluated: !isSubWindow yes Evaluation Count:277 | yes Evaluation Count:121 |
partially evaluated: p yes Evaluation Count:277 | no Evaluation Count:0 |
| 0-398 |
3656 | return p->focusNextPrevChild(next); executed: return p->focusNextPrevChild(next); Execution Count:277 | 277 |
3657 | | - |
3658 | if (d->extra && d->extra->proxyWidget) partially evaluated: d->extra yes Evaluation Count:304 | no Evaluation Count:0 |
partially evaluated: d->extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:304 |
| 0-304 |
3659 | return d->extra->proxyWidget->focusNextPrevChild(next); never executed: return d->extra->proxyWidget->focusNextPrevChild(next); | 0 |
3660 | | - |
3661 | QWidget *w = QApplicationPrivate::focusNextPrevChild_helper(this, next); | - |
3662 | if (!w) return false; evaluated: !w yes Evaluation Count:264 | yes Evaluation Count:40 |
executed: return false; Execution Count:264 | 40-264 |
3663 | | - |
3664 | w->setFocus(next ? Qt::TabFocusReason : Qt::BacktabFocusReason); | - |
3665 | return true; executed: return true; Execution Count:40 | 40 |
3666 | } | - |
3667 | QWidget *QWidget::focusWidget() const | - |
3668 | { | - |
3669 | return const_cast<QWidget *>(d_func()->focus_child); executed: return const_cast<QWidget *>(d_func()->focus_child); Execution Count:43305 | 43305 |
3670 | } | - |
3671 | | - |
3672 | | - |
3673 | | - |
3674 | | - |
3675 | | - |
3676 | | - |
3677 | QWidget *QWidget::nextInFocusChain() const | - |
3678 | { | - |
3679 | return const_cast<QWidget *>(d_func()->focus_next); executed: return const_cast<QWidget *>(d_func()->focus_next); Execution Count:34879 | 34879 |
3680 | } | - |
3681 | QWidget *QWidget::previousInFocusChain() const | - |
3682 | { | - |
3683 | return const_cast<QWidget *>(d_func()->focus_prev); never executed: return const_cast<QWidget *>(d_func()->focus_prev); | 0 |
3684 | } | - |
3685 | bool QWidget::isActiveWindow() const | - |
3686 | { | - |
3687 | QWidget *tlw = window(); | - |
3688 | if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) evaluated: tlw == QApplication::activeWindow() yes Evaluation Count:125256 | yes Evaluation Count:261608 |
evaluated: isVisible() yes Evaluation Count:125930 | yes Evaluation Count:135678 |
evaluated: (tlw->windowType() == Qt::Popup) yes Evaluation Count:6597 | yes Evaluation Count:119333 |
| 6597-261608 |
3689 | return true; executed: return true; Execution Count:131853 | 131853 |
3690 | | - |
3691 | | - |
3692 | if (QWExtra *tlwExtra = tlw->d_func()->extra) { evaluated: QWExtra *tlwExtra = tlw->d_func()->extra yes Evaluation Count:159900 | yes Evaluation Count:95111 |
| 95111-159900 |
3693 | if (isVisible() && tlwExtra->proxyWidget) evaluated: isVisible() yes Evaluation Count:119333 | yes Evaluation Count:40567 |
evaluated: tlwExtra->proxyWidget yes Evaluation Count:4 | yes Evaluation Count:119329 |
| 4-119333 |
3694 | return tlwExtra->proxyWidget->isActiveWindow(); executed: return tlwExtra->proxyWidget->isActiveWindow(); Execution Count:4 | 4 |
3695 | } executed: } Execution Count:159896 | 159896 |
3696 | | - |
3697 | | - |
3698 | 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:255007 |
| 0-255007 |
3699 | if(tlw->windowType() == Qt::Tool && never evaluated: tlw->windowType() == Qt::Tool | 0 |
3700 | !tlw->isModal() && never evaluated: !tlw->isModal() | 0 |
3701 | (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) never evaluated: !tlw->parentWidget() never evaluated: tlw->parentWidget()->isActiveWindow() | 0 |
3702 | return true; never executed: return true; | 0 |
3703 | QWidget *w = QApplication::activeWindow(); | - |
3704 | while(w && tlw->windowType() == Qt::Tool && never evaluated: tlw->windowType() == Qt::Tool | 0 |
3705 | !w->isModal() && w->parentWidget()) { never evaluated: !w->isModal() never evaluated: w->parentWidget() | 0 |
3706 | w = w->parentWidget()->window(); | - |
3707 | if(w == tlw) never evaluated: w == tlw | 0 |
3708 | return true; never executed: return true; | 0 |
3709 | } | 0 |
3710 | } | 0 |
3711 | | - |
3712 | | - |
3713 | | - |
3714 | | - |
3715 | | - |
3716 | | - |
3717 | if (const QWindow *w = tlw->windowHandle()) { evaluated: const QWindow *w = tlw->windowHandle() yes Evaluation Count:152647 | yes Evaluation Count:102360 |
| 102360-152647 |
3718 | if (w->handle()) evaluated: w->handle() yes Evaluation Count:138743 | yes Evaluation Count:13904 |
| 13904-138743 |
3719 | return w->handle()->isActive(); executed: return w->handle()->isActive(); Execution Count:138743 | 138743 |
3720 | } executed: } Execution Count:13904 | 13904 |
3721 | | - |
3722 | return false; executed: return false; Execution Count:116264 | 116264 |
3723 | } | - |
3724 | void QWidget::setTabOrder(QWidget* first, QWidget *second) | - |
3725 | { | - |
3726 | if (!first || !second || first->focusPolicy() == Qt::NoFocus || second->focusPolicy() == Qt::NoFocus) partially evaluated: !first no Evaluation Count:0 | yes Evaluation Count:2802 |
partially evaluated: !second no Evaluation Count:0 | yes Evaluation Count:2802 |
evaluated: first->focusPolicy() == Qt::NoFocus yes Evaluation Count:114 | yes Evaluation Count:2688 |
evaluated: second->focusPolicy() == Qt::NoFocus yes Evaluation Count:2 | yes Evaluation Count:2686 |
| 0-2802 |
3727 | return; executed: return; Execution Count:116 | 116 |
3728 | | - |
3729 | if (first->window() != second->window()) { partially evaluated: first->window() != second->window() no Evaluation Count:0 | yes Evaluation Count:2686 |
| 0-2686 |
3730 | QMessageLogger("kernel/qwidget.cpp", 6247, __PRETTY_FUNCTION__).warning("QWidget::setTabOrder: 'first' and 'second' must be in the same window"); | - |
3731 | return; | 0 |
3732 | } | - |
3733 | | - |
3734 | QWidget *fp = first->focusProxy(); | - |
3735 | if (fp) { evaluated: fp yes Evaluation Count:119 | yes Evaluation Count:2567 |
| 119-2567 |
3736 | | - |
3737 | | - |
3738 | | - |
3739 | | - |
3740 | QList<QWidget *> l = first->findChildren<QWidget *>(); | - |
3741 | for (int i = l.size()-1; i >= 0; --i) { partially evaluated: i >= 0 yes Evaluation Count:119 | no Evaluation Count:0 |
| 0-119 |
3742 | QWidget * next = l.at(i); | - |
3743 | if (next->window() == fp->window()) { partially evaluated: next->window() == fp->window() yes Evaluation Count:119 | no Evaluation Count:0 |
| 0-119 |
3744 | fp = next; | - |
3745 | if (fp->focusPolicy() != Qt::NoFocus) partially evaluated: fp->focusPolicy() != Qt::NoFocus yes Evaluation Count:119 | no Evaluation Count:0 |
| 0-119 |
3746 | break; executed: break; Execution Count:119 | 119 |
3747 | } | 0 |
3748 | } | 0 |
3749 | first = fp; | - |
3750 | } executed: } Execution Count:119 | 119 |
3751 | | - |
3752 | if (fp == second) partially evaluated: fp == second no Evaluation Count:0 | yes Evaluation Count:2686 |
| 0-2686 |
3753 | return; | 0 |
3754 | | - |
3755 | if (QWidget *sp = second->focusProxy()) evaluated: QWidget *sp = second->focusProxy() yes Evaluation Count:119 | yes Evaluation Count:2567 |
| 119-2567 |
3756 | second = sp; executed: second = sp; Execution Count:119 | 119 |
3757 | | - |
3758 | | - |
3759 | QWidget *fn = first->d_func()->focus_next; | - |
3760 | | - |
3761 | if (fn == second || first == second) evaluated: fn == second yes Evaluation Count:1450 | yes Evaluation Count:1236 |
partially evaluated: first == second no Evaluation Count:0 | yes Evaluation Count:1236 |
| 0-1450 |
3762 | return; executed: return; Execution Count:1450 | 1450 |
3763 | | - |
3764 | QWidget *sp = second->d_func()->focus_prev; | - |
3765 | QWidget *sn = second->d_func()->focus_next; | - |
3766 | | - |
3767 | fn->d_func()->focus_prev = second; | - |
3768 | first->d_func()->focus_next = second; | - |
3769 | | - |
3770 | second->d_func()->focus_next = fn; | - |
3771 | second->d_func()->focus_prev = first; | - |
3772 | | - |
3773 | sp->d_func()->focus_next = sn; | - |
3774 | sn->d_func()->focus_prev = sp; | - |
3775 | | - |
3776 | | - |
3777 | qt_noop(); | - |
3778 | qt_noop(); | - |
3779 | | - |
3780 | qt_noop(); | - |
3781 | qt_noop(); | - |
3782 | } executed: } Execution Count:1236 | 1236 |
3783 | void QWidgetPrivate::reparentFocusWidgets(QWidget * oldtlw) | - |
3784 | { | - |
3785 | QWidget * const q = q_func(); | - |
3786 | if (oldtlw == q->window()) evaluated: oldtlw == q->window() yes Evaluation Count:937 | yes Evaluation Count:29888 |
| 937-29888 |
3787 | return; executed: return; Execution Count:937 | 937 |
3788 | | - |
3789 | if(focus_child) evaluated: focus_child yes Evaluation Count:10 | yes Evaluation Count:29878 |
| 10-29878 |
3790 | focus_child->clearFocus(); executed: focus_child->clearFocus(); Execution Count:10 | 10 |
3791 | | - |
3792 | | - |
3793 | QWidget *firstOld = 0; | - |
3794 | | - |
3795 | QWidget *o = 0; | - |
3796 | QWidget *n = q; | - |
3797 | | - |
3798 | bool prevWasNew = true; | - |
3799 | QWidget *w = focus_next; | - |
3800 | | - |
3801 | | - |
3802 | | - |
3803 | | - |
3804 | while (w != q) { evaluated: w != q yes Evaluation Count:7426 | yes Evaluation Count:29888 |
| 7426-29888 |
3805 | bool currentIsNew = q->isAncestorOf(w); | - |
3806 | if (currentIsNew) { evaluated: currentIsNew yes Evaluation Count:4708 | yes Evaluation Count:2718 |
| 2718-4708 |
3807 | if (!prevWasNew) { partially evaluated: !prevWasNew no Evaluation Count:0 | yes Evaluation Count:4708 |
| 0-4708 |
3808 | | - |
3809 | n->d_func()->focus_next = w; | - |
3810 | w->d_func()->focus_prev = n; | - |
3811 | } | 0 |
3812 | n = w; | - |
3813 | } else { executed: } Execution Count:4708 | 4708 |
3814 | if (prevWasNew) { evaluated: prevWasNew yes Evaluation Count:287 | yes Evaluation Count:2431 |
| 287-2431 |
3815 | | - |
3816 | if (o) { partially evaluated: o no Evaluation Count:0 | yes Evaluation Count:287 |
| 0-287 |
3817 | o->d_func()->focus_next = w; | - |
3818 | w->d_func()->focus_prev = o; | - |
3819 | } else { | 0 |
3820 | | - |
3821 | firstOld = w; | - |
3822 | } executed: } Execution Count:287 | 287 |
3823 | } | - |
3824 | o = w; | - |
3825 | } executed: } Execution Count:2718 | 2718 |
3826 | w = w->d_func()->focus_next; | - |
3827 | prevWasNew = currentIsNew; | - |
3828 | } executed: } Execution Count:7426 | 7426 |
3829 | | - |
3830 | | - |
3831 | if (firstOld) { evaluated: firstOld yes Evaluation Count:287 | yes Evaluation Count:29601 |
| 287-29601 |
3832 | o->d_func()->focus_next = firstOld; | - |
3833 | firstOld->d_func()->focus_prev = o; | - |
3834 | } executed: } Execution Count:287 | 287 |
3835 | | - |
3836 | if (!q->isWindow()) { evaluated: !q->isWindow() yes Evaluation Count:29766 | yes Evaluation Count:122 |
| 122-29766 |
3837 | QWidget *topLevel = q->window(); | - |
3838 | | - |
3839 | | - |
3840 | QWidget *prev = topLevel->d_func()->focus_prev; | - |
3841 | | - |
3842 | topLevel->d_func()->focus_prev = n; | - |
3843 | prev->d_func()->focus_next = q; | - |
3844 | | - |
3845 | focus_prev = prev; | - |
3846 | n->d_func()->focus_next = topLevel; | - |
3847 | } else { executed: } Execution Count:29766 | 29766 |
3848 | | - |
3849 | n->d_func()->focus_next = q; | - |
3850 | focus_prev = n; | - |
3851 | } executed: } Execution Count:122 | 122 |
3852 | | - |
3853 | } | - |
3854 | int QWidgetPrivate::pointToRect(const QPoint &p, const QRect &r) | - |
3855 | { | - |
3856 | int dx = 0; | - |
3857 | int dy = 0; | - |
3858 | if (p.x() < r.left()) never evaluated: p.x() < r.left() | 0 |
3859 | dx = r.left() - p.x(); never executed: dx = r.left() - p.x(); | 0 |
3860 | else if (p.x() > r.right()) never evaluated: p.x() > r.right() | 0 |
3861 | dx = p.x() - r.right(); never executed: dx = p.x() - r.right(); | 0 |
3862 | if (p.y() < r.top()) never evaluated: p.y() < r.top() | 0 |
3863 | dy = r.top() - p.y(); never executed: dy = r.top() - p.y(); | 0 |
3864 | else if (p.y() > r.bottom()) never evaluated: p.y() > r.bottom() | 0 |
3865 | dy = p.y() - r.bottom(); never executed: dy = p.y() - r.bottom(); | 0 |
3866 | return dx + dy; never executed: return dx + dy; | 0 |
3867 | } | - |
3868 | QSize QWidget::frameSize() const | - |
3869 | { | - |
3870 | const QWidgetPrivate * const d = d_func(); | - |
3871 | if (isWindow() && !(windowType() == Qt::Popup)) { never evaluated: isWindow() never evaluated: !(windowType() == Qt::Popup) | 0 |
3872 | QRect fs = d->frameStrut(); | - |
3873 | return QSize(data->crect.width() + fs.left() + fs.right(), | 0 |
3874 | 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 |
3875 | } | - |
3876 | return data->crect.size(); never executed: return data->crect.size(); | 0 |
3877 | } | - |
3878 | void QWidget::move(const QPoint &p) | - |
3879 | { | - |
3880 | QWidgetPrivate * const d = d_func(); | - |
3881 | setAttribute(Qt::WA_Moved); | - |
3882 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:595 | yes Evaluation Count:425 |
| 425-595 |
3883 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:532 | yes Evaluation Count:63 |
| 63-532 |
3884 | d->topData()->posIncludesFrame = false; executed: d->topData()->posIncludesFrame = false; Execution Count:532 | 532 |
3885 | d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(), | - |
3886 | p.y() + geometry().y() - QWidget::y(), | - |
3887 | width(), height(), true); | - |
3888 | d->setDirtyOpaqueRegion(); | - |
3889 | } else { executed: } Execution Count:595 | 595 |
3890 | | - |
3891 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:194 | yes Evaluation Count:231 |
| 194-231 |
3892 | d->topData()->posIncludesFrame = true; executed: d->topData()->posIncludesFrame = true; Execution Count:194 | 194 |
3893 | data->crect.moveTopLeft(p); | - |
3894 | setAttribute(Qt::WA_PendingMoveEvent); | - |
3895 | } executed: } Execution Count:425 | 425 |
3896 | } | - |
3897 | | - |
3898 | | - |
3899 | | - |
3900 | | - |
3901 | | - |
3902 | | - |
3903 | | - |
3904 | void QWidget::resize(const QSize &s) | - |
3905 | { | - |
3906 | QWidgetPrivate * const d = d_func(); | - |
3907 | setAttribute(Qt::WA_Resized); | - |
3908 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1984 | yes Evaluation Count:3918 |
| 1984-3918 |
3909 | d->fixPosIncludesFrame(); | - |
3910 | d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false); | - |
3911 | d->setDirtyOpaqueRegion(); | - |
3912 | } else { executed: } Execution Count:1984 | 1984 |
3913 | data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize())); | - |
3914 | setAttribute(Qt::WA_PendingResizeEvent); | - |
3915 | } executed: } Execution Count:3918 | 3918 |
3916 | } | - |
3917 | | - |
3918 | void QWidget::setGeometry(const QRect &r) | - |
3919 | { | - |
3920 | QWidgetPrivate * const d = d_func(); | - |
3921 | setAttribute(Qt::WA_Resized); | - |
3922 | setAttribute(Qt::WA_Moved); | - |
3923 | if (isWindow()) evaluated: isWindow() yes Evaluation Count:304 | yes Evaluation Count:49212 |
| 304-49212 |
3924 | d->topData()->posIncludesFrame = 0; executed: d->topData()->posIncludesFrame = 0; Execution Count:304 | 304 |
3925 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:20021 | yes Evaluation Count:29495 |
| 20021-29495 |
3926 | d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true); | - |
3927 | d->setDirtyOpaqueRegion(); | - |
3928 | } else { executed: } Execution Count:20021 | 20021 |
3929 | data->crect.setTopLeft(r.topLeft()); | - |
3930 | data->crect.setSize(r.size().boundedTo(maximumSize()).expandedTo(minimumSize())); | - |
3931 | setAttribute(Qt::WA_PendingMoveEvent); | - |
3932 | setAttribute(Qt::WA_PendingResizeEvent); | - |
3933 | } executed: } Execution Count:29495 | 29495 |
3934 | } | - |
3935 | QByteArray QWidget::saveGeometry() const | - |
3936 | { | - |
3937 | QByteArray array; | - |
3938 | QDataStream stream(&array, QIODevice::WriteOnly); | - |
3939 | stream.setVersion(QDataStream::Qt_4_0); | - |
3940 | const quint32 magicNumber = 0x1D9D0CB; | - |
3941 | quint16 majorVersion = 1; | - |
3942 | quint16 minorVersion = 0; | - |
3943 | stream << magicNumber | - |
3944 | << majorVersion | - |
3945 | << minorVersion | - |
3946 | | - |
3947 | | - |
3948 | | - |
3949 | | - |
3950 | << frameGeometry() | - |
3951 | << normalGeometry() | - |
3952 | | - |
3953 | << qint32(QApplication::desktop()->screenNumber(this)) | - |
3954 | << quint8(windowState() & Qt::WindowMaximized) | - |
3955 | << quint8(windowState() & Qt::WindowFullScreen); | - |
3956 | return array; never executed: return array; | 0 |
3957 | } | - |
3958 | bool QWidget::restoreGeometry(const QByteArray &geometry) | - |
3959 | { | - |
3960 | if (geometry.size() < 4) never evaluated: geometry.size() < 4 | 0 |
3961 | return false; never executed: return false; | 0 |
3962 | QDataStream stream(geometry); | - |
3963 | stream.setVersion(QDataStream::Qt_4_0); | - |
3964 | | - |
3965 | const quint32 magicNumber = 0x1D9D0CB; | - |
3966 | quint32 storedMagicNumber; | - |
3967 | stream >> storedMagicNumber; | - |
3968 | if (storedMagicNumber != magicNumber) never evaluated: storedMagicNumber != magicNumber | 0 |
3969 | return false; never executed: return false; | 0 |
3970 | | - |
3971 | const quint16 currentMajorVersion = 1; | - |
3972 | quint16 majorVersion = 0; | - |
3973 | quint16 minorVersion = 0; | - |
3974 | | - |
3975 | stream >> majorVersion >> minorVersion; | - |
3976 | | - |
3977 | if (majorVersion != currentMajorVersion) never evaluated: majorVersion != currentMajorVersion | 0 |
3978 | return false; never executed: return false; | 0 |
3979 | | - |
3980 | | - |
3981 | QRect restoredFrameGeometry; | - |
3982 | QRect restoredNormalGeometry; | - |
3983 | qint32 restoredScreenNumber; | - |
3984 | quint8 maximized; | - |
3985 | quint8 fullScreen; | - |
3986 | | - |
3987 | stream >> restoredFrameGeometry | - |
3988 | >> restoredNormalGeometry | - |
3989 | >> restoredScreenNumber | - |
3990 | >> maximized | - |
3991 | >> fullScreen; | - |
3992 | | - |
3993 | const int frameHeight = 20; | - |
3994 | if (!restoredFrameGeometry.isValid()) never evaluated: !restoredFrameGeometry.isValid() | 0 |
3995 | restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); never executed: restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); | 0 |
3996 | | - |
3997 | if (!restoredNormalGeometry.isValid()) never evaluated: !restoredNormalGeometry.isValid() | 0 |
3998 | restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); never executed: restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); | 0 |
3999 | if (!restoredNormalGeometry.isValid()) { never evaluated: !restoredNormalGeometry.isValid() | 0 |
4000 | | - |
4001 | restoredNormalGeometry.setSize(restoredNormalGeometry | - |
4002 | .size() | - |
4003 | .expandedTo(d_func()->adjustedSize())); | - |
4004 | } | 0 |
4005 | | - |
4006 | const QDesktopWidget * const desktop = QApplication::desktop(); | - |
4007 | if (restoredScreenNumber >= desktop->numScreens()) never evaluated: restoredScreenNumber >= desktop->numScreens() | 0 |
4008 | restoredScreenNumber = desktop->primaryScreen(); never executed: restoredScreenNumber = desktop->primaryScreen(); | 0 |
4009 | | - |
4010 | const QRect availableGeometry = desktop->availableGeometry(restoredScreenNumber); | - |
4011 | if (!restoredFrameGeometry.intersects(availableGeometry)) { never evaluated: !restoredFrameGeometry.intersects(availableGeometry) | 0 |
4012 | restoredFrameGeometry.moveBottom(qMin(restoredFrameGeometry.bottom(), availableGeometry.bottom())); | - |
4013 | restoredFrameGeometry.moveLeft(qMax(restoredFrameGeometry.left(), availableGeometry.left())); | - |
4014 | restoredFrameGeometry.moveRight(qMin(restoredFrameGeometry.right(), availableGeometry.right())); | - |
4015 | } | 0 |
4016 | restoredFrameGeometry.moveTop(qMax(restoredFrameGeometry.top(), availableGeometry.top())); | - |
4017 | | - |
4018 | if (!restoredNormalGeometry.intersects(availableGeometry)) { never evaluated: !restoredNormalGeometry.intersects(availableGeometry) | 0 |
4019 | restoredNormalGeometry.moveBottom(qMin(restoredNormalGeometry.bottom(), availableGeometry.bottom())); | - |
4020 | restoredNormalGeometry.moveLeft(qMax(restoredNormalGeometry.left(), availableGeometry.left())); | - |
4021 | restoredNormalGeometry.moveRight(qMin(restoredNormalGeometry.right(), availableGeometry.right())); | - |
4022 | } | 0 |
4023 | restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight)); | - |
4024 | | - |
4025 | if (maximized || fullScreen) { never evaluated: maximized never evaluated: fullScreen | 0 |
4026 | | - |
4027 | | - |
4028 | | - |
4029 | | - |
4030 | | - |
4031 | setGeometry(restoredNormalGeometry); | - |
4032 | | - |
4033 | Qt::WindowStates ws = windowState(); | - |
4034 | if (maximized) never evaluated: maximized | 0 |
4035 | ws |= Qt::WindowMaximized; never executed: ws |= Qt::WindowMaximized; | 0 |
4036 | if (fullScreen) never evaluated: fullScreen | 0 |
4037 | ws |= Qt::WindowFullScreen; never executed: ws |= Qt::WindowFullScreen; | 0 |
4038 | setWindowState(ws); | - |
4039 | d_func()->topData()->normalGeometry = restoredNormalGeometry; | - |
4040 | } else { | 0 |
4041 | QPoint offset; | - |
4042 | | - |
4043 | | - |
4044 | | - |
4045 | | - |
4046 | setWindowState(windowState() & ~(Qt::WindowMaximized | Qt::WindowFullScreen)); | - |
4047 | move(restoredFrameGeometry.topLeft() + offset); | - |
4048 | resize(restoredNormalGeometry.size()); | - |
4049 | } | 0 |
4050 | return true; never executed: return true; | 0 |
4051 | } | - |
4052 | void QWidget::setContentsMargins(int left, int top, int right, int bottom) | - |
4053 | { | - |
4054 | QWidgetPrivate * const d = d_func(); | - |
4055 | if (left == d->leftmargin && top == d->topmargin evaluated: left == d->leftmargin yes Evaluation Count:27041 | yes Evaluation Count:6434 |
evaluated: top == d->topmargin yes Evaluation Count:26937 | yes Evaluation Count:104 |
| 104-27041 |
4056 | && right == d->rightmargin && bottom == d->bottommargin) evaluated: right == d->rightmargin yes Evaluation Count:26936 | yes Evaluation Count:1 |
partially evaluated: bottom == d->bottommargin yes Evaluation Count:26936 | no Evaluation Count:0 |
| 0-26936 |
4057 | return; executed: return; Execution Count:26936 | 26936 |
4058 | d->leftmargin = left; | - |
4059 | d->topmargin = top; | - |
4060 | d->rightmargin = right; | - |
4061 | d->bottommargin = bottom; | - |
4062 | | - |
4063 | if (QLayout *l=d->layout) evaluated: QLayout *l=d->layout yes Evaluation Count:485 | yes Evaluation Count:6054 |
| 485-6054 |
4064 | l->update(); executed: l->update(); Execution Count:485 | 485 |
4065 | else | - |
4066 | updateGeometry(); executed: updateGeometry(); Execution Count:6054 | 6054 |
4067 | | - |
4068 | if (isVisible()) { evaluated: isVisible() yes Evaluation Count:2 | yes Evaluation Count:6537 |
| 2-6537 |
4069 | update(); | - |
4070 | QResizeEvent e(data->crect.size(), data->crect.size()); | - |
4071 | QApplication::sendEvent(this, &e); | - |
4072 | } else { executed: } Execution Count:2 | 2 |
4073 | setAttribute(Qt::WA_PendingResizeEvent, true); | - |
4074 | } executed: } Execution Count:6537 | 6537 |
4075 | | - |
4076 | QEvent e(QEvent::ContentsRectChange); | - |
4077 | QApplication::sendEvent(this, &e); | - |
4078 | } executed: } Execution Count:6539 | 6539 |
4079 | void QWidget::setContentsMargins(const QMargins &margins) | - |
4080 | { | - |
4081 | setContentsMargins(margins.left(), margins.top(), | - |
4082 | margins.right(), margins.bottom()); | - |
4083 | } | 0 |
4084 | | - |
4085 | | - |
4086 | | - |
4087 | | - |
4088 | | - |
4089 | | - |
4090 | | - |
4091 | void QWidget::getContentsMargins(int *left, int *top, int *right, int *bottom) const | - |
4092 | { | - |
4093 | const QWidgetPrivate * const d = d_func(); | - |
4094 | if (left) partially evaluated: left yes Evaluation Count:2788 | no Evaluation Count:0 |
| 0-2788 |
4095 | *left = d->leftmargin; executed: *left = d->leftmargin; Execution Count:2788 | 2788 |
4096 | if (top) evaluated: top yes Evaluation Count:2739 | yes Evaluation Count:49 |
| 49-2739 |
4097 | *top = d->topmargin; executed: *top = d->topmargin; Execution Count:2739 | 2739 |
4098 | if (right) partially evaluated: right yes Evaluation Count:2788 | no Evaluation Count:0 |
| 0-2788 |
4099 | *right = d->rightmargin; executed: *right = d->rightmargin; Execution Count:2788 | 2788 |
4100 | if (bottom) evaluated: bottom yes Evaluation Count:2739 | yes Evaluation Count:49 |
| 49-2739 |
4101 | *bottom = d->bottommargin; executed: *bottom = d->bottommargin; Execution Count:2739 | 2739 |
4102 | } executed: } Execution Count:2788 | 2788 |
4103 | QMargins QWidget::contentsMargins() const | - |
4104 | { | - |
4105 | const QWidgetPrivate * const d = d_func(); | - |
4106 | return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin); never executed: return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin); | 0 |
4107 | } | - |
4108 | | - |
4109 | | - |
4110 | | - |
4111 | | - |
4112 | | - |
4113 | | - |
4114 | | - |
4115 | QRect QWidget::contentsRect() const | - |
4116 | { | - |
4117 | const QWidgetPrivate * const d = d_func(); | - |
4118 | return QRect(QPoint(d->leftmargin, d->topmargin), | 241352 |
4119 | QPoint(data->crect.width() - 1 - d->rightmargin, | 241352 |
4120 | 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:241352 | 241352 |
4121 | | - |
4122 | } | - |
4123 | Qt::ContextMenuPolicy QWidget::contextMenuPolicy() const | - |
4124 | { | - |
4125 | return (Qt::ContextMenuPolicy)data->context_menu_policy; never executed: return (Qt::ContextMenuPolicy)data->context_menu_policy; | 0 |
4126 | } | - |
4127 | | - |
4128 | void QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy policy) | - |
4129 | { | - |
4130 | data->context_menu_policy = (uint) policy; | - |
4131 | } executed: } Execution Count:972 | 972 |
4132 | Qt::FocusPolicy QWidget::focusPolicy() const | - |
4133 | { | - |
4134 | return (Qt::FocusPolicy)data->focus_policy; executed: return (Qt::FocusPolicy)data->focus_policy; Execution Count:62115 | 62115 |
4135 | } | - |
4136 | | - |
4137 | void QWidget::setFocusPolicy(Qt::FocusPolicy policy) | - |
4138 | { | - |
4139 | data->focus_policy = (uint) policy; | - |
4140 | QWidgetPrivate * const d = d_func(); | - |
4141 | if (d->extra && d->extra->focus_proxy) evaluated: d->extra yes Evaluation Count:1249 | yes Evaluation Count:19695 |
evaluated: d->extra->focus_proxy yes Evaluation Count:263 | yes Evaluation Count:986 |
| 263-19695 |
4142 | d->extra->focus_proxy->setFocusPolicy(policy); executed: d->extra->focus_proxy->setFocusPolicy(policy); Execution Count:263 | 263 |
4143 | } executed: } Execution Count:20944 | 20944 |
4144 | void QWidget::setUpdatesEnabled(bool enable) | - |
4145 | { | - |
4146 | QWidgetPrivate * const d = d_func(); | - |
4147 | setAttribute(Qt::WA_ForceUpdatesDisabled, !enable); | - |
4148 | d->setUpdatesEnabled_helper(enable); | - |
4149 | } executed: } Execution Count:2362 | 2362 |
4150 | void QWidget::show() | - |
4151 | { | - |
4152 | if (isWindow() && (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen()) evaluated: isWindow() yes Evaluation Count:1817 | yes Evaluation Count:8811 |
partially evaluated: (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen() no Evaluation Count:0 | yes Evaluation Count:1817 |
| 0-8811 |
4153 | showFullScreen(); never executed: showFullScreen(); | 0 |
4154 | else | - |
4155 | setVisible(true); executed: setVisible(true); Execution Count:10628 | 10628 |
4156 | } | - |
4157 | | - |
4158 | | - |
4159 | | - |
4160 | | - |
4161 | | - |
4162 | | - |
4163 | void QWidgetPrivate::show_recursive() | - |
4164 | { | - |
4165 | QWidget * const q = q_func(); | - |
4166 | | - |
4167 | | - |
4168 | if (!q->testAttribute(Qt::WA_WState_Created)) evaluated: !q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:571 | yes Evaluation Count:3155 |
| 571-3155 |
4169 | createRecursively(); executed: createRecursively(); Execution Count:571 | 571 |
4170 | q->ensurePolished(); | - |
4171 | | - |
4172 | if (!q->isWindow() && q->parentWidget()->d_func()->layout && !q->parentWidget()->data->in_show) partially evaluated: !q->isWindow() yes Evaluation Count:3726 | no Evaluation Count:0 |
evaluated: q->parentWidget()->d_func()->layout yes Evaluation Count:3180 | yes Evaluation Count:546 |
partially evaluated: !q->parentWidget()->data->in_show no Evaluation Count:0 | yes Evaluation Count:3180 |
| 0-3726 |
4173 | q->parentWidget()->d_func()->layout->activate(); never executed: q->parentWidget()->d_func()->layout->activate(); | 0 |
4174 | | - |
4175 | if (layout) evaluated: layout yes Evaluation Count:656 | yes Evaluation Count:3070 |
| 656-3070 |
4176 | layout->activate(); executed: layout->activate(); Execution Count:656 | 656 |
4177 | | - |
4178 | show_helper(); | - |
4179 | } executed: } Execution Count:3726 | 3726 |
4180 | | - |
4181 | void QWidgetPrivate::sendPendingMoveAndResizeEvents(bool recursive, bool disableUpdates) | - |
4182 | { | - |
4183 | QWidget * const q = q_func(); | - |
4184 | | - |
4185 | disableUpdates = disableUpdates && q->updatesEnabled(); evaluated: disableUpdates yes Evaluation Count:1361 | yes Evaluation Count:10789 |
partially evaluated: q->updatesEnabled() yes Evaluation Count:1361 | no Evaluation Count:0 |
| 0-10789 |
4186 | if (disableUpdates) evaluated: disableUpdates yes Evaluation Count:1361 | yes Evaluation Count:10789 |
| 1361-10789 |
4187 | q->setAttribute(Qt::WA_UpdatesDisabled); executed: q->setAttribute(Qt::WA_UpdatesDisabled); Execution Count:1361 | 1361 |
4188 | | - |
4189 | if (q->testAttribute(Qt::WA_PendingMoveEvent)) { evaluated: q->testAttribute(Qt::WA_PendingMoveEvent) yes Evaluation Count:7747 | yes Evaluation Count:4403 |
| 4403-7747 |
4190 | QMoveEvent e(data.crect.topLeft(), data.crect.topLeft()); | - |
4191 | QApplication::sendEvent(q, &e); | - |
4192 | q->setAttribute(Qt::WA_PendingMoveEvent, false); | - |
4193 | } executed: } Execution Count:7747 | 7747 |
4194 | | - |
4195 | if (q->testAttribute(Qt::WA_PendingResizeEvent)) { evaluated: q->testAttribute(Qt::WA_PendingResizeEvent) yes Evaluation Count:7900 | yes Evaluation Count:4250 |
| 4250-7900 |
4196 | QResizeEvent e(data.crect.size(), QSize()); | - |
4197 | QApplication::sendEvent(q, &e); | - |
4198 | q->setAttribute(Qt::WA_PendingResizeEvent, false); | - |
4199 | } executed: } Execution Count:7900 | 7900 |
4200 | | - |
4201 | if (disableUpdates) evaluated: disableUpdates yes Evaluation Count:1361 | yes Evaluation Count:10789 |
| 1361-10789 |
4202 | q->setAttribute(Qt::WA_UpdatesDisabled, false); executed: q->setAttribute(Qt::WA_UpdatesDisabled, false); Execution Count:1361 | 1361 |
4203 | | - |
4204 | if (!recursive) evaluated: !recursive yes Evaluation Count:10789 | yes Evaluation Count:1361 |
| 1361-10789 |
4205 | return; executed: return; Execution Count:10789 | 10789 |
4206 | | - |
4207 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:1582 | yes Evaluation Count:1361 |
| 1361-1582 |
4208 | if (QWidget *child = qobject_cast<QWidget *>(children.at(i))) evaluated: QWidget *child = qobject_cast<QWidget *>(children.at(i)) yes Evaluation Count:1276 | yes Evaluation Count:306 |
| 306-1276 |
4209 | child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); executed: child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); Execution Count:1276 | 1276 |
4210 | } executed: } Execution Count:1582 | 1582 |
4211 | } executed: } Execution Count:1361 | 1361 |
4212 | | - |
4213 | void QWidgetPrivate::activateChildLayoutsRecursively() | - |
4214 | { | - |
4215 | sendPendingMoveAndResizeEvents(false, true); | - |
4216 | | - |
4217 | for (int i = 0; i < children.size(); ++i) { never evaluated: i < children.size() | 0 |
4218 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
4219 | if (!child || child->isHidden() || child->isWindow()) never evaluated: child->isHidden() never evaluated: child->isWindow() | 0 |
4220 | continue; never executed: continue; | 0 |
4221 | | - |
4222 | child->ensurePolished(); | - |
4223 | | - |
4224 | | - |
4225 | QWidgetPrivate *childPrivate = child->d_func(); | - |
4226 | if (childPrivate->layout) never evaluated: childPrivate->layout | 0 |
4227 | childPrivate->layout->activate(); never executed: childPrivate->layout->activate(); | 0 |
4228 | | - |
4229 | | - |
4230 | const bool wasVisible = child->isVisible(); | - |
4231 | if (!wasVisible) never evaluated: !wasVisible | 0 |
4232 | child->setAttribute(Qt::WA_WState_Visible); never executed: child->setAttribute(Qt::WA_WState_Visible); | 0 |
4233 | | - |
4234 | | - |
4235 | childPrivate->activateChildLayoutsRecursively(); | - |
4236 | | - |
4237 | | - |
4238 | if (!wasVisible) never evaluated: !wasVisible | 0 |
4239 | child->setAttribute(Qt::WA_WState_Visible, false); never executed: child->setAttribute(Qt::WA_WState_Visible, false); | 0 |
4240 | } | 0 |
4241 | } | 0 |
4242 | | - |
4243 | void QWidgetPrivate::show_helper() | - |
4244 | { | - |
4245 | QWidget * const q = q_func(); | - |
4246 | data.in_show = true; | - |
4247 | | - |
4248 | sendPendingMoveAndResizeEvents(); | - |
4249 | | - |
4250 | | - |
4251 | q->setAttribute(Qt::WA_WState_Visible); | - |
4252 | | - |
4253 | | - |
4254 | showChildren(false); | - |
4255 | | - |
4256 | | - |
4257 | | - |
4258 | | - |
4259 | | - |
4260 | | - |
4261 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:1533 | yes Evaluation Count:9256 |
| 1533-9256 |
4262 | if ((q->windowType() == Qt::Tool) || (q->windowType() == Qt::Popup) || q->windowType() == Qt::ToolTip) { evaluated: (q->windowType() == Qt::Tool) yes Evaluation Count:13 | yes Evaluation Count:1520 |
evaluated: (q->windowType() == Qt::Popup) yes Evaluation Count:69 | yes Evaluation Count:1451 |
evaluated: q->windowType() == Qt::ToolTip yes Evaluation Count:10 | yes Evaluation Count:1441 |
| 10-1520 |
4263 | q->raise(); | - |
4264 | if (q->parentWidget() && q->parentWidget()->window()->testAttribute(Qt::WA_KeyboardFocusChange)) evaluated: q->parentWidget() yes Evaluation Count:47 | yes Evaluation Count:45 |
evaluated: q->parentWidget()->window()->testAttribute(Qt::WA_KeyboardFocusChange) yes Evaluation Count:1 | yes Evaluation Count:46 |
| 1-47 |
4265 | q->setAttribute(Qt::WA_KeyboardFocusChange); executed: q->setAttribute(Qt::WA_KeyboardFocusChange); Execution Count:1 | 1 |
4266 | } else { executed: } Execution Count:92 | 92 |
4267 | while (QApplication::activePopupWidget()) { evaluated: QApplication::activePopupWidget() yes Evaluation Count:1 | yes Evaluation Count:1441 |
| 1-1441 |
4268 | if (!QApplication::activePopupWidget()->close()) partially evaluated: !QApplication::activePopupWidget()->close() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4269 | break; | 0 |
4270 | } executed: } Execution Count:1 | 1 |
4271 | } executed: } Execution Count:1441 | 1441 |
4272 | } | - |
4273 | | - |
4274 | | - |
4275 | | - |
4276 | bool isEmbedded = false; | - |
4277 | | - |
4278 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:1533 | yes Evaluation Count:9256 |
| 1533-9256 |
4279 | isEmbedded = q->graphicsProxyWidget() ? true : false; evaluated: q->graphicsProxyWidget() yes Evaluation Count:3 | yes Evaluation Count:1530 |
| 3-1530 |
4280 | if (!isEmbedded && !bypassGraphicsProxyWidget(q)) { evaluated: !isEmbedded yes Evaluation Count:1530 | yes Evaluation Count:3 |
evaluated: !bypassGraphicsProxyWidget(q) yes Evaluation Count:1524 | yes Evaluation Count:6 |
| 3-1530 |
4281 | QGraphicsProxyWidget *ancestorProxy = nearestGraphicsProxyWidget(q->parentWidget()); | - |
4282 | if (ancestorProxy) { partially evaluated: ancestorProxy no Evaluation Count:0 | yes Evaluation Count:1524 |
| 0-1524 |
4283 | isEmbedded = true; | - |
4284 | ancestorProxy->d_func()->embedSubWindow(q); | - |
4285 | } | 0 |
4286 | } executed: } Execution Count:1524 | 1524 |
4287 | } executed: } Execution Count:1533 | 1533 |
4288 | QShowEvent showEvent; | - |
4289 | QApplication::sendEvent(q, &showEvent); | - |
4290 | | - |
4291 | show_sys(); | - |
4292 | | - |
4293 | if (!isEmbedded && q->windowType() == Qt::Popup) evaluated: !isEmbedded yes Evaluation Count:10786 | yes Evaluation Count:3 |
evaluated: q->windowType() == Qt::Popup yes Evaluation Count:69 | yes Evaluation Count:10717 |
| 3-10786 |
4294 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q); Execution Count:69 | 69 |
4295 | | - |
4296 | | - |
4297 | if (q->windowType() != Qt::ToolTip) { evaluated: q->windowType() != Qt::ToolTip yes Evaluation Count:10779 | yes Evaluation Count:10 |
| 10-10779 |
4298 | QAccessibleEvent event(q, QAccessible::ObjectShow); | - |
4299 | QAccessible::updateAccessibility(&event); | - |
4300 | } executed: } Execution Count:10779 | 10779 |
4301 | | - |
4302 | | - |
4303 | if (QApplicationPrivate::hidden_focus_widget == q) { evaluated: QApplicationPrivate::hidden_focus_widget == q yes Evaluation Count:2 | yes Evaluation Count:10787 |
| 2-10787 |
4304 | QApplicationPrivate::hidden_focus_widget = 0; | - |
4305 | q->setFocus(Qt::OtherFocusReason); | - |
4306 | } executed: } Execution Count:2 | 2 |
4307 | | - |
4308 | | - |
4309 | | - |
4310 | | - |
4311 | 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:10655 | yes Evaluation Count:134 |
evaluated: q->windowType() == Qt::SplashScreen yes Evaluation Count:1 | yes Evaluation Count:10654 |
| 1-10655 |
4312 | QApplication::processEvents(); executed: QApplication::processEvents(); Execution Count:1 | 1 |
4313 | | - |
4314 | data.in_show = false; | - |
4315 | } executed: } Execution Count:10789 | 10789 |
4316 | void QWidget::hide() | - |
4317 | { | - |
4318 | setVisible(false); | - |
4319 | } executed: } Execution Count:6087 | 6087 |
4320 | | - |
4321 | | - |
4322 | | - |
4323 | void QWidgetPrivate::hide_helper() | - |
4324 | { | - |
4325 | QWidget * const q = q_func(); | - |
4326 | | - |
4327 | bool isEmbedded = false; | - |
4328 | | - |
4329 | isEmbedded = q->isWindow() && !bypassGraphicsProxyWidget(q) && nearestGraphicsProxyWidget(q->parentWidget()) != 0; evaluated: q->isWindow() yes Evaluation Count:1485 | yes Evaluation Count:1248 |
evaluated: !bypassGraphicsProxyWidget(q) yes Evaluation Count:1480 | yes Evaluation Count:5 |
partially evaluated: nearestGraphicsProxyWidget(q->parentWidget()) != 0 no Evaluation Count:0 | yes Evaluation Count:1480 |
| 0-1485 |
4330 | | - |
4331 | | - |
4332 | | - |
4333 | | - |
4334 | if (!isEmbedded && (q->windowType() == Qt::Popup)) partially evaluated: !isEmbedded yes Evaluation Count:2733 | no Evaluation Count:0 |
evaluated: (q->windowType() == Qt::Popup) yes Evaluation Count:67 | yes Evaluation Count:2666 |
| 0-2733 |
4335 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q); Execution Count:67 | 67 |
4336 | | - |
4337 | | - |
4338 | | - |
4339 | | - |
4340 | | - |
4341 | | - |
4342 | | - |
4343 | q->setAttribute(Qt::WA_Mapped, false); | - |
4344 | hide_sys(); | - |
4345 | | - |
4346 | bool wasVisible = q->testAttribute(Qt::WA_WState_Visible); | - |
4347 | | - |
4348 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:2385 | yes Evaluation Count:348 |
| 348-2385 |
4349 | q->setAttribute(Qt::WA_WState_Visible, false); | - |
4350 | | - |
4351 | } executed: } Execution Count:2385 | 2385 |
4352 | | - |
4353 | QHideEvent hideEvent; | - |
4354 | QApplication::sendEvent(q, &hideEvent); | - |
4355 | hideChildren(false); | - |
4356 | | - |
4357 | | - |
4358 | | - |
4359 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:2385 | yes Evaluation Count:348 |
| 348-2385 |
4360 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(q); | - |
4361 | QWidget *fw = QApplication::focusWidget(); | - |
4362 | while (fw && !fw->isWindow()) { evaluated: fw yes Evaluation Count:1018 | yes Evaluation Count:1969 |
evaluated: !fw->isWindow() yes Evaluation Count:772 | yes Evaluation Count:246 |
| 246-1969 |
4363 | if (fw == q) { evaluated: fw == q yes Evaluation Count:170 | yes Evaluation Count:602 |
| 170-602 |
4364 | q->focusNextPrevChild(true); | - |
4365 | break; executed: break; Execution Count:170 | 170 |
4366 | } | - |
4367 | fw = fw->parentWidget(); | - |
4368 | } executed: } Execution Count:602 | 602 |
4369 | } executed: } Execution Count:2385 | 2385 |
4370 | | - |
4371 | if (QWidgetBackingStore *bs = maybeBackingStore()) partially evaluated: QWidgetBackingStore *bs = maybeBackingStore() yes Evaluation Count:2733 | no Evaluation Count:0 |
| 0-2733 |
4372 | bs->removeDirtyWidget(q); executed: bs->removeDirtyWidget(q); Execution Count:2733 | 2733 |
4373 | | - |
4374 | | - |
4375 | if (wasVisible) { evaluated: wasVisible yes Evaluation Count:2385 | yes Evaluation Count:348 |
| 348-2385 |
4376 | QAccessibleEvent event(q, QAccessible::ObjectHide); | - |
4377 | QAccessible::updateAccessibility(&event); | - |
4378 | } executed: } Execution Count:2385 | 2385 |
4379 | | - |
4380 | } executed: } Execution Count:2733 | 2733 |
4381 | void QWidget::setVisible(bool visible) | - |
4382 | { | - |
4383 | if (visible) { evaluated: visible yes Evaluation Count:19467 | yes Evaluation Count:55762 |
| 19467-55762 |
4384 | if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden)) evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:11272 | yes Evaluation Count:8195 |
evaluated: !testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:8010 | yes Evaluation Count:3262 |
| 3262-11272 |
4385 | return; executed: return; Execution Count:8010 | 8010 |
4386 | | - |
4387 | QWidgetPrivate * const d = d_func(); | - |
4388 | | - |
4389 | | - |
4390 | if (!isWindow() && parentWidget() && parentWidget()->isVisible() evaluated: !isWindow() yes Evaluation Count:9920 | yes Evaluation Count:1537 |
partially evaluated: parentWidget() yes Evaluation Count:9920 | no Evaluation Count:0 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:5530 | yes Evaluation Count:4390 |
| 0-9920 |
4391 | && !parentWidget()->testAttribute(Qt::WA_WState_Created)) partially evaluated: !parentWidget()->testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:5530 |
| 0-5530 |
4392 | parentWidget()->window()->d_func()->createRecursively(); never executed: parentWidget()->window()->d_func()->createRecursively(); | 0 |
4393 | | - |
4394 | | - |
4395 | | - |
4396 | QWidget *pw = parentWidget(); | - |
4397 | if (!testAttribute(Qt::WA_WState_Created) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:9768 | yes Evaluation Count:1689 |
| 1689-9768 |
4398 | && (isWindow() || pw->testAttribute(Qt::WA_WState_Created))) { evaluated: isWindow() yes Evaluation Count:1422 | yes Evaluation Count:8346 |
evaluated: pw->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:4382 | yes Evaluation Count:3964 |
| 1422-8346 |
4399 | create(); | - |
4400 | } executed: } Execution Count:5800 | 5800 |
4401 | | - |
4402 | | - |
4403 | | - |
4404 | | - |
4405 | | - |
4406 | | - |
4407 | bool wasResized = testAttribute(Qt::WA_Resized); | - |
4408 | Qt::WindowStates initialWindowState = windowState(); | - |
4409 | | - |
4410 | | - |
4411 | ensurePolished(); | - |
4412 | | - |
4413 | | - |
4414 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - |
4415 | | - |
4416 | bool needUpdateGeometry = !isWindow() && testAttribute(Qt::WA_WState_Hidden); evaluated: !isWindow() yes Evaluation Count:9920 | yes Evaluation Count:1533 |
evaluated: testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:3410 | yes Evaluation Count:6510 |
| 1533-9920 |
4417 | | - |
4418 | setAttribute(Qt::WA_WState_Hidden, false); | - |
4419 | | - |
4420 | if (needUpdateGeometry) evaluated: needUpdateGeometry yes Evaluation Count:3410 | yes Evaluation Count:8043 |
| 3410-8043 |
4421 | d->updateGeometry_helper(true); executed: d->updateGeometry_helper(true); Execution Count:3410 | 3410 |
4422 | | - |
4423 | | - |
4424 | if (d->layout) evaluated: d->layout yes Evaluation Count:2558 | yes Evaluation Count:8895 |
| 2558-8895 |
4425 | d->layout->activate(); executed: d->layout->activate(); Execution Count:2558 | 2558 |
4426 | | - |
4427 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:9920 | yes Evaluation Count:1533 |
| 1533-9920 |
4428 | QWidget *parent = parentWidget(); | - |
4429 | while (parent && parent->isVisible() && parent->d_func()->layout && !parent->data->in_show) { partially evaluated: parent yes Evaluation Count:9990 | no Evaluation Count:0 |
evaluated: parent->isVisible() yes Evaluation Count:5600 | yes Evaluation Count:4390 |
evaluated: parent->d_func()->layout yes Evaluation Count:1987 | yes Evaluation Count:3613 |
evaluated: !parent->data->in_show yes Evaluation Count:173 | yes Evaluation Count:1814 |
| 0-9990 |
4430 | parent->d_func()->layout->activate(); | - |
4431 | if (parent->isWindow()) evaluated: parent->isWindow() yes Evaluation Count:103 | yes Evaluation Count:70 |
| 70-103 |
4432 | break; executed: break; Execution Count:103 | 103 |
4433 | parent = parent->parentWidget(); | - |
4434 | } executed: } Execution Count:70 | 70 |
4435 | if (parent) partially evaluated: parent yes Evaluation Count:9920 | no Evaluation Count:0 |
| 0-9920 |
4436 | parent->d_func()->setDirtyOpaqueRegion(); executed: parent->d_func()->setDirtyOpaqueRegion(); Execution Count:9920 | 9920 |
4437 | } executed: } Execution Count:9920 | 9920 |
4438 | | - |
4439 | | - |
4440 | if (!wasResized evaluated: !wasResized yes Evaluation Count:5127 | yes Evaluation Count:6326 |
| 5127-6326 |
4441 | && (isWindow() || !parentWidget()->d_func()->layout)) { evaluated: isWindow() yes Evaluation Count:1226 | yes Evaluation Count:3901 |
evaluated: !parentWidget()->d_func()->layout yes Evaluation Count:1635 | yes Evaluation Count:2266 |
| 1226-3901 |
4442 | if (isWindow()) { evaluated: isWindow() yes Evaluation Count:1226 | yes Evaluation Count:1635 |
| 1226-1635 |
4443 | adjustSize(); | - |
4444 | if (windowState() != initialWindowState) partially evaluated: windowState() != initialWindowState no Evaluation Count:0 | yes Evaluation Count:1226 |
| 0-1226 |
4445 | setWindowState(initialWindowState); never executed: setWindowState(initialWindowState); | 0 |
4446 | } else { executed: } Execution Count:1226 | 1226 |
4447 | adjustSize(); | - |
4448 | } executed: } Execution Count:1635 | 1635 |
4449 | setAttribute(Qt::WA_Resized, false); | - |
4450 | } executed: } Execution Count:2861 | 2861 |
4451 | | - |
4452 | setAttribute(Qt::WA_KeyboardFocusChange, false); | - |
4453 | | - |
4454 | if (isWindow() || parentWidget()->isVisible()) { evaluated: isWindow() yes Evaluation Count:1533 | yes Evaluation Count:9920 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:5530 | yes Evaluation Count:4390 |
| 1533-9920 |
4455 | d->show_helper(); | - |
4456 | | - |
4457 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - |
4458 | } executed: } Execution Count:7063 | 7063 |
4459 | | - |
4460 | QEvent showToParentEvent(QEvent::ShowToParent); | - |
4461 | QApplication::sendEvent(this, &showToParentEvent); | - |
4462 | } else { executed: } Execution Count:11453 | 11453 |
4463 | if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden)) evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:46548 | yes Evaluation Count:9214 |
evaluated: testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:42527 | yes Evaluation Count:4021 |
| 4021-46548 |
4464 | return; executed: return; Execution Count:42527 | 42527 |
4465 | if (QApplicationPrivate::hidden_focus_widget == this) partially evaluated: QApplicationPrivate::hidden_focus_widget == this no Evaluation Count:0 | yes Evaluation Count:13235 |
| 0-13235 |
4466 | QApplicationPrivate::hidden_focus_widget = 0; never executed: QApplicationPrivate::hidden_focus_widget = 0; | 0 |
4467 | | - |
4468 | QWidgetPrivate * const d = d_func(); | - |
4469 | | - |
4470 | | - |
4471 | | - |
4472 | | - |
4473 | | - |
4474 | if (!isWindow() && parentWidget()) evaluated: !isWindow() yes Evaluation Count:11426 | yes Evaluation Count:1809 |
partially evaluated: parentWidget() yes Evaluation Count:11426 | no Evaluation Count:0 |
| 0-11426 |
4475 | parentWidget()->d_func()->setDirtyOpaqueRegion(); executed: parentWidget()->d_func()->setDirtyOpaqueRegion(); Execution Count:11426 | 11426 |
4476 | | - |
4477 | setAttribute(Qt::WA_WState_Hidden); | - |
4478 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - |
4479 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:2733 | yes Evaluation Count:10502 |
| 2733-10502 |
4480 | d->hide_helper(); executed: d->hide_helper(); Execution Count:2733 | 2733 |
4481 | | - |
4482 | | - |
4483 | if (!isWindow() && parentWidget()) { evaluated: !isWindow() yes Evaluation Count:11426 | yes Evaluation Count:1809 |
partially evaluated: parentWidget() yes Evaluation Count:11426 | no Evaluation Count:0 |
| 0-11426 |
4484 | if (parentWidget()->d_func()->layout) evaluated: parentWidget()->d_func()->layout yes Evaluation Count:1850 | yes Evaluation Count:9576 |
| 1850-9576 |
4485 | parentWidget()->d_func()->layout->invalidate(); executed: parentWidget()->d_func()->layout->invalidate(); Execution Count:1850 | 1850 |
4486 | else if (parentWidget()->isVisible()) evaluated: parentWidget()->isVisible() yes Evaluation Count:749 | yes Evaluation Count:8827 |
| 749-8827 |
4487 | QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); executed: QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); Execution Count:749 | 749 |
4488 | } | - |
4489 | | - |
4490 | QEvent hideToParentEvent(QEvent::HideToParent); | - |
4491 | QApplication::sendEvent(this, &hideToParentEvent); | - |
4492 | } executed: } Execution Count:13235 | 13235 |
4493 | } | - |
4494 | | - |
4495 | | - |
4496 | | - |
4497 | | - |
4498 | void QWidget::setHidden(bool hidden) | - |
4499 | { | - |
4500 | setVisible(!hidden); | - |
4501 | } executed: } Execution Count:5819 | 5819 |
4502 | | - |
4503 | void QWidgetPrivate::_q_showIfNotHidden() | - |
4504 | { | - |
4505 | QWidget * const q = q_func(); | - |
4506 | if ( !(q->isHidden() && q->testAttribute(Qt::WA_WState_ExplicitShowHide)) ) evaluated: q->isHidden() yes Evaluation Count:16 | yes Evaluation Count:12 |
evaluated: q->testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:4 | yes Evaluation Count:12 |
| 4-16 |
4507 | q->setVisible(true); executed: q->setVisible(true); Execution Count:24 | 24 |
4508 | } executed: } Execution Count:28 | 28 |
4509 | | - |
4510 | void QWidgetPrivate::showChildren(bool spontaneous) | - |
4511 | { | - |
4512 | QList<QObject*> childList = children; | - |
4513 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:19058 | yes Evaluation Count:10789 |
| 10789-19058 |
4514 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - |
4515 | if (!widget evaluated: !widget yes Evaluation Count:5741 | yes Evaluation Count:13317 |
| 5741-13317 |
4516 | || widget->isWindow() evaluated: widget->isWindow() yes Evaluation Count:723 | yes Evaluation Count:12594 |
| 723-12594 |
4517 | || widget->testAttribute(Qt::WA_WState_Hidden)) evaluated: widget->testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:4770 | yes Evaluation Count:7824 |
| 4770-7824 |
4518 | continue; executed: continue; Execution Count:11234 | 11234 |
4519 | if (spontaneous) { partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:7824 |
| 0-7824 |
4520 | widget->setAttribute(Qt::WA_Mapped); | - |
4521 | widget->d_func()->showChildren(true); | - |
4522 | QShowEvent e; | - |
4523 | QApplication::sendSpontaneousEvent(widget, &e); | - |
4524 | } else { | 0 |
4525 | if (widget->testAttribute(Qt::WA_WState_ExplicitShowHide)) evaluated: widget->testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:3726 | yes Evaluation Count:4098 |
| 3726-4098 |
4526 | widget->d_func()->show_recursive(); executed: widget->d_func()->show_recursive(); Execution Count:3726 | 3726 |
4527 | else | - |
4528 | widget->show(); executed: widget->show(); Execution Count:4098 | 4098 |
4529 | } | - |
4530 | } | - |
4531 | } executed: } Execution Count:10789 | 10789 |
4532 | | - |
4533 | void QWidgetPrivate::hideChildren(bool spontaneous) | - |
4534 | { | - |
4535 | QList<QObject*> childList = children; | - |
4536 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:18479 | yes Evaluation Count:10570 |
| 10570-18479 |
4537 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - |
4538 | if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) evaluated: !widget yes Evaluation Count:5545 | yes Evaluation Count:12934 |
evaluated: widget->isWindow() yes Evaluation Count:760 | yes Evaluation Count:12174 |
evaluated: widget->testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:4337 | yes Evaluation Count:7837 |
| 760-12934 |
4539 | continue; executed: continue; Execution Count:10642 | 10642 |
4540 | if (spontaneous) partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:7837 |
| 0-7837 |
4541 | widget->setAttribute(Qt::WA_Mapped, false); never executed: widget->setAttribute(Qt::WA_Mapped, false); | 0 |
4542 | else | - |
4543 | widget->setAttribute(Qt::WA_WState_Visible, false); executed: widget->setAttribute(Qt::WA_WState_Visible, false); Execution Count:7837 | 7837 |
4544 | widget->d_func()->hideChildren(spontaneous); | - |
4545 | QHideEvent e; | - |
4546 | if (spontaneous) { partially evaluated: spontaneous no Evaluation Count:0 | yes Evaluation Count:7837 |
| 0-7837 |
4547 | QApplication::sendSpontaneousEvent(widget, &e); | - |
4548 | } else { | 0 |
4549 | QApplication::sendEvent(widget, &e); | - |
4550 | if (widget->internalWinId() evaluated: widget->internalWinId() yes Evaluation Count:4 | yes Evaluation Count:7833 |
| 4-7833 |
4551 | && widget->testAttribute(Qt::WA_DontCreateNativeAncestors)) { partially evaluated: widget->testAttribute(Qt::WA_DontCreateNativeAncestors) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
4552 | | - |
4553 | | - |
4554 | widget->d_func()->hide_sys(); | - |
4555 | } | 0 |
4556 | } executed: } Execution Count:7837 | 7837 |
4557 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(widget); | - |
4558 | | - |
4559 | if (!spontaneous) { partially evaluated: !spontaneous yes Evaluation Count:7837 | no Evaluation Count:0 |
| 0-7837 |
4560 | QAccessibleEvent event(widget, QAccessible::ObjectHide); | - |
4561 | QAccessible::updateAccessibility(&event); | - |
4562 | } executed: } Execution Count:7837 | 7837 |
4563 | | - |
4564 | } executed: } Execution Count:7837 | 7837 |
4565 | } executed: } Execution Count:10570 | 10570 |
4566 | | - |
4567 | bool QWidgetPrivate::close_helper(CloseMode mode) | - |
4568 | { | - |
4569 | if (data.is_closing) evaluated: data.is_closing yes Evaluation Count:24 | yes Evaluation Count:1335 |
| 24-1335 |
4570 | return true; executed: return true; Execution Count:24 | 24 |
4571 | | - |
4572 | QWidget * const q = q_func(); | - |
4573 | data.is_closing = 1; | - |
4574 | | - |
4575 | QPointer<QWidget> that = q; | - |
4576 | QPointer<QWidget> parentWidget = q->parentWidget(); | - |
4577 | | - |
4578 | bool quitOnClose = q->testAttribute(Qt::WA_QuitOnClose); | - |
4579 | if (mode != CloseNoEvent) { evaluated: mode != CloseNoEvent yes Evaluation Count:115 | yes Evaluation Count:1220 |
| 115-1220 |
4580 | QCloseEvent e; | - |
4581 | if (mode == CloseWithSpontaneousEvent) partially evaluated: mode == CloseWithSpontaneousEvent no Evaluation Count:0 | yes Evaluation Count:115 |
| 0-115 |
4582 | QApplication::sendSpontaneousEvent(q, &e); never executed: QApplication::sendSpontaneousEvent(q, &e); | 0 |
4583 | else | - |
4584 | QApplication::sendEvent(q, &e); executed: QApplication::sendEvent(q, &e); Execution Count:115 | 115 |
4585 | if (!that.isNull() && !e.isAccepted()) { partially evaluated: !that.isNull() yes Evaluation Count:115 | no Evaluation Count:0 |
evaluated: !e.isAccepted() yes Evaluation Count:6 | yes Evaluation Count:109 |
| 0-115 |
4586 | data.is_closing = 0; | - |
4587 | return false; executed: return false; Execution Count:6 | 6 |
4588 | } | - |
4589 | } executed: } Execution Count:109 | 109 |
4590 | | - |
4591 | if (!that.isNull() && !q->isHidden()) partially evaluated: !that.isNull() yes Evaluation Count:1329 | no Evaluation Count:0 |
evaluated: !q->isHidden() yes Evaluation Count:1220 | yes Evaluation Count:109 |
| 0-1329 |
4592 | q->hide(); executed: q->hide(); Execution Count:1220 | 1220 |
4593 | | - |
4594 | | - |
4595 | quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible()); evaluated: quitOnClose yes Evaluation Count:1272 | yes Evaluation Count:57 |
evaluated: parentWidget.isNull() yes Evaluation Count:1200 | yes Evaluation Count:72 |
evaluated: !parentWidget->isVisible() yes Evaluation Count:32 | yes Evaluation Count:40 |
| 32-1272 |
4596 | | - |
4597 | if (quitOnClose) { evaluated: quitOnClose yes Evaluation Count:1232 | yes Evaluation Count:97 |
| 97-1232 |
4598 | | - |
4599 | | - |
4600 | | - |
4601 | QWidgetList list = QApplication::topLevelWidgets(); | - |
4602 | bool lastWindowClosed = true; | - |
4603 | for (int i = 0; i < list.size(); ++i) { evaluated: i < list.size() yes Evaluation Count:2214 | yes Evaluation Count:956 |
| 956-2214 |
4604 | QWidget *w = list.at(i); | - |
4605 | if (!w->isVisible() || w->parentWidget() || !w->testAttribute(Qt::WA_QuitOnClose)) evaluated: !w->isVisible() yes Evaluation Count:1933 | yes Evaluation Count:281 |
evaluated: w->parentWidget() yes Evaluation Count:4 | yes Evaluation Count:277 |
evaluated: !w->testAttribute(Qt::WA_QuitOnClose) yes Evaluation Count:1 | yes Evaluation Count:276 |
| 1-1933 |
4606 | continue; executed: continue; Execution Count:1938 | 1938 |
4607 | lastWindowClosed = false; | - |
4608 | break; executed: break; Execution Count:276 | 276 |
4609 | } | - |
4610 | if (lastWindowClosed) { evaluated: lastWindowClosed yes Evaluation Count:956 | yes Evaluation Count:276 |
| 276-956 |
4611 | QGuiApplicationPrivate::emitLastWindowClosed(); | - |
4612 | QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance())); | - |
4613 | applicationPrivate->maybeQuit(); | - |
4614 | } executed: } Execution Count:956 | 956 |
4615 | } executed: } Execution Count:1232 | 1232 |
4616 | | - |
4617 | | - |
4618 | if (!that.isNull()) { partially evaluated: !that.isNull() yes Evaluation Count:1329 | no Evaluation Count:0 |
| 0-1329 |
4619 | data.is_closing = 0; | - |
4620 | if (q->testAttribute(Qt::WA_DeleteOnClose)) { evaluated: q->testAttribute(Qt::WA_DeleteOnClose) yes Evaluation Count:39 | yes Evaluation Count:1290 |
| 39-1290 |
4621 | q->setAttribute(Qt::WA_DeleteOnClose, false); | - |
4622 | q->deleteLater(); | - |
4623 | } executed: } Execution Count:39 | 39 |
4624 | } executed: } Execution Count:1329 | 1329 |
4625 | return true; executed: return true; Execution Count:1329 | 1329 |
4626 | } | - |
4627 | bool QWidget::close() | - |
4628 | { | - |
4629 | return d_func()->close_helper(QWidgetPrivate::CloseWithEvent); executed: return d_func()->close_helper(QWidgetPrivate::CloseWithEvent); Execution Count:115 | 115 |
4630 | } | - |
4631 | bool QWidget::isVisibleTo(const QWidget *ancestor) const | - |
4632 | { | - |
4633 | if (!ancestor) partially evaluated: !ancestor no Evaluation Count:0 | yes Evaluation Count:1764 |
| 0-1764 |
4634 | return isVisible(); never executed: return isVisible(); | 0 |
4635 | const QWidget * w = this; | - |
4636 | while (!w->isHidden() evaluated: !w->isHidden() yes Evaluation Count:3035 | yes Evaluation Count:822 |
| 822-3035 |
4637 | && !w->isWindow() evaluated: !w->isWindow() yes Evaluation Count:2678 | yes Evaluation Count:357 |
| 357-2678 |
4638 | && w->parentWidget() partially evaluated: w->parentWidget() yes Evaluation Count:2678 | no Evaluation Count:0 |
| 0-2678 |
4639 | && w->parentWidget() != ancestor) evaluated: w->parentWidget() != ancestor yes Evaluation Count:2093 | yes Evaluation Count:585 |
| 585-2093 |
4640 | w = w->parentWidget(); executed: w = w->parentWidget(); Execution Count:2093 | 2093 |
4641 | return !w->isHidden(); executed: return !w->isHidden(); Execution Count:1764 | 1764 |
4642 | } | - |
4643 | QRegion QWidget::visibleRegion() const | - |
4644 | { | - |
4645 | const QWidgetPrivate * const d = d_func(); | - |
4646 | | - |
4647 | QRect clipRect = d->clipRect(); | - |
4648 | if (clipRect.isEmpty()) never evaluated: clipRect.isEmpty() | 0 |
4649 | return QRegion(); never executed: return QRegion(); | 0 |
4650 | QRegion r(clipRect); | - |
4651 | d->subtractOpaqueChildren(r, clipRect); | - |
4652 | d->subtractOpaqueSiblings(r); | - |
4653 | return r; never executed: return r; | 0 |
4654 | } | - |
4655 | | - |
4656 | | - |
4657 | QSize QWidgetPrivate::adjustedSize() const | - |
4658 | { | - |
4659 | const QWidget * const q = q_func(); | - |
4660 | | - |
4661 | QSize s = q->sizeHint(); | - |
4662 | | - |
4663 | if (q->isWindow()) { evaluated: q->isWindow() yes Evaluation Count:1407 | yes Evaluation Count:1641 |
| 1407-1641 |
4664 | Qt::Orientations exp; | - |
4665 | if (layout) { evaluated: layout yes Evaluation Count:257 | yes Evaluation Count:1150 |
| 257-1150 |
4666 | if (layout->hasHeightForWidth()) evaluated: layout->hasHeightForWidth() yes Evaluation Count:15 | yes Evaluation Count:242 |
| 15-242 |
4667 | s.setHeight(layout->totalHeightForWidth(s.width())); executed: s.setHeight(layout->totalHeightForWidth(s.width())); Execution Count:15 | 15 |
4668 | exp = layout->expandingDirections(); | - |
4669 | } else executed: } Execution Count:257 | 257 |
4670 | { | - |
4671 | if (q->sizePolicy().hasHeightForWidth()) evaluated: q->sizePolicy().hasHeightForWidth() yes Evaluation Count:1 | yes Evaluation Count:1149 |
| 1-1149 |
4672 | s.setHeight(q->heightForWidth(s.width())); executed: s.setHeight(q->heightForWidth(s.width())); Execution Count:1 | 1 |
4673 | exp = q->sizePolicy().expandingDirections(); | - |
4674 | } executed: } Execution Count:1150 | 1150 |
4675 | if (exp & Qt::Horizontal) evaluated: exp & Qt::Horizontal yes Evaluation Count:727 | yes Evaluation Count:680 |
| 680-727 |
4676 | s.setWidth(qMax(s.width(), 200)); executed: s.setWidth(qMax(s.width(), 200)); Execution Count:727 | 727 |
4677 | if (exp & Qt::Vertical) evaluated: exp & Qt::Vertical yes Evaluation Count:637 | yes Evaluation Count:770 |
| 637-770 |
4678 | s.setHeight(qMax(s.height(), 100)); executed: s.setHeight(qMax(s.height(), 100)); Execution Count:637 | 637 |
4679 | | - |
4680 | | - |
4681 | | - |
4682 | QRect screen = QApplication::desktop()->screenGeometry(q->pos()); | - |
4683 | | - |
4684 | | - |
4685 | | - |
4686 | | - |
4687 | | - |
4688 | s.setWidth(qMin(s.width(), screen.width()*2/3)); | - |
4689 | s.setHeight(qMin(s.height(), screen.height()*2/3)); | - |
4690 | | - |
4691 | if (QTLWExtra *extra = maybeTopData()) evaluated: QTLWExtra *extra = maybeTopData() yes Evaluation Count:1266 | yes Evaluation Count:141 |
| 141-1266 |
4692 | extra->sizeAdjusted = true; executed: extra->sizeAdjusted = true; Execution Count:1266 | 1266 |
4693 | } executed: } Execution Count:1407 | 1407 |
4694 | | - |
4695 | if (!s.isValid()) { evaluated: !s.isValid() yes Evaluation Count:607 | yes Evaluation Count:2441 |
| 607-2441 |
4696 | QRect r = q->childrenRect(); | - |
4697 | if (r.isNull()) evaluated: r.isNull() yes Evaluation Count:494 | yes Evaluation Count:113 |
| 113-494 |
4698 | return s; executed: return s; Execution Count:494 | 494 |
4699 | s = r.size() + QSize(2 * r.x(), 2 * r.y()); | - |
4700 | } executed: } Execution Count:113 | 113 |
4701 | | - |
4702 | return s; executed: return s; Execution Count:2554 | 2554 |
4703 | } | - |
4704 | void QWidget::adjustSize() | - |
4705 | { | - |
4706 | QWidgetPrivate * const d = d_func(); | - |
4707 | ensurePolished(); | - |
4708 | QSize s = d->adjustedSize(); | - |
4709 | | - |
4710 | if (d->layout) evaluated: d->layout yes Evaluation Count:798 | yes Evaluation Count:2250 |
| 798-2250 |
4711 | d->layout->activate(); executed: d->layout->activate(); Execution Count:798 | 798 |
4712 | | - |
4713 | if (s.isValid()) evaluated: s.isValid() yes Evaluation Count:2554 | yes Evaluation Count:494 |
| 494-2554 |
4714 | resize(s); executed: resize(s); Execution Count:2554 | 2554 |
4715 | } executed: } Execution Count:3048 | 3048 |
4716 | QSize QWidget::sizeHint() const | - |
4717 | { | - |
4718 | const QWidgetPrivate * const d = d_func(); | - |
4719 | if (d->layout) evaluated: d->layout yes Evaluation Count:7256 | yes Evaluation Count:10090 |
| 7256-10090 |
4720 | return d->layout->totalSizeHint(); executed: return d->layout->totalSizeHint(); Execution Count:7256 | 7256 |
4721 | return QSize(-1, -1); executed: return QSize(-1, -1); Execution Count:10090 | 10090 |
4722 | } | - |
4723 | QSize QWidget::minimumSizeHint() const | - |
4724 | { | - |
4725 | const QWidgetPrivate * const d = d_func(); | - |
4726 | if (d->layout) evaluated: d->layout yes Evaluation Count:2489 | yes Evaluation Count:10560 |
| 2489-10560 |
4727 | return d->layout->totalMinimumSize(); executed: return d->layout->totalMinimumSize(); Execution Count:2489 | 2489 |
4728 | return QSize(-1, -1); executed: return QSize(-1, -1); Execution Count:10560 | 10560 |
4729 | } | - |
4730 | bool QWidget::isAncestorOf(const QWidget *child) const | - |
4731 | { | - |
4732 | while (child) { evaluated: child yes Evaluation Count:71936 | yes Evaluation Count:31354 |
| 31354-71936 |
4733 | if (child == this) evaluated: child == this yes Evaluation Count:5433 | yes Evaluation Count:66503 |
| 5433-66503 |
4734 | return true; executed: return true; Execution Count:5433 | 5433 |
4735 | if (child->isWindow()) evaluated: child->isWindow() yes Evaluation Count:16650 | yes Evaluation Count:49853 |
| 16650-49853 |
4736 | return false; executed: return false; Execution Count:16650 | 16650 |
4737 | child = child->parentWidget(); | - |
4738 | } executed: } Execution Count:49853 | 49853 |
4739 | return false; executed: return false; Execution Count:31354 | 31354 |
4740 | } | - |
4741 | bool QWidget::event(QEvent *event) | - |
4742 | { | - |
4743 | QWidgetPrivate * const d = d_func(); | - |
4744 | | - |
4745 | | - |
4746 | if (!isEnabled()) { evaluated: !isEnabled() yes Evaluation Count:4742 | yes Evaluation Count:413294 |
| 4742-413294 |
4747 | switch(event->type()) { | - |
4748 | case QEvent::TabletPress: | - |
4749 | case QEvent::TabletRelease: | - |
4750 | case QEvent::TabletMove: | - |
4751 | case QEvent::MouseButtonPress: | - |
4752 | case QEvent::MouseButtonRelease: | - |
4753 | case QEvent::MouseButtonDblClick: | - |
4754 | case QEvent::MouseMove: | - |
4755 | case QEvent::TouchBegin: | - |
4756 | case QEvent::TouchUpdate: | - |
4757 | case QEvent::TouchEnd: | - |
4758 | case QEvent::TouchCancel: | - |
4759 | case QEvent::ContextMenu: | - |
4760 | case QEvent::KeyPress: | - |
4761 | case QEvent::KeyRelease: | - |
4762 | | - |
4763 | case QEvent::Wheel: | - |
4764 | | - |
4765 | return false; executed: return false; Execution Count:3 | 3 |
4766 | default: | - |
4767 | break; executed: break; Execution Count:4739 | 4739 |
4768 | } | - |
4769 | } executed: } Execution Count:4739 | 4739 |
4770 | switch (event->type()) { | - |
4771 | case QEvent::MouseMove: | - |
4772 | mouseMoveEvent((QMouseEvent*)event); | - |
4773 | break; executed: break; Execution Count:428 | 428 |
4774 | | - |
4775 | case QEvent::MouseButtonPress: | - |
4776 | mousePressEvent((QMouseEvent*)event); | - |
4777 | break; executed: break; Execution Count:6309 | 6309 |
4778 | | - |
4779 | case QEvent::MouseButtonRelease: | - |
4780 | mouseReleaseEvent((QMouseEvent*)event); | - |
4781 | break; executed: break; Execution Count:6270 | 6270 |
4782 | | - |
4783 | case QEvent::MouseButtonDblClick: | - |
4784 | mouseDoubleClickEvent((QMouseEvent*)event); | - |
4785 | break; executed: break; Execution Count:135 | 135 |
4786 | | - |
4787 | case QEvent::Wheel: | - |
4788 | wheelEvent((QWheelEvent*)event); | - |
4789 | break; executed: break; Execution Count:20 | 20 |
4790 | | - |
4791 | | - |
4792 | case QEvent::TabletMove: | - |
4793 | case QEvent::TabletPress: | - |
4794 | case QEvent::TabletRelease: | - |
4795 | tabletEvent((QTabletEvent*)event); | - |
4796 | break; | 0 |
4797 | | - |
4798 | case QEvent::KeyPress: { | - |
4799 | QKeyEvent *k = (QKeyEvent *)event; | - |
4800 | bool res = false; | - |
4801 | if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { evaluated: !(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier)) yes Evaluation Count:4795 | yes Evaluation Count:125 |
| 125-4795 |
4802 | if (k->key() == Qt::Key_Backtab evaluated: k->key() == Qt::Key_Backtab yes Evaluation Count:20 | yes Evaluation Count:4775 |
| 20-4775 |
4803 | || (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier))) evaluated: k->key() == Qt::Key_Tab yes Evaluation Count:128 | yes Evaluation Count:4647 |
evaluated: (k->modifiers() & Qt::ShiftModifier) yes Evaluation Count:11 | yes Evaluation Count:117 |
| 11-4647 |
4804 | res = focusNextPrevChild(false); executed: res = focusNextPrevChild(false); Execution Count:31 | 31 |
4805 | else if (k->key() == Qt::Key_Tab) evaluated: k->key() == Qt::Key_Tab yes Evaluation Count:117 | yes Evaluation Count:4647 |
| 117-4647 |
4806 | res = focusNextPrevChild(true); executed: res = focusNextPrevChild(true); Execution Count:117 | 117 |
4807 | if (res) evaluated: res yes Evaluation Count:36 | yes Evaluation Count:4759 |
| 36-4759 |
4808 | break; executed: break; Execution Count:36 | 36 |
4809 | } executed: } Execution Count:4759 | 4759 |
4810 | keyPressEvent(k); | - |
4811 | if (!k->isAccepted() evaluated: !k->isAccepted() yes Evaluation Count:808 | yes Evaluation Count:4075 |
| 808-4075 |
4812 | && k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1 evaluated: k->modifiers() & Qt::ShiftModifier yes Evaluation Count:130 | yes Evaluation Count:678 |
partially evaluated: k->key() == Qt::Key_F1 no Evaluation Count:0 | yes Evaluation Count:130 |
| 0-678 |
4813 | && d->whatsThis.size()) { never evaluated: d->whatsThis.size() | 0 |
4814 | QWhatsThis::showText(mapToGlobal(inputMethodQuery(Qt::ImCursorRectangle).toRect().center()), d->whatsThis, this); | - |
4815 | k->accept(); | - |
4816 | } | 0 |
4817 | | - |
4818 | } | - |
4819 | break; executed: break; Execution Count:4883 | 4883 |
4820 | | - |
4821 | case QEvent::KeyRelease: | - |
4822 | keyReleaseEvent((QKeyEvent*)event); | - |
4823 | | - |
4824 | case QEvent::ShortcutOverride: | - |
4825 | break; executed: break; Execution Count:11007 | 11007 |
4826 | | - |
4827 | case QEvent::InputMethod: | - |
4828 | inputMethodEvent((QInputMethodEvent *) event); | - |
4829 | break; | 0 |
4830 | | - |
4831 | case QEvent::InputMethodQuery: | - |
4832 | if (testAttribute(Qt::WA_InputMethodEnabled)) { evaluated: testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:815 | yes Evaluation Count:1438 |
| 815-1438 |
4833 | QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(event); | - |
4834 | Qt::InputMethodQueries queries = query->queries(); | - |
4835 | for (uint i = 0; i < 32; ++i) { evaluated: i < 32 yes Evaluation Count:26080 | yes Evaluation Count:815 |
| 815-26080 |
4836 | Qt::InputMethodQuery q = (Qt::InputMethodQuery)(int)(queries & (1<<i)); | - |
4837 | if (q) { evaluated: q yes Evaluation Count:815 | yes Evaluation Count:25265 |
| 815-25265 |
4838 | QVariant v = inputMethodQuery(q); | - |
4839 | if (q == Qt::ImEnabled && !v.isValid() && isEnabled()) partially evaluated: q == Qt::ImEnabled yes Evaluation Count:815 | no Evaluation Count:0 |
partially evaluated: !v.isValid() yes Evaluation Count:815 | no Evaluation Count:0 |
partially evaluated: isEnabled() yes Evaluation Count:815 | no Evaluation Count:0 |
| 0-815 |
4840 | v = QVariant(true); executed: v = QVariant(true); Execution Count:815 | 815 |
4841 | query->setValue(q, v); | - |
4842 | } executed: } Execution Count:815 | 815 |
4843 | } executed: } Execution Count:26080 | 26080 |
4844 | query->accept(); | - |
4845 | } executed: } Execution Count:815 | 815 |
4846 | break; executed: break; Execution Count:2253 | 2253 |
4847 | | - |
4848 | case QEvent::PolishRequest: | - |
4849 | ensurePolished(); | - |
4850 | break; executed: break; Execution Count:8065 | 8065 |
4851 | | - |
4852 | case QEvent::Polish: { | - |
4853 | style()->polish(this); | - |
4854 | setAttribute(Qt::WA_WState_Polished); | - |
4855 | if (!QApplication::font(this).isCopyOf(QApplication::font())) evaluated: !QApplication::font(this).isCopyOf(QApplication::font()) yes Evaluation Count:2 | yes Evaluation Count:26640 |
| 2-26640 |
4856 | d->resolveFont(); executed: d->resolveFont(); Execution Count:2 | 2 |
4857 | if (!QApplication::palette(this).isCopyOf(QApplication::palette())) evaluated: !QApplication::palette(this).isCopyOf(QApplication::palette()) yes Evaluation Count:2 | yes Evaluation Count:26640 |
| 2-26640 |
4858 | d->resolvePalette(); executed: d->resolvePalette(); Execution Count:2 | 2 |
4859 | } | - |
4860 | break; executed: break; Execution Count:26642 | 26642 |
4861 | | - |
4862 | case QEvent::ApplicationWindowIconChange: | - |
4863 | if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon)) { never evaluated: isWindow() never evaluated: !testAttribute(Qt::WA_SetWindowIcon) | 0 |
4864 | d->setWindowIcon_sys(); | - |
4865 | d->setWindowIcon_helper(); | - |
4866 | } | 0 |
4867 | break; | 0 |
4868 | case QEvent::FocusIn: | - |
4869 | focusInEvent((QFocusEvent*)event); | - |
4870 | d->updateWidgetTransform(); | - |
4871 | break; executed: break; Execution Count:1186 | 1186 |
4872 | | - |
4873 | case QEvent::FocusOut: | - |
4874 | focusOutEvent((QFocusEvent*)event); | - |
4875 | break; executed: break; Execution Count:904 | 904 |
4876 | | - |
4877 | case QEvent::Enter: | - |
4878 | | - |
4879 | if (d->statusTip.size()) { partially evaluated: d->statusTip.size() no Evaluation Count:0 | yes Evaluation Count:1412 |
| 0-1412 |
4880 | QStatusTipEvent tip(d->statusTip); | - |
4881 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - |
4882 | } | 0 |
4883 | | - |
4884 | enterEvent(event); | - |
4885 | break; executed: break; Execution Count:1412 | 1412 |
4886 | | - |
4887 | case QEvent::Leave: | - |
4888 | | - |
4889 | if (d->statusTip.size()) { partially evaluated: d->statusTip.size() no Evaluation Count:0 | yes Evaluation Count:697 |
| 0-697 |
4890 | QString empty; | - |
4891 | QStatusTipEvent tip(empty); | - |
4892 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - |
4893 | } | 0 |
4894 | | - |
4895 | leaveEvent(event); | - |
4896 | break; executed: break; Execution Count:697 | 697 |
4897 | | - |
4898 | case QEvent::HoverEnter: | - |
4899 | case QEvent::HoverLeave: | - |
4900 | update(); | - |
4901 | break; executed: break; Execution Count:5 | 5 |
4902 | | - |
4903 | case QEvent::Paint: | - |
4904 | | - |
4905 | | - |
4906 | | - |
4907 | paintEvent((QPaintEvent*)event); | - |
4908 | break; executed: break; Execution Count:7989 | 7989 |
4909 | | - |
4910 | case QEvent::Move: | - |
4911 | moveEvent((QMoveEvent*)event); | - |
4912 | d->updateWidgetTransform(); | - |
4913 | break; executed: break; Execution Count:9450 | 9450 |
4914 | | - |
4915 | case QEvent::Resize: | - |
4916 | resizeEvent((QResizeEvent*)event); | - |
4917 | d->updateWidgetTransform(); | - |
4918 | break; executed: break; Execution Count:9859 | 9859 |
4919 | | - |
4920 | case QEvent::Close: | - |
4921 | closeEvent((QCloseEvent *)event); | - |
4922 | break; executed: break; Execution Count:115 | 115 |
4923 | | - |
4924 | | - |
4925 | case QEvent::ContextMenu: | - |
4926 | switch (data->context_menu_policy) { | - |
4927 | case Qt::PreventContextMenu: | - |
4928 | break; | 0 |
4929 | case Qt::DefaultContextMenu: | - |
4930 | contextMenuEvent(static_cast<QContextMenuEvent *>(event)); | - |
4931 | break; executed: break; Execution Count:1 | 1 |
4932 | case Qt::CustomContextMenu: | - |
4933 | customContextMenuRequested(static_cast<QContextMenuEvent *>(event)->pos()); | - |
4934 | break; | 0 |
4935 | | - |
4936 | case Qt::ActionsContextMenu: | - |
4937 | if (d->actions.count()) { never evaluated: d->actions.count() | 0 |
4938 | QMenu::exec(d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(), | - |
4939 | 0, this); | - |
4940 | break; | 0 |
4941 | } | - |
4942 | | - |
4943 | | - |
4944 | default: code before this statement never executed: default: | 0 |
4945 | event->ignore(); | - |
4946 | break; | 0 |
4947 | } | - |
4948 | break; executed: break; Execution Count:1 | 1 |
4949 | | - |
4950 | | - |
4951 | | - |
4952 | case QEvent::Drop: | - |
4953 | dropEvent((QDropEvent*) event); | - |
4954 | break; executed: break; Execution Count:2 | 2 |
4955 | | - |
4956 | case QEvent::DragEnter: | - |
4957 | dragEnterEvent((QDragEnterEvent*) event); | - |
4958 | break; executed: break; Execution Count:3 | 3 |
4959 | | - |
4960 | case QEvent::DragMove: | - |
4961 | dragMoveEvent((QDragMoveEvent*) event); | - |
4962 | break; executed: break; Execution Count:5 | 5 |
4963 | | - |
4964 | case QEvent::DragLeave: | - |
4965 | dragLeaveEvent((QDragLeaveEvent*) event); | - |
4966 | break; executed: break; Execution Count:1 | 1 |
4967 | | - |
4968 | | - |
4969 | case QEvent::Show: | - |
4970 | showEvent((QShowEvent*) event); | - |
4971 | break; executed: break; Execution Count:10789 | 10789 |
4972 | | - |
4973 | case QEvent::Hide: | - |
4974 | hideEvent((QHideEvent*) event); | - |
4975 | break; executed: break; Execution Count:10570 | 10570 |
4976 | | - |
4977 | case QEvent::ShowWindowRequest: | - |
4978 | if (!isHidden()) never evaluated: !isHidden() | 0 |
4979 | d->show_sys(); never executed: d->show_sys(); | 0 |
4980 | break; | 0 |
4981 | | - |
4982 | case QEvent::ApplicationFontChange: | - |
4983 | d->resolveFont(); | - |
4984 | break; executed: break; Execution Count:8 | 8 |
4985 | case QEvent::ApplicationPaletteChange: | - |
4986 | if (!(windowType() == Qt::Desktop)) partially evaluated: !(windowType() == Qt::Desktop) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4987 | d->resolvePalette(); executed: d->resolvePalette(); Execution Count:1 | 1 |
4988 | break; executed: break; Execution Count:1 | 1 |
4989 | | - |
4990 | case QEvent::ToolBarChange: | - |
4991 | case QEvent::ActivationChange: | - |
4992 | case QEvent::EnabledChange: | - |
4993 | case QEvent::FontChange: | - |
4994 | case QEvent::StyleChange: | - |
4995 | case QEvent::PaletteChange: | - |
4996 | case QEvent::WindowTitleChange: | - |
4997 | case QEvent::IconTextChange: | - |
4998 | case QEvent::ModifiedChange: | - |
4999 | case QEvent::MouseTrackingChange: | - |
5000 | case QEvent::ParentChange: | - |
5001 | case QEvent::WindowStateChange: | - |
5002 | case QEvent::LocaleChange: | - |
5003 | case QEvent::MacSizeChange: | - |
5004 | case QEvent::ContentsRectChange: | - |
5005 | case QEvent::ThemeChange: | - |
5006 | changeEvent(event); | - |
5007 | break; executed: break; Execution Count:67993 | 67993 |
5008 | | - |
5009 | case QEvent::WindowActivate: | - |
5010 | case QEvent::WindowDeactivate: { | - |
5011 | if (isVisible() && !palette().isEqual(QPalette::Active, QPalette::Inactive)) evaluated: isVisible() yes Evaluation Count:7273 | yes Evaluation Count:12 |
partially evaluated: !palette().isEqual(QPalette::Active, QPalette::Inactive) no Evaluation Count:0 | yes Evaluation Count:7273 |
| 0-7273 |
5012 | update(); never executed: update(); | 0 |
5013 | QList<QObject*> childList = d->children; | - |
5014 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:12447 | yes Evaluation Count:7285 |
| 7285-12447 |
5015 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - |
5016 | if (w && w->isVisible() && !w->isWindow()) evaluated: w yes Evaluation Count:8259 | yes Evaluation Count:4188 |
evaluated: w->isVisible() yes Evaluation Count:5630 | yes Evaluation Count:2629 |
evaluated: !w->isWindow() yes Evaluation Count:5612 | yes Evaluation Count:18 |
| 18-8259 |
5017 | QApplication::sendEvent(w, event); executed: QApplication::sendEvent(w, event); Execution Count:5612 | 5612 |
5018 | } executed: } Execution Count:12447 | 12447 |
5019 | break; } executed: break; Execution Count:7285 | 7285 |
5020 | | - |
5021 | case QEvent::LanguageChange: | - |
5022 | changeEvent(event); | - |
5023 | { | - |
5024 | QList<QObject*> childList = d->children; | - |
5025 | for (int i = 0; i < childList.size(); ++i) { evaluated: i < childList.size() yes Evaluation Count:19 | yes Evaluation Count:14 |
| 14-19 |
5026 | QObject *o = childList.at(i); | - |
5027 | if (o) partially evaluated: o yes Evaluation Count:19 | no Evaluation Count:0 |
| 0-19 |
5028 | QApplication::sendEvent(o, event); executed: QApplication::sendEvent(o, event); Execution Count:19 | 19 |
5029 | } executed: } Execution Count:19 | 19 |
5030 | } | - |
5031 | update(); | - |
5032 | break; executed: break; Execution Count:14 | 14 |
5033 | | - |
5034 | case QEvent::ApplicationLayoutDirectionChange: | - |
5035 | d->resolveLayoutDirection(); | - |
5036 | break; executed: break; Execution Count:154 | 154 |
5037 | | - |
5038 | case QEvent::LayoutDirectionChange: | - |
5039 | if (d->layout) evaluated: d->layout yes Evaluation Count:61 | yes Evaluation Count:317 |
| 61-317 |
5040 | d->layout->invalidate(); executed: d->layout->invalidate(); Execution Count:61 | 61 |
5041 | update(); | - |
5042 | changeEvent(event); | - |
5043 | break; executed: break; Execution Count:378 | 378 |
5044 | case QEvent::UpdateRequest: | - |
5045 | d->syncBackingStore(); | - |
5046 | break; executed: break; Execution Count:3263 | 3263 |
5047 | case QEvent::UpdateLater: | - |
5048 | update(static_cast<QUpdateLaterEvent*>(event)->region()); | - |
5049 | break; executed: break; Execution Count:5523 | 5523 |
5050 | case QEvent::StyleAnimationUpdate: | - |
5051 | update(); | - |
5052 | break; executed: break; Execution Count:15 | 15 |
5053 | | - |
5054 | case QEvent::WindowBlocked: | - |
5055 | case QEvent::WindowUnblocked: | - |
5056 | if (!d->children.isEmpty()) { evaluated: !d->children.isEmpty() yes Evaluation Count:110 | yes Evaluation Count:450 |
| 110-450 |
5057 | QWidget *modalWidget = QApplication::activeModalWidget(); | - |
5058 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:188 | yes Evaluation Count:110 |
| 110-188 |
5059 | QObject *o = d->children.at(i); | - |
5060 | if (o && o != modalWidget && o->isWidgetType()) { partially evaluated: o yes Evaluation Count:188 | no Evaluation Count:0 |
evaluated: o != modalWidget yes Evaluation Count:150 | yes Evaluation Count:38 |
evaluated: o->isWidgetType() yes Evaluation Count:110 | yes Evaluation Count:40 |
| 0-188 |
5061 | QWidget *w = static_cast<QWidget *>(o); | - |
5062 | | - |
5063 | if (!w->isWindow()) evaluated: !w->isWindow() yes Evaluation Count:72 | yes Evaluation Count:38 |
| 38-72 |
5064 | QApplication::sendEvent(w, event); executed: QApplication::sendEvent(w, event); Execution Count:72 | 72 |
5065 | } executed: } Execution Count:110 | 110 |
5066 | } executed: } Execution Count:188 | 188 |
5067 | } executed: } Execution Count:110 | 110 |
5068 | | - |
5069 | | - |
5070 | | - |
5071 | break; executed: break; Execution Count:560 | 560 |
5072 | | - |
5073 | case QEvent::ToolTip: | - |
5074 | if (!d->toolTip.isEmpty()) partially evaluated: !d->toolTip.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5075 | QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this); never executed: QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this); | 0 |
5076 | else | - |
5077 | event->ignore(); executed: event->ignore(); Execution Count:1 | 1 |
5078 | break; executed: break; Execution Count:1 | 1 |
5079 | | - |
5080 | | - |
5081 | case QEvent::WhatsThis: | - |
5082 | if (d->whatsThis.size()) never evaluated: d->whatsThis.size() | 0 |
5083 | QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); never executed: QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); | 0 |
5084 | else | - |
5085 | event->ignore(); never executed: event->ignore(); | 0 |
5086 | break; | 0 |
5087 | case QEvent::QueryWhatsThis: | - |
5088 | if (d->whatsThis.isEmpty()) never evaluated: d->whatsThis.isEmpty() | 0 |
5089 | event->ignore(); never executed: event->ignore(); | 0 |
5090 | break; | 0 |
5091 | | - |
5092 | case QEvent::EmbeddingControl: | - |
5093 | d->topData()->frameStrut.setCoords(0 ,0, 0, 0); | - |
5094 | data->fstrut_dirty = false; | - |
5095 | | - |
5096 | | - |
5097 | | - |
5098 | break; | 0 |
5099 | | - |
5100 | case QEvent::ActionAdded: | - |
5101 | case QEvent::ActionRemoved: | - |
5102 | case QEvent::ActionChanged: | - |
5103 | actionEvent((QActionEvent*)event); | - |
5104 | break; executed: break; Execution Count:13445 | 13445 |
5105 | | - |
5106 | | - |
5107 | case QEvent::KeyboardLayoutChange: | - |
5108 | { | - |
5109 | changeEvent(event); | - |
5110 | | - |
5111 | | - |
5112 | QList<QObject*> childList = d->children; | - |
5113 | for (int i = 0; i < childList.size(); ++i) { never evaluated: i < childList.size() | 0 |
5114 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - |
5115 | if (w && w->isVisible() && !w->isWindow()) never evaluated: w->isVisible() never evaluated: !w->isWindow() | 0 |
5116 | QApplication::sendEvent(w, event); never executed: QApplication::sendEvent(w, event); | 0 |
5117 | } | 0 |
5118 | break; | 0 |
5119 | } | - |
5120 | | - |
5121 | | - |
5122 | | - |
5123 | | - |
5124 | | - |
5125 | case QEvent::TouchBegin: | - |
5126 | case QEvent::TouchUpdate: | - |
5127 | case QEvent::TouchEnd: | - |
5128 | case QEvent::TouchCancel: | - |
5129 | { | - |
5130 | event->ignore(); | - |
5131 | break; executed: break; Execution Count:1 | 1 |
5132 | } | - |
5133 | | - |
5134 | case QEvent::Gesture: | - |
5135 | event->ignore(); | - |
5136 | break; | 0 |
5137 | | - |
5138 | | - |
5139 | case QEvent::DynamicPropertyChange: { | - |
5140 | const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName(); | - |
5141 | if (!qstrncmp(propName, "_q_customDpi", 12) && propName.length() == 13) { partially evaluated: !qstrncmp(propName, "_q_customDpi", 12) no Evaluation Count:0 | yes Evaluation Count:4 |
never evaluated: propName.length() == 13 | 0-4 |
5142 | uint value = property(propName.constData()).toUInt(); | - |
5143 | if (!d->extra) never evaluated: !d->extra | 0 |
5144 | d->createExtra(); never executed: d->createExtra(); | 0 |
5145 | const char axis = propName.at(12); | - |
5146 | if (axis == 'X') never evaluated: axis == 'X' | 0 |
5147 | d->extra->customDpiX = value; never executed: d->extra->customDpiX = value; | 0 |
5148 | else if (axis == 'Y') never evaluated: axis == 'Y' | 0 |
5149 | d->extra->customDpiY = value; never executed: d->extra->customDpiY = value; | 0 |
5150 | d->updateFont(d->data.fnt); | - |
5151 | } | 0 |
5152 | | - |
5153 | } | - |
5154 | | - |
5155 | default: | - |
5156 | return QObject::event(event); executed: return QObject::event(event); Execution Count:200355 | 200355 |
5157 | } | - |
5158 | return true; executed: return true; Execution Count:217677 | 217677 |
5159 | } | - |
5160 | void QWidget::changeEvent(QEvent * event) | - |
5161 | { | - |
5162 | switch(event->type()) { | - |
5163 | case QEvent::EnabledChange: { | - |
5164 | update(); | - |
5165 | | - |
5166 | QAccessible::State s; | - |
5167 | s.disabled = true; | - |
5168 | QAccessibleStateChangeEvent event(this, s); | - |
5169 | QAccessible::updateAccessibility(&event); | - |
5170 | | - |
5171 | break; executed: break; Execution Count:2355 | 2355 |
5172 | } | - |
5173 | | - |
5174 | case QEvent::FontChange: | - |
5175 | case QEvent::StyleChange: { | - |
5176 | QWidgetPrivate * const d = d_func(); | - |
5177 | update(); | - |
5178 | updateGeometry(); | - |
5179 | if (d->layout) evaluated: d->layout yes Evaluation Count:690 | yes Evaluation Count:2890 |
| 690-2890 |
5180 | d->layout->invalidate(); executed: d->layout->invalidate(); Execution Count:690 | 690 |
5181 | break; executed: break; Execution Count:3580 | 3580 |
5182 | } | - |
5183 | | - |
5184 | case QEvent::PaletteChange: | - |
5185 | update(); | - |
5186 | break; executed: break; Execution Count:16616 | 16616 |
5187 | | - |
5188 | case QEvent::ThemeChange: | - |
5189 | if (QApplication::desktopSettingsAware() && windowType() != Qt::Desktop never evaluated: QApplication::desktopSettingsAware() never evaluated: windowType() != Qt::Desktop | 0 |
5190 | && (static_cast<QApplication *>(QCoreApplication::instance())) && !QApplication::closingDown()) { never evaluated: (static_cast<QApplication *>(QCoreApplication::instance())) never evaluated: !QApplication::closingDown() | 0 |
5191 | if (testAttribute(Qt::WA_WState_Polished)) never evaluated: testAttribute(Qt::WA_WState_Polished) | 0 |
5192 | QApplication::style()->unpolish(this); never executed: QApplication::style()->unpolish(this); | 0 |
5193 | if (testAttribute(Qt::WA_WState_Polished)) never evaluated: testAttribute(Qt::WA_WState_Polished) | 0 |
5194 | QApplication::style()->polish(this); never executed: QApplication::style()->polish(this); | 0 |
5195 | QEvent styleChangedEvent(QEvent::StyleChange); | - |
5196 | QCoreApplication::sendEvent(this, &styleChangedEvent); | - |
5197 | if (isVisible()) never evaluated: isVisible() | 0 |
5198 | update(); never executed: update(); | 0 |
5199 | } | 0 |
5200 | break; | 0 |
5201 | default: | - |
5202 | break; executed: break; Execution Count:44679 | 44679 |
5203 | } | - |
5204 | } executed: } Execution Count:67230 | 67230 |
5205 | void QWidget::mouseMoveEvent(QMouseEvent *event) | - |
5206 | { | - |
5207 | event->ignore(); | - |
5208 | } | 0 |
5209 | void QWidget::mousePressEvent(QMouseEvent *event) | - |
5210 | { | - |
5211 | event->ignore(); | - |
5212 | if ((windowType() == Qt::Popup)) { partially evaluated: (windowType() == Qt::Popup) no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
5213 | event->accept(); | - |
5214 | QWidget* w; | - |
5215 | while ((w = QApplication::activePopupWidget()) && w != this){ never evaluated: (w = QApplication::activePopupWidget()) never evaluated: w != this | 0 |
5216 | w->close(); | - |
5217 | if (QApplication::activePopupWidget() == w) never evaluated: QApplication::activePopupWidget() == w | 0 |
5218 | w->hide(); never executed: w->hide(); | 0 |
5219 | } | 0 |
5220 | if (!rect().contains(event->pos())){ never evaluated: !rect().contains(event->pos()) | 0 |
5221 | close(); | - |
5222 | } | 0 |
5223 | } | 0 |
5224 | } executed: } Execution Count:11 | 11 |
5225 | void QWidget::mouseReleaseEvent(QMouseEvent *event) | - |
5226 | { | - |
5227 | event->ignore(); | - |
5228 | } executed: } Execution Count:3 | 3 |
5229 | void QWidget::mouseDoubleClickEvent(QMouseEvent *event) | - |
5230 | { | - |
5231 | (void)event;; | - |
5232 | } executed: } Execution Count:10 | 10 |
5233 | void QWidget::wheelEvent(QWheelEvent *event) | - |
5234 | { | - |
5235 | event->ignore(); | - |
5236 | } | 0 |
5237 | void QWidget::tabletEvent(QTabletEvent *event) | - |
5238 | { | - |
5239 | event->ignore(); | - |
5240 | } | 0 |
5241 | void QWidget::keyPressEvent(QKeyEvent *event) | - |
5242 | { | - |
5243 | if ((windowType() == Qt::Popup) && event->key() == Qt::Key_Escape) { partially evaluated: (windowType() == Qt::Popup) no Evaluation Count:0 | yes Evaluation Count:284 |
never evaluated: event->key() == Qt::Key_Escape | 0-284 |
5244 | event->accept(); | - |
5245 | close(); | - |
5246 | } else { | 0 |
5247 | event->ignore(); | - |
5248 | } executed: } Execution Count:284 | 284 |
5249 | } | - |
5250 | void QWidget::keyReleaseEvent(QKeyEvent *event) | - |
5251 | { | - |
5252 | event->ignore(); | - |
5253 | } executed: } Execution Count:4458 | 4458 |
5254 | void QWidget::focusInEvent(QFocusEvent *) | - |
5255 | { | - |
5256 | if (focusPolicy() != Qt::NoFocus || !isWindow()) { evaluated: focusPolicy() != Qt::NoFocus yes Evaluation Count:673 | yes Evaluation Count:90 |
evaluated: !isWindow() yes Evaluation Count:3 | yes Evaluation Count:87 |
| 3-673 |
5257 | update(); | - |
5258 | } executed: } Execution Count:676 | 676 |
5259 | } executed: } Execution Count:763 | 763 |
5260 | void QWidget::focusOutEvent(QFocusEvent *) | - |
5261 | { | - |
5262 | if (focusPolicy() != Qt::NoFocus || !isWindow()) evaluated: focusPolicy() != Qt::NoFocus yes Evaluation Count:572 | yes Evaluation Count:22 |
evaluated: !isWindow() yes Evaluation Count:5 | yes Evaluation Count:17 |
| 5-572 |
5263 | update(); executed: update(); Execution Count:577 | 577 |
5264 | } executed: } Execution Count:594 | 594 |
5265 | void QWidget::enterEvent(QEvent *) | - |
5266 | { | - |
5267 | } | - |
5268 | void QWidget::leaveEvent(QEvent *) | - |
5269 | { | - |
5270 | } | - |
5271 | void QWidget::paintEvent(QPaintEvent *) | - |
5272 | { | - |
5273 | } | - |
5274 | void QWidget::moveEvent(QMoveEvent *) | - |
5275 | { | - |
5276 | } | - |
5277 | void QWidget::resizeEvent(QResizeEvent * ) | - |
5278 | { | - |
5279 | } | - |
5280 | void QWidget::actionEvent(QActionEvent *) | - |
5281 | { | - |
5282 | | - |
5283 | } | - |
5284 | void QWidget::closeEvent(QCloseEvent *event) | - |
5285 | { | - |
5286 | event->accept(); | - |
5287 | } executed: } Execution Count:68 | 68 |
5288 | void QWidget::contextMenuEvent(QContextMenuEvent *event) | - |
5289 | { | - |
5290 | event->ignore(); | - |
5291 | } | 0 |
5292 | void QWidget::inputMethodEvent(QInputMethodEvent *event) | - |
5293 | { | - |
5294 | event->ignore(); | - |
5295 | } | 0 |
5296 | QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const | - |
5297 | { | - |
5298 | switch(query) { | - |
5299 | case Qt::ImCursorRectangle: | - |
5300 | return QRect(width()/2, 0, 1, height()); executed: return QRect(width()/2, 0, 1, height()); Execution Count:1 | 1 |
5301 | case Qt::ImFont: | - |
5302 | return font(); never executed: return font(); | 0 |
5303 | case Qt::ImAnchorPosition: | - |
5304 | | - |
5305 | return inputMethodQuery(Qt::ImCursorPosition); never executed: return inputMethodQuery(Qt::ImCursorPosition); | 0 |
5306 | case Qt::ImHints: | - |
5307 | return (int)inputMethodHints(); never executed: return (int)inputMethodHints(); | 0 |
5308 | default: | - |
5309 | return QVariant(); executed: return QVariant(); Execution Count:691 | 691 |
5310 | } | - |
5311 | } | 0 |
5312 | Qt::InputMethodHints QWidget::inputMethodHints() const | - |
5313 | { | - |
5314 | | - |
5315 | const QWidgetPrivate *priv = d_func(); | - |
5316 | while (priv->inheritsInputMethodHints) { evaluated: priv->inheritsInputMethodHints yes Evaluation Count:4 | yes Evaluation Count:6 |
| 4-6 |
5317 | priv = priv->q_func()->parentWidget()->d_func(); | - |
5318 | qt_noop(); | - |
5319 | } executed: } Execution Count:4 | 4 |
5320 | return priv->imHints; executed: return priv->imHints; Execution Count:6 | 6 |
5321 | | - |
5322 | | - |
5323 | | - |
5324 | } | - |
5325 | | - |
5326 | void QWidget::setInputMethodHints(Qt::InputMethodHints hints) | - |
5327 | { | - |
5328 | | - |
5329 | QWidgetPrivate * const d = d_func(); | - |
5330 | d->imHints = hints; | - |
5331 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImHints); | - |
5332 | | - |
5333 | } executed: } Execution Count:1575 | 1575 |
5334 | void QWidget::dragEnterEvent(QDragEnterEvent *) | - |
5335 | { | - |
5336 | } | - |
5337 | void QWidget::dragMoveEvent(QDragMoveEvent *) | - |
5338 | { | - |
5339 | } | - |
5340 | void QWidget::dragLeaveEvent(QDragLeaveEvent *) | - |
5341 | { | - |
5342 | } | - |
5343 | void QWidget::dropEvent(QDropEvent *) | - |
5344 | { | - |
5345 | } | - |
5346 | void QWidget::showEvent(QShowEvent *) | - |
5347 | { | - |
5348 | } | - |
5349 | void QWidget::hideEvent(QHideEvent *) | - |
5350 | { | - |
5351 | } | - |
5352 | bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result) | - |
5353 | { | - |
5354 | (void)eventType;; | - |
5355 | (void)message;; | - |
5356 | (void)result;; | - |
5357 | return false; executed: return false; Execution Count:38625 | 38625 |
5358 | } | - |
5359 | void QWidget::ensurePolished() const | - |
5360 | { | - |
5361 | const QWidgetPrivate * const d = d_func(); | - |
5362 | | - |
5363 | const QMetaObject *m = metaObject(); | - |
5364 | if (m == d->polished) evaluated: m == d->polished yes Evaluation Count:129742 | yes Evaluation Count:26642 |
| 26642-129742 |
5365 | return; executed: return; Execution Count:129742 | 129742 |
5366 | d->polished = m; | - |
5367 | | - |
5368 | QEvent e(QEvent::Polish); | - |
5369 | QCoreApplication::sendEvent(const_cast<QWidget *>(this), &e); | - |
5370 | | - |
5371 | | - |
5372 | QList<QObject*> children = d->children; | - |
5373 | for (int i = 0; i < children.size(); ++i) { evaluated: i < children.size() yes Evaluation Count:34670 | yes Evaluation Count:26642 |
| 26642-34670 |
5374 | QObject *o = children.at(i); | - |
5375 | if(!o->isWidgetType()) evaluated: !o->isWidgetType() yes Evaluation Count:14464 | yes Evaluation Count:20206 |
| 14464-20206 |
5376 | continue; executed: continue; Execution Count:14464 | 14464 |
5377 | if (QWidget *w = qobject_cast<QWidget *>(o)) partially evaluated: QWidget *w = qobject_cast<QWidget *>(o) yes Evaluation Count:20206 | no Evaluation Count:0 |
| 0-20206 |
5378 | w->ensurePolished(); executed: w->ensurePolished(); Execution Count:20206 | 20206 |
5379 | } executed: } Execution Count:20206 | 20206 |
5380 | | - |
5381 | if (d->parent && d->sendChildEvents) { evaluated: d->parent yes Evaluation Count:24421 | yes Evaluation Count:2221 |
evaluated: d->sendChildEvents yes Evaluation Count:24420 | yes Evaluation Count:1 |
| 1-24421 |
5382 | QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this)); | - |
5383 | QCoreApplication::sendEvent(d->parent, &e); | - |
5384 | } executed: } Execution Count:24420 | 24420 |
5385 | } executed: } Execution Count:26642 | 26642 |
5386 | | - |
5387 | | - |
5388 | | - |
5389 | | - |
5390 | | - |
5391 | | - |
5392 | | - |
5393 | QRegion QWidget::mask() const | - |
5394 | { | - |
5395 | const QWidgetPrivate * const d = d_func(); | - |
5396 | return d->extra ? d->extra->mask : QRegion(); executed: return d->extra ? d->extra->mask : QRegion(); Execution Count:725 | 725 |
5397 | } | - |
5398 | QLayout *QWidget::layout() const | - |
5399 | { | - |
5400 | return d_func()->layout; executed: return d_func()->layout; Execution Count:45843 | 45843 |
5401 | } | - |
5402 | void QWidget::setLayout(QLayout *l) | - |
5403 | { | - |
5404 | if (!l) { evaluated: !l yes Evaluation Count:1 | yes Evaluation Count:7844 |
| 1-7844 |
5405 | QMessageLogger("kernel/qwidget.cpp", 9100, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Cannot set layout to 0"); | - |
5406 | return; executed: return; Execution Count:1 | 1 |
5407 | } | - |
5408 | if (layout()) { evaluated: layout() yes Evaluation Count:24 | yes Evaluation Count:7820 |
| 24-7820 |
5409 | if (layout() != l) partially evaluated: layout() != l no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
5410 | QMessageLogger("kernel/qwidget.cpp", 9105, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" | 0 |
5411 | " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), | 0 |
5412 | objectName().toLocal8Bit().data()); never executed: QMessageLogger("kernel/qwidget.cpp", 9105, __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 |
5413 | return; executed: return; Execution Count:24 | 24 |
5414 | } | - |
5415 | | - |
5416 | QObject *oldParent = l->parent(); | - |
5417 | if (oldParent && oldParent != this) { evaluated: oldParent yes Evaluation Count:83 | yes Evaluation Count:7737 |
evaluated: oldParent != this yes Evaluation Count:1 | yes Evaluation Count:82 |
| 1-7737 |
5418 | if (oldParent->isWidgetType()) { partially evaluated: oldParent->isWidgetType() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
5419 | | - |
5420 | | - |
5421 | QWidget *oldParentWidget = static_cast<QWidget *>(oldParent); | - |
5422 | oldParentWidget->takeLayout(); | - |
5423 | } else { executed: } Execution Count:1 | 1 |
5424 | QMessageLogger("kernel/qwidget.cpp", 9119, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent", | - |
5425 | l->objectName().toLocal8Bit().data(), metaObject()->className(), | - |
5426 | objectName().toLocal8Bit().data()); | - |
5427 | return; | 0 |
5428 | } | - |
5429 | } | - |
5430 | | - |
5431 | QWidgetPrivate * const d = d_func(); | - |
5432 | l->d_func()->topLevel = true; | - |
5433 | d->layout = l; | - |
5434 | if (oldParent != this) { evaluated: oldParent != this yes Evaluation Count:7738 | yes Evaluation Count:82 |
| 82-7738 |
5435 | l->setParent(this); | - |
5436 | l->d_func()->reparentChildWidgets(this); | - |
5437 | l->invalidate(); | - |
5438 | } executed: } Execution Count:7738 | 7738 |
5439 | | - |
5440 | if (isWindow() && d->maybeTopData()) evaluated: isWindow() yes Evaluation Count:238 | yes Evaluation Count:7582 |
evaluated: d->maybeTopData() yes Evaluation Count:1 | yes Evaluation Count:237 |
| 1-7582 |
5441 | d->topData()->sizeAdjusted = false; executed: d->topData()->sizeAdjusted = false; Execution Count:1 | 1 |
5442 | } executed: } Execution Count:7820 | 7820 |
5443 | QLayout *QWidget::takeLayout() | - |
5444 | { | - |
5445 | QWidgetPrivate * const d = d_func(); | - |
5446 | QLayout *l = layout(); | - |
5447 | if (!l) partially evaluated: !l no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5448 | return 0; never executed: return 0; | 0 |
5449 | d->layout = 0; | - |
5450 | l->setParent(0); | - |
5451 | return l; executed: return l; Execution Count:1 | 1 |
5452 | } | - |
5453 | QSizePolicy QWidget::sizePolicy() const | - |
5454 | { | - |
5455 | const QWidgetPrivate * const d = d_func(); | - |
5456 | return d->size_policy; executed: return d->size_policy; Execution Count:86947 | 86947 |
5457 | } | - |
5458 | | - |
5459 | void QWidget::setSizePolicy(QSizePolicy policy) | - |
5460 | { | - |
5461 | QWidgetPrivate * const d = d_func(); | - |
5462 | setAttribute(Qt::WA_WState_OwnSizePolicy); | - |
5463 | if (policy == d->size_policy) evaluated: policy == d->size_policy yes Evaluation Count:425 | yes Evaluation Count:24603 |
| 425-24603 |
5464 | return; executed: return; Execution Count:425 | 425 |
5465 | d->size_policy = policy; | - |
5466 | | - |
5467 | | - |
5468 | if (QWExtra *extra = d->extra) { evaluated: QWExtra *extra = d->extra yes Evaluation Count:1151 | yes Evaluation Count:23452 |
| 1151-23452 |
5469 | if (extra->proxyWidget) partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:1151 |
| 0-1151 |
5470 | extra->proxyWidget->setSizePolicy(policy); never executed: extra->proxyWidget->setSizePolicy(policy); | 0 |
5471 | } executed: } Execution Count:1151 | 1151 |
5472 | | - |
5473 | | - |
5474 | updateGeometry(); | - |
5475 | | - |
5476 | if (isWindow() && d->maybeTopData()) evaluated: isWindow() yes Evaluation Count:5201 | yes Evaluation Count:19402 |
partially evaluated: d->maybeTopData() no Evaluation Count:0 | yes Evaluation Count:5201 |
| 0-19402 |
5477 | d->topData()->sizeAdjusted = false; never executed: d->topData()->sizeAdjusted = false; | 0 |
5478 | } executed: } Execution Count:24603 | 24603 |
5479 | int QWidget::heightForWidth(int w) const | - |
5480 | { | - |
5481 | if (layout() && layout()->hasHeightForWidth()) partially evaluated: layout() yes Evaluation Count:68 | no Evaluation Count:0 |
partially evaluated: layout()->hasHeightForWidth() yes Evaluation Count:68 | no Evaluation Count:0 |
| 0-68 |
5482 | return layout()->totalHeightForWidth(w); executed: return layout()->totalHeightForWidth(w); Execution Count:68 | 68 |
5483 | return -1; never executed: return -1; | 0 |
5484 | } | - |
5485 | | - |
5486 | | - |
5487 | | - |
5488 | | - |
5489 | | - |
5490 | | - |
5491 | | - |
5492 | bool QWidget::hasHeightForWidth() const | - |
5493 | { | - |
5494 | const QWidgetPrivate * const d = d_func(); | - |
5495 | return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); executed: return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); Execution Count:14380 | 14380 |
5496 | } | - |
5497 | QWidget *QWidget::childAt(const QPoint &p) const | - |
5498 | { | - |
5499 | return d_func()->childAt_helper(p, false); executed: return d_func()->childAt_helper(p, false); Execution Count:869 | 869 |
5500 | } | - |
5501 | | - |
5502 | QWidget *QWidgetPrivate::childAt_helper(const QPoint &p, bool ignoreChildrenInDestructor) const | - |
5503 | { | - |
5504 | if (children.isEmpty()) evaluated: children.isEmpty() yes Evaluation Count:263 | yes Evaluation Count:954 |
| 263-954 |
5505 | return 0; executed: return 0; Execution Count:263 | 263 |
5506 | if (!pointInsideRectAndMask(p)) evaluated: !pointInsideRectAndMask(p) yes Evaluation Count:5 | yes Evaluation Count:949 |
| 5-949 |
5507 | return 0; executed: return 0; Execution Count:5 | 5 |
5508 | return childAtRecursiveHelper(p, ignoreChildrenInDestructor); executed: return childAtRecursiveHelper(p, ignoreChildrenInDestructor); Execution Count:949 | 949 |
5509 | } | - |
5510 | | - |
5511 | QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChildrenInDestructor, bool includeFrame) const | - |
5512 | { | - |
5513 | | - |
5514 | (void)includeFrame;; | - |
5515 | | - |
5516 | for (int i = children.size() - 1; i >= 0; --i) { evaluated: i >= 0 yes Evaluation Count:5420 | yes Evaluation Count:949 |
| 949-5420 |
5517 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - |
5518 | if (!child || child->isWindow() || child->isHidden() || child->testAttribute(Qt::WA_TransparentForMouseEvents) evaluated: !child yes Evaluation Count:1712 | yes Evaluation Count:3708 |
evaluated: child->isWindow() yes Evaluation Count:8 | yes Evaluation Count:3700 |
evaluated: child->isHidden() yes Evaluation Count:761 | yes Evaluation Count:2939 |
partially evaluated: child->testAttribute(Qt::WA_TransparentForMouseEvents) no Evaluation Count:0 | yes Evaluation Count:2939 |
| 0-3708 |
5519 | || (ignoreChildrenInDestructor && child->data->in_destructor)) { evaluated: ignoreChildrenInDestructor yes Evaluation Count:56 | yes Evaluation Count:2883 |
evaluated: child->data->in_destructor yes Evaluation Count:50 | yes Evaluation Count:6 |
| 6-2883 |
5520 | continue; executed: continue; Execution Count:2531 | 2531 |
5521 | } | - |
5522 | | - |
5523 | | - |
5524 | QPoint childPoint = p; | - |
5525 | childPoint -= child->data->crect.topLeft(); | - |
5526 | | - |
5527 | | - |
5528 | if (!child->d_func()->pointInsideRectAndMask(childPoint)) evaluated: !child->d_func()->pointInsideRectAndMask(childPoint) yes Evaluation Count:1699 | yes Evaluation Count:1190 |
| 1190-1699 |
5529 | continue; executed: continue; Execution Count:1699 | 1699 |
5530 | | - |
5531 | | - |
5532 | if (QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor)) evaluated: QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor) yes Evaluation Count:431 | yes Evaluation Count:759 |
| 431-759 |
5533 | return w; executed: return w; Execution Count:431 | 431 |
5534 | | - |
5535 | | - |
5536 | return child; executed: return child; Execution Count:759 | 759 |
5537 | } | - |
5538 | return 0; executed: return 0; Execution Count:949 | 949 |
5539 | } | - |
5540 | | - |
5541 | void QWidgetPrivate::updateGeometry_helper(bool forceUpdate) | - |
5542 | { | - |
5543 | QWidget * const q = q_func(); | - |
5544 | if (widgetItem) evaluated: widgetItem yes Evaluation Count:11822 | yes Evaluation Count:44357 |
| 11822-44357 |
5545 | widgetItem->invalidateSizeCache(); executed: widgetItem->invalidateSizeCache(); Execution Count:11822 | 11822 |
5546 | QWidget *parent; | - |
5547 | if (forceUpdate || !extra || extra->minw != extra->maxw || extra->minh != extra->maxh) { evaluated: forceUpdate yes Evaluation Count:4154 | yes Evaluation Count:52025 |
evaluated: !extra yes Evaluation Count:41505 | yes Evaluation Count:10520 |
evaluated: extra->minw != extra->maxw yes Evaluation Count:10337 | yes Evaluation Count:183 |
evaluated: extra->minh != extra->maxh yes Evaluation Count:18 | yes Evaluation Count:165 |
| 18-52025 |
5548 | if (!q->isWindow() && !q->isHidden() && (parent = q->parentWidget())) { evaluated: !q->isWindow() yes Evaluation Count:43945 | yes Evaluation Count:12069 |
evaluated: !q->isHidden() yes Evaluation Count:42917 | yes Evaluation Count:1028 |
partially evaluated: (parent = q->parentWidget()) yes Evaluation Count:42917 | no Evaluation Count:0 |
| 0-43945 |
5549 | if (parent->d_func()->layout) evaluated: parent->d_func()->layout yes Evaluation Count:19002 | yes Evaluation Count:23915 |
| 19002-23915 |
5550 | parent->d_func()->layout->invalidate(); executed: parent->d_func()->layout->invalidate(); Execution Count:19002 | 19002 |
5551 | else if (parent->isVisible()) evaluated: parent->isVisible() yes Evaluation Count:2810 | yes Evaluation Count:21105 |
| 2810-21105 |
5552 | QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); executed: QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); Execution Count:2810 | 2810 |
5553 | } | - |
5554 | } executed: } Execution Count:56014 | 56014 |
5555 | } executed: } Execution Count:56179 | 56179 |
5556 | void QWidget::updateGeometry() | - |
5557 | { | - |
5558 | QWidgetPrivate * const d = d_func(); | - |
5559 | d->updateGeometry_helper(false); | - |
5560 | } executed: } Execution Count:48334 | 48334 |
5561 | void QWidget::setWindowFlags(Qt::WindowFlags flags) | - |
5562 | { | - |
5563 | if (data->window_flags == flags) evaluated: data->window_flags == flags yes Evaluation Count:18 | yes Evaluation Count:474 |
| 18-474 |
5564 | return; executed: return; Execution Count:18 | 18 |
5565 | | - |
5566 | QWidgetPrivate * const d = d_func(); | - |
5567 | | - |
5568 | if ((data->window_flags | flags) & Qt::Window) { evaluated: (data->window_flags | flags) & Qt::Window yes Evaluation Count:343 | yes Evaluation Count:131 |
| 131-343 |
5569 | | - |
5570 | QPoint oldPos = pos(); | - |
5571 | bool visible = isVisible(); | - |
5572 | setParent(parentWidget(), flags); | - |
5573 | | - |
5574 | | - |
5575 | | - |
5576 | if (!((data->window_flags ^ flags) & Qt::Window) evaluated: !((data->window_flags ^ flags) & Qt::Window) yes Evaluation Count:298 | yes Evaluation Count:45 |
| 45-298 |
5577 | && (visible || testAttribute(Qt::WA_Moved))) { evaluated: visible yes Evaluation Count:9 | yes Evaluation Count:289 |
evaluated: testAttribute(Qt::WA_Moved) yes Evaluation Count:4 | yes Evaluation Count:285 |
| 4-289 |
5578 | move(oldPos); | - |
5579 | } executed: } Execution Count:13 | 13 |
5580 | | - |
5581 | d->adjustQuitOnCloseAttribute(); | - |
5582 | } else { executed: } Execution Count:343 | 343 |
5583 | data->window_flags = flags; | - |
5584 | } executed: } Execution Count:131 | 131 |
5585 | } | - |
5586 | void QWidget::overrideWindowFlags(Qt::WindowFlags flags) | - |
5587 | { | - |
5588 | data->window_flags = flags; | - |
5589 | } | 0 |
5590 | void QWidget::setParent(QWidget *parent) | - |
5591 | { | - |
5592 | if (parent == parentWidget()) evaluated: parent == parentWidget() yes Evaluation Count:1826 | yes Evaluation Count:2559 |
| 1826-2559 |
5593 | return; executed: return; Execution Count:1826 | 1826 |
5594 | setParent((QWidget*)parent, windowFlags() & ~Qt::WindowType_Mask); | - |
5595 | } executed: } Execution Count:2559 | 2559 |
5596 | | - |
5597 | | - |
5598 | | - |
5599 | | - |
5600 | | - |
5601 | | - |
5602 | | - |
5603 | void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) | - |
5604 | { | - |
5605 | QWidgetPrivate * const d = d_func(); | - |
5606 | bool resized = testAttribute(Qt::WA_Resized); | - |
5607 | bool wasCreated = testAttribute(Qt::WA_WState_Created); | - |
5608 | QWidget *oldtlw = window(); | - |
5609 | | - |
5610 | QWidget *desktopWidget = 0; | - |
5611 | if (parent && parent->windowType() == Qt::Desktop) evaluated: parent yes Evaluation Count:30397 | yes Evaluation Count:428 |
partially evaluated: parent->windowType() == Qt::Desktop no Evaluation Count:0 | yes Evaluation Count:30397 |
| 0-30397 |
5612 | desktopWidget = parent; never executed: desktopWidget = parent; | 0 |
5613 | bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget; evaluated: (parent != parentWidget()) yes Evaluation Count:30468 | yes Evaluation Count:357 |
evaluated: !wasCreated yes Evaluation Count:339 | yes Evaluation Count:18 |
partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-30468 |
5614 | | - |
5615 | if (newParent && parent && !desktopWidget) { evaluated: newParent yes Evaluation Count:30807 | yes Evaluation Count:18 |
evaluated: parent yes Evaluation Count:30380 | yes Evaluation Count:427 |
partially evaluated: !desktopWidget yes Evaluation Count:30380 | no Evaluation Count:0 |
| 0-30807 |
5616 | if (testAttribute(Qt::WA_NativeWindow) && !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) partially evaluated: testAttribute(Qt::WA_NativeWindow) no Evaluation Count:0 | yes Evaluation Count:30380 |
never evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) | 0-30380 |
5617 | | - |
5618 | | - |
5619 | | - |
5620 | | - |
5621 | | - |
5622 | ) | - |
5623 | parent->d_func()->enforceNativeChildren(); never executed: parent->d_func()->enforceNativeChildren(); | 0 |
5624 | else if (parent->d_func()->nativeChildrenForced() || parent->testAttribute(Qt::WA_PaintOnScreen)) evaluated: parent->d_func()->nativeChildrenForced() yes Evaluation Count:1 | yes Evaluation Count:30379 |
partially evaluated: parent->testAttribute(Qt::WA_PaintOnScreen) no Evaluation Count:0 | yes Evaluation Count:30379 |
| 0-30379 |
5625 | setAttribute(Qt::WA_NativeWindow); executed: setAttribute(Qt::WA_NativeWindow); Execution Count:1 | 1 |
5626 | } | - |
5627 | | - |
5628 | if (wasCreated) { evaluated: wasCreated yes Evaluation Count:103 | yes Evaluation Count:30722 |
| 103-30722 |
5629 | if (!testAttribute(Qt::WA_WState_Hidden)) { evaluated: !testAttribute(Qt::WA_WState_Hidden) yes Evaluation Count:26 | yes Evaluation Count:77 |
| 26-77 |
5630 | hide(); | - |
5631 | setAttribute(Qt::WA_WState_ExplicitShowHide, false); | - |
5632 | } executed: } Execution Count:26 | 26 |
5633 | if (newParent) { evaluated: newParent yes Evaluation Count:85 | yes Evaluation Count:18 |
| 18-85 |
5634 | QEvent e(QEvent::ParentAboutToChange); | - |
5635 | QApplication::sendEvent(this, &e); | - |
5636 | } executed: } Execution Count:85 | 85 |
5637 | } executed: } Execution Count:103 | 103 |
5638 | if (newParent && isAncestorOf(focusWidget())) evaluated: newParent yes Evaluation Count:30807 | yes Evaluation Count:18 |
evaluated: isAncestorOf(focusWidget()) yes Evaluation Count:4 | yes Evaluation Count:30803 |
| 4-30807 |
5639 | focusWidget()->clearFocus(); executed: focusWidget()->clearFocus(); Execution Count:4 | 4 |
5640 | | - |
5641 | QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData(); | - |
5642 | QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStoreTracker : 0; evaluated: oldTopExtra yes Evaluation Count:181 | yes Evaluation Count:30644 |
| 181-30644 |
5643 | | - |
5644 | d->setParent_sys(parent, f); | - |
5645 | | - |
5646 | QTLWExtra *topExtra = window()->d_func()->maybeTopData(); | - |
5647 | QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStoreTracker : 0; evaluated: topExtra yes Evaluation Count:2080 | yes Evaluation Count:28745 |
| 2080-28745 |
5648 | if (oldBsTracker && oldBsTracker != bsTracker) evaluated: oldBsTracker yes Evaluation Count:181 | yes Evaluation Count:30644 |
evaluated: oldBsTracker != bsTracker yes Evaluation Count:149 | yes Evaluation Count:32 |
| 32-30644 |
5649 | oldBsTracker->unregisterWidgetSubtree(this); executed: oldBsTracker->unregisterWidgetSubtree(this); Execution Count:149 | 149 |
5650 | | - |
5651 | if (desktopWidget) partially evaluated: desktopWidget no Evaluation Count:0 | yes Evaluation Count:30825 |
| 0-30825 |
5652 | parent = 0; never executed: parent = 0; | 0 |
5653 | | - |
5654 | if (QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore()) { evaluated: QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore() yes Evaluation Count:730 | yes Evaluation Count:30095 |
| 730-30095 |
5655 | if (newParent) evaluated: newParent yes Evaluation Count:712 | yes Evaluation Count:18 |
| 18-712 |
5656 | oldBs->removeDirtyWidget(this); executed: oldBs->removeDirtyWidget(this); Execution Count:712 | 712 |
5657 | | - |
5658 | | - |
5659 | oldBs->moveStaticWidgets(this); | - |
5660 | } executed: } Execution Count:730 | 730 |
5661 | | - |
5662 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) && !testAttribute(Qt::WA_WState_Created)) partially evaluated: QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) no Evaluation Count:0 | yes Evaluation Count:30825 |
never evaluated: !testAttribute(Qt::WA_WState_Created) | 0-30825 |
5663 | create(); never executed: create(); | 0 |
5664 | | - |
5665 | d->reparentFocusWidgets(oldtlw); | - |
5666 | setAttribute(Qt::WA_Resized, resized); | - |
5667 | if (!testAttribute(Qt::WA_StyleSheet) partially evaluated: !testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:30825 | no Evaluation Count:0 |
| 0-30825 |
5668 | && (!parent || !parent->testAttribute(Qt::WA_StyleSheet))) { evaluated: !parent yes Evaluation Count:428 | yes Evaluation Count:30397 |
evaluated: !parent->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:30394 | yes Evaluation Count:3 |
| 3-30397 |
5669 | d->resolveFont(); | - |
5670 | d->resolvePalette(); | - |
5671 | } executed: } Execution Count:30822 | 30822 |
5672 | d->resolveLayoutDirection(); | - |
5673 | d->resolveLocale(); | - |
5674 | | - |
5675 | | - |
5676 | | - |
5677 | | - |
5678 | | - |
5679 | if (newParent evaluated: newParent yes Evaluation Count:30807 | yes Evaluation Count:18 |
| 18-30807 |
5680 | | - |
5681 | | - |
5682 | | - |
5683 | ) { | - |
5684 | | - |
5685 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:29805 | yes Evaluation Count:1002 |
| 1002-29805 |
5686 | if (!testAttribute(Qt::WA_ForceDisabled)) partially evaluated: !testAttribute(Qt::WA_ForceDisabled) yes Evaluation Count:29805 | no Evaluation Count:0 |
| 0-29805 |
5687 | d->setEnabled_helper(parent ? parent->isEnabled() : true); executed: d->setEnabled_helper(parent ? parent->isEnabled() : true); Execution Count:29805 | 29805 |
5688 | if (!testAttribute(Qt::WA_ForceUpdatesDisabled)) partially evaluated: !testAttribute(Qt::WA_ForceUpdatesDisabled) yes Evaluation Count:29805 | no Evaluation Count:0 |
| 0-29805 |
5689 | d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); executed: d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); Execution Count:29805 | 29805 |
5690 | } executed: } Execution Count:29805 | 29805 |
5691 | d->inheritStyle(); | - |
5692 | | - |
5693 | | - |
5694 | if (parent && d->sendChildEvents) { evaluated: parent yes Evaluation Count:30380 | yes Evaluation Count:427 |
evaluated: d->sendChildEvents yes Evaluation Count:30379 | yes Evaluation Count:1 |
| 1-30380 |
5695 | QChildEvent e(QEvent::ChildAdded, this); | - |
5696 | QApplication::sendEvent(parent, &e); | - |
5697 | } executed: } Execution Count:30379 | 30379 |
5698 | if (parent && d->sendChildEvents && d->polished) { evaluated: parent yes Evaluation Count:30380 | yes Evaluation Count:427 |
evaluated: d->sendChildEvents yes Evaluation Count:30379 | yes Evaluation Count:1 |
evaluated: d->polished yes Evaluation Count:112 | yes Evaluation Count:30267 |
| 1-30380 |
5699 | QChildEvent e(QEvent::ChildPolished, this); | - |
5700 | QCoreApplication::sendEvent(parent, &e); | - |
5701 | } executed: } Execution Count:112 | 112 |
5702 | | - |
5703 | QEvent e(QEvent::ParentChange); | - |
5704 | QApplication::sendEvent(this, &e); | - |
5705 | } executed: } Execution Count:30807 | 30807 |
5706 | | - |
5707 | if (!wasCreated) { evaluated: !wasCreated yes Evaluation Count:30722 | yes Evaluation Count:103 |
| 103-30722 |
5708 | if (isWindow() || parentWidget()->isVisible()) evaluated: isWindow() yes Evaluation Count:907 | yes Evaluation Count:29815 |
evaluated: parentWidget()->isVisible() yes Evaluation Count:402 | yes Evaluation Count:29413 |
| 402-29815 |
5709 | setAttribute(Qt::WA_WState_Hidden, true); executed: setAttribute(Qt::WA_WState_Hidden, true); Execution Count:1309 | 1309 |
5710 | else if (!testAttribute(Qt::WA_WState_ExplicitShowHide)) evaluated: !testAttribute(Qt::WA_WState_ExplicitShowHide) yes Evaluation Count:29401 | yes Evaluation Count:12 |
| 12-29401 |
5711 | setAttribute(Qt::WA_WState_Hidden, false); executed: setAttribute(Qt::WA_WState_Hidden, false); Execution Count:29401 | 29401 |
5712 | } | - |
5713 | | - |
5714 | d->updateIsOpaque(); | - |
5715 | | - |
5716 | | - |
5717 | | - |
5718 | | - |
5719 | if (oldtlw->graphicsProxyWidget()) { partially evaluated: oldtlw->graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:30825 |
| 0-30825 |
5720 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(oldtlw)) never evaluated: QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(oldtlw) | 0 |
5721 | ancestorProxy->d_func()->unembedSubWindow(this); never executed: ancestorProxy->d_func()->unembedSubWindow(this); | 0 |
5722 | } | 0 |
5723 | if (isWindow() && parent && !graphicsProxyWidget() && !bypassGraphicsProxyWidget(this)) { evaluated: isWindow() yes Evaluation Count:1002 | yes Evaluation Count:29823 |
evaluated: parent yes Evaluation Count:574 | yes Evaluation Count:428 |
partially evaluated: !graphicsProxyWidget() yes Evaluation Count:574 | no Evaluation Count:0 |
evaluated: !bypassGraphicsProxyWidget(this) yes Evaluation Count:569 | yes Evaluation Count:5 |
| 0-29823 |
5724 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(parent)) partially evaluated: QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(parent) no Evaluation Count:0 | yes Evaluation Count:569 |
| 0-569 |
5725 | ancestorProxy->d_func()->embedSubWindow(this); never executed: ancestorProxy->d_func()->embedSubWindow(this); | 0 |
5726 | } executed: } Execution Count:569 | 569 |
5727 | | - |
5728 | } executed: } Execution Count:30825 | 30825 |
5729 | void QWidget::scroll(int dx, int dy) | - |
5730 | { | - |
5731 | if ((!updatesEnabled() && children().size() == 0) || !isVisible()) evaluated: !updatesEnabled() yes Evaluation Count:2 | yes Evaluation Count:1143 |
partially evaluated: children().size() == 0 yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: !isVisible() yes Evaluation Count:32 | yes Evaluation Count:1111 |
| 0-1143 |
5732 | return; executed: return; Execution Count:34 | 34 |
5733 | if (dx == 0 && dy == 0) evaluated: dx == 0 yes Evaluation Count:443 | yes Evaluation Count:668 |
partially evaluated: dy == 0 no Evaluation Count:0 | yes Evaluation Count:443 |
| 0-668 |
5734 | return; | 0 |
5735 | QWidgetPrivate * const d = d_func(); | - |
5736 | | - |
5737 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)) { partially evaluated: QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this) no Evaluation Count:0 | yes Evaluation Count:1111 |
| 0-1111 |
5738 | | - |
5739 | | - |
5740 | | - |
5741 | if (!d->dirty.isEmpty()) { never evaluated: !d->dirty.isEmpty() | 0 |
5742 | 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;})) | - |
5743 | proxy->update(rect); never executed: proxy->update(rect); | 0 |
5744 | } | 0 |
5745 | proxy->scroll(dx, dy, proxy->subWidgetRect(this)); | - |
5746 | return; | 0 |
5747 | } | - |
5748 | | - |
5749 | d->setDirtyOpaqueRegion(); | - |
5750 | d->scroll_sys(dx, dy); | - |
5751 | } executed: } Execution Count:1111 | 1111 |
5752 | void QWidget::scroll(int dx, int dy, const QRect &r) | - |
5753 | { | - |
5754 | | - |
5755 | if ((!updatesEnabled() && children().size() == 0) || !isVisible()) never evaluated: !updatesEnabled() never evaluated: children().size() == 0 never evaluated: !isVisible() | 0 |
5756 | return; | 0 |
5757 | if (dx == 0 && dy == 0) | 0 |
5758 | return; | 0 |
5759 | QWidgetPrivate * const d = d_func(); | - |
5760 | | - |
5761 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)) { never evaluated: QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this) | 0 |
5762 | | - |
5763 | | - |
5764 | | - |
5765 | if (!d->dirty.isEmpty()) { never evaluated: !d->dirty.isEmpty() | 0 |
5766 | 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;})) | - |
5767 | proxy->update(rect); never executed: proxy->update(rect); | 0 |
5768 | } | 0 |
5769 | proxy->scroll(dx, dy, r.translated(proxy->subWidgetRect(this).topLeft().toPoint())); | - |
5770 | return; | 0 |
5771 | } | - |
5772 | | - |
5773 | d->scroll_sys(dx, dy, r); | - |
5774 | } | 0 |
5775 | void QWidget::repaint() | - |
5776 | { | - |
5777 | repaint(rect()); | - |
5778 | } executed: } Execution Count:355 | 355 |
5779 | void QWidget::repaint(int x, int y, int w, int h) | - |
5780 | { | - |
5781 | if (x > data->crect.width() || y > data->crect.height()) never evaluated: x > data->crect.width() never evaluated: y > data->crect.height() | 0 |
5782 | return; | 0 |
5783 | | - |
5784 | if (w < 0) | 0 |
5785 | w = data->crect.width() - x; never executed: w = data->crect.width() - x; | 0 |
5786 | if (h < 0) | 0 |
5787 | h = data->crect.height() - y; never executed: h = data->crect.height() - y; | 0 |
5788 | | - |
5789 | repaint(QRect(x, y, w, h)); | - |
5790 | } | 0 |
5791 | | - |
5792 | | - |
5793 | | - |
5794 | | - |
5795 | | - |
5796 | void QWidget::repaint(const QRect &rect) | - |
5797 | { | - |
5798 | QWidgetPrivate * const d = d_func(); | - |
5799 | | - |
5800 | if (testAttribute(Qt::WA_WState_ConfigPending)) { partially evaluated: testAttribute(Qt::WA_WState_ConfigPending) no Evaluation Count:0 | yes Evaluation Count:384 |
| 0-384 |
5801 | update(rect); | - |
5802 | return; | 0 |
5803 | } | - |
5804 | | - |
5805 | if (!isVisible() || !updatesEnabled() || rect.isEmpty()) evaluated: !isVisible() yes Evaluation Count:143 | yes Evaluation Count:241 |
partially evaluated: !updatesEnabled() no Evaluation Count:0 | yes Evaluation Count:241 |
evaluated: rect.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:238 |
| 0-241 |
5806 | return; executed: return; Execution Count:146 | 146 |
5807 | | - |
5808 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:238 | no Evaluation Count:0 |
| 0-238 |
5809 | | - |
5810 | | - |
5811 | | - |
5812 | | - |
5813 | | - |
5814 | | - |
5815 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5816 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) { partially evaluated: tlwExtra yes Evaluation Count:238 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:238 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:238 | no Evaluation Count:0 |
| 0-238 |
5817 | tlwExtra->inRepaint = true; | - |
5818 | tlwExtra->backingStoreTracker->markDirty(rect, this, true); | - |
5819 | tlwExtra->inRepaint = false; | - |
5820 | } executed: } Execution Count:238 | 238 |
5821 | } else { executed: } Execution Count:238 | 238 |
5822 | d->repaint_sys(rect); | - |
5823 | } | 0 |
5824 | } | - |
5825 | | - |
5826 | | - |
5827 | | - |
5828 | | - |
5829 | | - |
5830 | | - |
5831 | void QWidget::repaint(const QRegion &rgn) | - |
5832 | { | - |
5833 | QWidgetPrivate * const d = d_func(); | - |
5834 | | - |
5835 | if (testAttribute(Qt::WA_WState_ConfigPending)) { never evaluated: testAttribute(Qt::WA_WState_ConfigPending) | 0 |
5836 | update(rgn); | - |
5837 | return; | 0 |
5838 | } | - |
5839 | | - |
5840 | if (!isVisible() || !updatesEnabled() || rgn.isEmpty()) never evaluated: !isVisible() never evaluated: !updatesEnabled() never evaluated: rgn.isEmpty() | 0 |
5841 | return; | 0 |
5842 | | - |
5843 | if (hasBackingStoreSupport()) { never evaluated: hasBackingStoreSupport() | 0 |
5844 | | - |
5845 | | - |
5846 | | - |
5847 | | - |
5848 | | - |
5849 | | - |
5850 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5851 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) { never evaluated: tlwExtra never evaluated: !tlwExtra->inTopLevelResize never evaluated: tlwExtra->backingStore | 0 |
5852 | tlwExtra->inRepaint = true; | - |
5853 | tlwExtra->backingStoreTracker->markDirty(rgn, this, true); | - |
5854 | tlwExtra->inRepaint = false; | - |
5855 | } | 0 |
5856 | } else { | 0 |
5857 | d->repaint_sys(rgn); | - |
5858 | } | 0 |
5859 | } | - |
5860 | void QWidget::update() | - |
5861 | { | - |
5862 | update(rect()); | - |
5863 | } executed: } Execution Count:144411 | 144411 |
5864 | void QWidget::update(const QRect &rect) | - |
5865 | { | - |
5866 | if (!isVisible() || !updatesEnabled() || rect.isEmpty()) evaluated: !isVisible() yes Evaluation Count:116518 | yes Evaluation Count:47516 |
evaluated: !updatesEnabled() yes Evaluation Count:346 | yes Evaluation Count:47170 |
evaluated: rect.isEmpty() yes Evaluation Count:1081 | yes Evaluation Count:46089 |
| 346-116518 |
5867 | return; executed: return; Execution Count:117945 | 117945 |
5868 | | - |
5869 | if (testAttribute(Qt::WA_WState_InPaintEvent)) { evaluated: testAttribute(Qt::WA_WState_InPaintEvent) yes Evaluation Count:167 | yes Evaluation Count:45922 |
| 167-45922 |
5870 | QApplication::postEvent(this, new QUpdateLaterEvent(rect)); | - |
5871 | return; executed: return; Execution Count:167 | 167 |
5872 | } | - |
5873 | | - |
5874 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:45922 | no Evaluation Count:0 |
| 0-45922 |
5875 | | - |
5876 | | - |
5877 | | - |
5878 | | - |
5879 | | - |
5880 | | - |
5881 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5882 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) partially evaluated: tlwExtra yes Evaluation Count:45922 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:45922 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:45922 | no Evaluation Count:0 |
| 0-45922 |
5883 | tlwExtra->backingStoreTracker->markDirty(rect, this); executed: tlwExtra->backingStoreTracker->markDirty(rect, this); Execution Count:45922 | 45922 |
5884 | } else { executed: } Execution Count:45922 | 45922 |
5885 | d_func()->repaint_sys(rect); | - |
5886 | } | 0 |
5887 | } | - |
5888 | | - |
5889 | | - |
5890 | | - |
5891 | | - |
5892 | | - |
5893 | | - |
5894 | void QWidget::update(const QRegion &rgn) | - |
5895 | { | - |
5896 | if (!isVisible() || !updatesEnabled() || rgn.isEmpty()) evaluated: !isVisible() yes Evaluation Count:517 | yes Evaluation Count:10162 |
evaluated: !updatesEnabled() yes Evaluation Count:181 | yes Evaluation Count:9981 |
evaluated: rgn.isEmpty() yes Evaluation Count:1229 | yes Evaluation Count:8752 |
| 181-10162 |
5897 | return; executed: return; Execution Count:1927 | 1927 |
5898 | | - |
5899 | if (testAttribute(Qt::WA_WState_InPaintEvent)) { partially evaluated: testAttribute(Qt::WA_WState_InPaintEvent) no Evaluation Count:0 | yes Evaluation Count:8752 |
| 0-8752 |
5900 | QApplication::postEvent(this, new QUpdateLaterEvent(rgn)); | - |
5901 | return; | 0 |
5902 | } | - |
5903 | | - |
5904 | if (hasBackingStoreSupport()) { partially evaluated: hasBackingStoreSupport() yes Evaluation Count:8752 | no Evaluation Count:0 |
| 0-8752 |
5905 | | - |
5906 | | - |
5907 | | - |
5908 | | - |
5909 | | - |
5910 | | - |
5911 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - |
5912 | if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) partially evaluated: tlwExtra yes Evaluation Count:8752 | no Evaluation Count:0 |
partially evaluated: !tlwExtra->inTopLevelResize yes Evaluation Count:8752 | no Evaluation Count:0 |
partially evaluated: tlwExtra->backingStore yes Evaluation Count:8752 | no Evaluation Count:0 |
| 0-8752 |
5913 | tlwExtra->backingStoreTracker->markDirty(rgn, this); executed: tlwExtra->backingStoreTracker->markDirty(rgn, this); Execution Count:8752 | 8752 |
5914 | } else { executed: } Execution Count:8752 | 8752 |
5915 | d_func()->repaint_sys(rgn); | - |
5916 | } | 0 |
5917 | } | - |
5918 | | - |
5919 | | - |
5920 | | - |
5921 | | - |
5922 | | - |
5923 | | - |
5924 | | - |
5925 | static void setAttribute_internal(Qt::WidgetAttribute attribute, bool on, QWidgetData *data, | - |
5926 | QWidgetPrivate *d) | - |
5927 | { | - |
5928 | if (attribute < int(8*sizeof(uint))) { evaluated: attribute < int(8*sizeof(uint)) yes Evaluation Count:168894 | yes Evaluation Count:290354 |
| 168894-290354 |
5929 | if (on) evaluated: on yes Evaluation Count:106423 | yes Evaluation Count:62471 |
| 62471-106423 |
5930 | data->widget_attributes |= (1<<attribute); executed: data->widget_attributes |= (1<<attribute); Execution Count:106423 | 106423 |
5931 | else | - |
5932 | data->widget_attributes &= ~(1<<attribute); executed: data->widget_attributes &= ~(1<<attribute); Execution Count:62471 | 62471 |
5933 | } else { | - |
5934 | const int x = attribute - 8*sizeof(uint); | - |
5935 | const int int_off = x / (8*sizeof(uint)); | - |
5936 | if (on) evaluated: on yes Evaluation Count:235831 | yes Evaluation Count:54523 |
| 54523-235831 |
5937 | 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:235831 | 235831 |
5938 | else | - |
5939 | 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:54523 | 54523 |
5940 | } | - |
5941 | } | - |
5942 | void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) | - |
5943 | { | - |
5944 | if (testAttribute(attribute) == on) evaluated: testAttribute(attribute) == on yes Evaluation Count:393693 | yes Evaluation Count:459248 |
| 393693-459248 |
5945 | return; executed: return; Execution Count:393693 | 393693 |
5946 | | - |
5947 | QWidgetPrivate * const d = d_func(); | - |
5948 | qt_noop(); | - |
5949 | setAttribute_internal(attribute, on, data, d); | - |
5950 | | - |
5951 | switch (attribute) { | - |
5952 | | - |
5953 | | - |
5954 | case Qt::WA_AcceptDrops: { | - |
5955 | if (on && !testAttribute(Qt::WA_DropSiteRegistered)) evaluated: on yes Evaluation Count:2134 | yes Evaluation Count:362 |
evaluated: !testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:1479 | yes Evaluation Count:655 |
| 362-2134 |
5956 | setAttribute(Qt::WA_DropSiteRegistered, true); executed: setAttribute(Qt::WA_DropSiteRegistered, true); Execution Count:1479 | 1479 |
5957 | else if (!on && (isWindow() || !parentWidget() || !parentWidget()->testAttribute(Qt::WA_DropSiteRegistered))) evaluated: !on yes Evaluation Count:362 | yes Evaluation Count:655 |
evaluated: isWindow() yes Evaluation Count:6 | yes Evaluation Count:356 |
partially evaluated: !parentWidget() no Evaluation Count:0 | yes Evaluation Count:356 |
evaluated: !parentWidget()->testAttribute(Qt::WA_DropSiteRegistered) yes Evaluation Count:355 | yes Evaluation Count:1 |
| 0-655 |
5958 | setAttribute(Qt::WA_DropSiteRegistered, false); executed: setAttribute(Qt::WA_DropSiteRegistered, false); Execution Count:361 | 361 |
5959 | QEvent e(QEvent::AcceptDropsChange); | - |
5960 | QApplication::sendEvent(this, &e); | - |
5961 | break; executed: break; Execution Count:2496 | 2496 |
5962 | } | - |
5963 | case Qt::WA_DropSiteRegistered: { | - |
5964 | d->registerDropSite(on); | - |
5965 | for (int i = 0; i < d->children.size(); ++i) { evaluated: i < d->children.size() yes Evaluation Count:7774 | yes Evaluation Count:6025 |
| 6025-7774 |
5966 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - |
5967 | if (w && !w->isWindow() && !w->testAttribute(Qt::WA_AcceptDrops) && w->testAttribute(Qt::WA_DropSiteRegistered) != on) evaluated: w yes Evaluation Count:4188 | yes Evaluation Count:3586 |
partially evaluated: !w->isWindow() yes Evaluation Count:4188 | no Evaluation Count:0 |
evaluated: !w->testAttribute(Qt::WA_AcceptDrops) yes Evaluation Count:4181 | yes Evaluation Count:7 |
partially evaluated: w->testAttribute(Qt::WA_DropSiteRegistered) != on yes Evaluation Count:4181 | no Evaluation Count:0 |
| 0-4188 |
5968 | w->setAttribute(Qt::WA_DropSiteRegistered, on); executed: w->setAttribute(Qt::WA_DropSiteRegistered, on); Execution Count:4181 | 4181 |
5969 | } executed: } Execution Count:7774 | 7774 |
5970 | break; executed: break; Execution Count:6025 | 6025 |
5971 | } | - |
5972 | | - |
5973 | | - |
5974 | case Qt::WA_NoChildEventsForParent: | - |
5975 | d->sendChildEvents = !on; | - |
5976 | break; executed: break; Execution Count:1 | 1 |
5977 | case Qt::WA_NoChildEventsFromChildren: | - |
5978 | d->receiveChildEvents = !on; | - |
5979 | break; | 0 |
5980 | case Qt::WA_MacBrushedMetal: | - |
5981 | case Qt::WA_MacAlwaysShowToolWindow: | - |
5982 | | - |
5983 | | - |
5984 | | - |
5985 | break; | 0 |
5986 | case Qt::WA_MacNormalSize: | - |
5987 | case Qt::WA_MacSmallSize: | - |
5988 | case Qt::WA_MacMiniSize: | - |
5989 | break; | 0 |
5990 | case Qt::WA_ShowModal: | - |
5991 | if (!on) { evaluated: !on yes Evaluation Count:45 | yes Evaluation Count:87 |
| 45-87 |
5992 | | - |
5993 | data->window_modality = Qt::NonModal; | - |
5994 | } else if (data->window_modality == Qt::NonModal) { executed: } Execution Count:45 partially evaluated: data->window_modality == Qt::NonModal yes Evaluation Count:87 | no Evaluation Count:0 |
| 0-87 |
5995 | | - |
5996 | | - |
5997 | | - |
5998 | | - |
5999 | QWidget *w = parentWidget(); | - |
6000 | if (w) evaluated: w yes Evaluation Count:35 | yes Evaluation Count:52 |
| 35-52 |
6001 | w = w->window(); executed: w = w->window(); Execution Count:35 | 35 |
6002 | while (w && !w->testAttribute(Qt::WA_GroupLeader)) { evaluated: w yes Evaluation Count:35 | yes Evaluation Count:87 |
partially evaluated: !w->testAttribute(Qt::WA_GroupLeader) yes Evaluation Count:35 | no Evaluation Count:0 |
| 0-87 |
6003 | w = w->parentWidget(); | - |
6004 | if (w) partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:35 |
| 0-35 |
6005 | w = w->window(); never executed: w = w->window(); | 0 |
6006 | } executed: } Execution Count:35 | 35 |
6007 | data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader)) partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:87 |
never evaluated: w->testAttribute(Qt::WA_GroupLeader) | 0-87 |
6008 | ? Qt::WindowModal | - |
6009 | : Qt::ApplicationModal; | - |
6010 | | - |
6011 | | - |
6012 | | - |
6013 | } executed: } Execution Count:87 | 87 |
6014 | if (testAttribute(Qt::WA_WState_Created)) { evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:45 | yes Evaluation Count:87 |
| 45-87 |
6015 | | - |
6016 | d->setModal_sys(); | - |
6017 | } executed: } Execution Count:45 | 45 |
6018 | break; executed: break; Execution Count:132 | 132 |
6019 | case Qt::WA_MouseTracking: { | - |
6020 | QEvent e(QEvent::MouseTrackingChange); | - |
6021 | QApplication::sendEvent(this, &e); | - |
6022 | break; } executed: break; Execution Count:3798 | 3798 |
6023 | case Qt::WA_NativeWindow: { | - |
6024 | d->createTLExtra(); | - |
6025 | | - |
6026 | QWidget *focusWidget = d->effectiveFocusWidget(); | - |
6027 | if (on && !internalWinId() && hasFocus() partially evaluated: on yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: !internalWinId() yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: hasFocus() no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
6028 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { never evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) | 0 |
6029 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); | - |
6030 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6031 | } | 0 |
6032 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget() partially evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) yes Evaluation Count:5 | no Evaluation Count:0 |
evaluated: parentWidget() yes Evaluation Count:3 | yes Evaluation Count:2 |
| 0-5 |
6033 | | - |
6034 | | - |
6035 | | - |
6036 | | - |
6037 | | - |
6038 | ) | - |
6039 | parentWidget()->d_func()->enforceNativeChildren(); executed: parentWidget()->d_func()->enforceNativeChildren(); Execution Count:3 | 3 |
6040 | if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created)) partially evaluated: on yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: !internalWinId() yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
6041 | d->createWinId(); never executed: d->createWinId(); | 0 |
6042 | if (isEnabled() && focusWidget->isEnabled() partially evaluated: isEnabled() yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: focusWidget->isEnabled() yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
6043 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { partially evaluated: focusWidget->testAttribute(Qt::WA_InputMethodEnabled) no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
6044 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6045 | } | 0 |
6046 | | - |
6047 | break; executed: break; Execution Count:5 | 5 |
6048 | } | - |
6049 | case Qt::WA_PaintOnScreen: | - |
6050 | d->updateIsOpaque(); | - |
6051 | case Qt::WA_OpaquePaintEvent: code before this statement executed: case Qt::WA_OpaquePaintEvent: Execution Count:107 | 107 |
6052 | d->updateIsOpaque(); | - |
6053 | break; executed: break; Execution Count:7719 | 7719 |
6054 | case Qt::WA_NoSystemBackground: | - |
6055 | d->updateIsOpaque(); | - |
6056 | | - |
6057 | case Qt::WA_UpdatesDisabled: code before this statement executed: case Qt::WA_UpdatesDisabled: Execution Count:51 | 51 |
6058 | d->updateSystemBackground(); | - |
6059 | break; executed: break; Execution Count:28322 | 28322 |
6060 | case Qt::WA_TransparentForMouseEvents: | - |
6061 | | - |
6062 | | - |
6063 | | - |
6064 | break; executed: break; Execution Count:45 | 45 |
6065 | case Qt::WA_InputMethodEnabled: { | - |
6066 | | - |
6067 | if ((static_cast<QApplication *>(QCoreApplication::instance()))->focusObject() == this) { evaluated: (static_cast<QApplication *>(QCoreApplication::instance()))->focusObject() == this yes Evaluation Count:178 | yes Evaluation Count:5575 |
| 178-5575 |
6068 | if (!on) partially evaluated: !on yes Evaluation Count:178 | no Evaluation Count:0 |
| 0-178 |
6069 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); Execution Count:178 | 178 |
6070 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImEnabled); | - |
6071 | } executed: } Execution Count:178 | 178 |
6072 | | - |
6073 | break; executed: break; Execution Count:5753 | 5753 |
6074 | } | - |
6075 | case Qt::WA_WindowPropagation: | - |
6076 | d->resolvePalette(); | - |
6077 | d->resolveFont(); | - |
6078 | d->resolveLocale(); | - |
6079 | break; executed: break; Execution Count:270 | 270 |
6080 | case Qt::WA_DontShowOnScreen: { | - |
6081 | if (on && isVisible()) { partially evaluated: on yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: isVisible() no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
6082 | | - |
6083 | | - |
6084 | | - |
6085 | d->hide_sys(); | - |
6086 | d->show_sys(); | - |
6087 | } | 0 |
6088 | break; executed: break; Execution Count:3 | 3 |
6089 | } | - |
6090 | case Qt::WA_StaticContents: | - |
6091 | if (QWidgetBackingStore *bs = d->maybeBackingStore()) { never evaluated: QWidgetBackingStore *bs = d->maybeBackingStore() | 0 |
6092 | if (on) | 0 |
6093 | bs->addStaticWidget(this); never executed: bs->addStaticWidget(this); | 0 |
6094 | else | - |
6095 | bs->removeStaticWidget(this); never executed: bs->removeStaticWidget(this); | 0 |
6096 | } | - |
6097 | break; | 0 |
6098 | case Qt::WA_TranslucentBackground: | - |
6099 | if (on) { partially evaluated: on yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
6100 | setAttribute(Qt::WA_NoSystemBackground); | - |
6101 | d->updateIsTranslucent(); | - |
6102 | } executed: } Execution Count:3 | 3 |
6103 | | - |
6104 | break; executed: break; Execution Count:3 | 3 |
6105 | case Qt::WA_AcceptTouchEvents: | - |
6106 | | - |
6107 | | - |
6108 | | - |
6109 | | - |
6110 | break; executed: break; Execution Count:3713 | 3713 |
6111 | default: | - |
6112 | break; executed: break; Execution Count:400963 | 400963 |
6113 | } | - |
6114 | } executed: } Execution Count:459248 | 459248 |
6115 | bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const | - |
6116 | { | - |
6117 | const QWidgetPrivate * const d = d_func(); | - |
6118 | const int x = attribute - 8*sizeof(uint); | - |
6119 | const int int_off = x / (8*sizeof(uint)); | - |
6120 | 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:2415052 | 2415052 |
6121 | } | - |
6122 | qreal QWidget::windowOpacity() const | - |
6123 | { | - |
6124 | const QWidgetPrivate * const d = d_func(); | - |
6125 | return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; executed: return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; Execution Count:3 | 3 |
6126 | } | - |
6127 | | - |
6128 | void QWidget::setWindowOpacity(qreal opacity) | - |
6129 | { | - |
6130 | QWidgetPrivate * const d = d_func(); | - |
6131 | if (!isWindow()) partially evaluated: !isWindow() no Evaluation Count:0 | yes Evaluation Count:274 |
| 0-274 |
6132 | return; | 0 |
6133 | | - |
6134 | opacity = qBound(qreal(0.0), opacity, qreal(1.0)); | - |
6135 | QTLWExtra *extra = d->topData(); | - |
6136 | extra->opacity = uint(opacity * 255); | - |
6137 | setAttribute(Qt::WA_WState_WindowOpacitySet); | - |
6138 | d->setWindowOpacity_sys(opacity); | - |
6139 | | - |
6140 | if (!testAttribute(Qt::WA_WState_Created)) partially evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:274 | no Evaluation Count:0 |
| 0-274 |
6141 | return; executed: return; Execution Count:274 | 274 |
6142 | | - |
6143 | | - |
6144 | if (QGraphicsProxyWidget *proxy = graphicsProxyWidget()) { never evaluated: QGraphicsProxyWidget *proxy = graphicsProxyWidget() | 0 |
6145 | | - |
6146 | if (proxy->cacheMode() == QGraphicsItem::NoCache) never evaluated: proxy->cacheMode() == QGraphicsItem::NoCache | 0 |
6147 | proxy->update(); never executed: proxy->update(); | 0 |
6148 | else if (QGraphicsScene *scene = proxy->scene()) never evaluated: QGraphicsScene *scene = proxy->scene() | 0 |
6149 | scene->update(proxy->sceneBoundingRect()); never executed: scene->update(proxy->sceneBoundingRect()); | 0 |
6150 | return; | 0 |
6151 | } | - |
6152 | | - |
6153 | } | 0 |
6154 | bool QWidget::isWindowModified() const | - |
6155 | { | - |
6156 | return testAttribute(Qt::WA_WindowModified); executed: return testAttribute(Qt::WA_WindowModified); Execution Count:485 | 485 |
6157 | } | - |
6158 | | - |
6159 | void QWidget::setWindowModified(bool mod) | - |
6160 | { | - |
6161 | QWidgetPrivate * const d = d_func(); | - |
6162 | setAttribute(Qt::WA_WindowModified, mod); | - |
6163 | | - |
6164 | d->setWindowModified_helper(); | - |
6165 | | - |
6166 | QEvent e(QEvent::ModifiedChange); | - |
6167 | QApplication::sendEvent(this, &e); | - |
6168 | } executed: } Execution Count:199 | 199 |
6169 | | - |
6170 | void QWidgetPrivate::setWindowModified_helper() | - |
6171 | { | - |
6172 | QWidget * const q = q_func(); | - |
6173 | QWindow *window = q->windowHandle(); | - |
6174 | if (!window) evaluated: !window yes Evaluation Count:16 | yes Evaluation Count:1777 |
| 16-1777 |
6175 | return; executed: return; Execution Count:16 | 16 |
6176 | QPlatformWindow *platformWindow = window->handle(); | - |
6177 | if (!platformWindow) evaluated: !platformWindow yes Evaluation Count:1 | yes Evaluation Count:1776 |
| 1-1776 |
6178 | return; executed: return; Execution Count:1 | 1 |
6179 | bool on = q->testAttribute(Qt::WA_WindowModified); | - |
6180 | if (!platformWindow->setWindowModified(on)) { partially evaluated: !platformWindow->setWindowModified(on) yes Evaluation Count:1776 | no Evaluation Count:0 |
| 0-1776 |
6181 | if (!q->windowTitle().contains(QLatin1String("[*]")) && on) evaluated: !q->windowTitle().contains(QLatin1String("[*]")) yes Evaluation Count:1771 | yes Evaluation Count:5 |
partially evaluated: on no Evaluation Count:0 | yes Evaluation Count:1771 |
| 0-1771 |
6182 | QMessageLogger("kernel/qwidget.cpp", 10315, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); never executed: QMessageLogger("kernel/qwidget.cpp", 10315, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); | 0 |
6183 | setWindowTitle_helper(q->windowTitle()); | - |
6184 | setWindowIconText_helper(q->windowIconText()); | - |
6185 | } executed: } Execution Count:1776 | 1776 |
6186 | } executed: } Execution Count:1776 | 1776 |
6187 | void QWidget::setToolTip(const QString &s) | - |
6188 | { | - |
6189 | QWidgetPrivate * const d = d_func(); | - |
6190 | d->toolTip = s; | - |
6191 | | - |
6192 | QEvent event(QEvent::ToolTipChange); | - |
6193 | QApplication::sendEvent(this, &event); | - |
6194 | } executed: } Execution Count:1450 | 1450 |
6195 | | - |
6196 | QString QWidget::toolTip() const | - |
6197 | { | - |
6198 | const QWidgetPrivate * const d = d_func(); | - |
6199 | return d->toolTip; never executed: return d->toolTip; | 0 |
6200 | } | - |
6201 | void QWidget::setStatusTip(const QString &s) | - |
6202 | { | - |
6203 | QWidgetPrivate * const d = d_func(); | - |
6204 | d->statusTip = s; | - |
6205 | } executed: } Execution Count:18 | 18 |
6206 | | - |
6207 | QString QWidget::statusTip() const | - |
6208 | { | - |
6209 | const QWidgetPrivate * const d = d_func(); | - |
6210 | return d->statusTip; never executed: return d->statusTip; | 0 |
6211 | } | - |
6212 | void QWidget::setWhatsThis(const QString &s) | - |
6213 | { | - |
6214 | QWidgetPrivate * const d = d_func(); | - |
6215 | d->whatsThis = s; | - |
6216 | } executed: } Execution Count:18 | 18 |
6217 | | - |
6218 | QString QWidget::whatsThis() const | - |
6219 | { | - |
6220 | const QWidgetPrivate * const d = d_func(); | - |
6221 | return d->whatsThis; never executed: return d->whatsThis; | 0 |
6222 | } | - |
6223 | void QWidget::setAccessibleName(const QString &name) | - |
6224 | { | - |
6225 | QWidgetPrivate * const d = d_func(); | - |
6226 | d->accessibleName = name; | - |
6227 | QAccessibleEvent event(this, QAccessible::NameChanged); | - |
6228 | QAccessible::updateAccessibility(&event); | - |
6229 | } executed: } Execution Count:2369 | 2369 |
6230 | | - |
6231 | QString QWidget::accessibleName() const | - |
6232 | { | - |
6233 | const QWidgetPrivate * const d = d_func(); | - |
6234 | return d->accessibleName; executed: return d->accessibleName; Execution Count:772 | 772 |
6235 | } | - |
6236 | void QWidget::setAccessibleDescription(const QString &description) | - |
6237 | { | - |
6238 | QWidgetPrivate * const d = d_func(); | - |
6239 | d->accessibleDescription = description; | - |
6240 | QAccessibleEvent event(this, QAccessible::DescriptionChanged); | - |
6241 | QAccessible::updateAccessibility(&event); | - |
6242 | } executed: } Execution Count:1667 | 1667 |
6243 | | - |
6244 | QString QWidget::accessibleDescription() const | - |
6245 | { | - |
6246 | const QWidgetPrivate * const d = d_func(); | - |
6247 | return d->accessibleDescription; never executed: return d->accessibleDescription; | 0 |
6248 | } | - |
6249 | int QWidget::grabShortcut(const QKeySequence &key, Qt::ShortcutContext context) | - |
6250 | { | - |
6251 | qt_noop(); | - |
6252 | if (key.isEmpty()) evaluated: key.isEmpty() yes Evaluation Count:1912 | yes Evaluation Count:1192 |
| 1192-1912 |
6253 | return 0; executed: return 0; Execution Count:1912 | 1912 |
6254 | setAttribute(Qt::WA_GrabbedShortcut); | - |
6255 | 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:1192 | 1192 |
6256 | } | - |
6257 | void QWidget::releaseShortcut(int id) | - |
6258 | { | - |
6259 | qt_noop(); | - |
6260 | if (id) evaluated: id yes Evaluation Count:279 | yes Evaluation Count:372 |
| 279-372 |
6261 | (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:279 | 279 |
6262 | } executed: } Execution Count:651 | 651 |
6263 | void QWidget::setShortcutEnabled(int id, bool enable) | - |
6264 | { | - |
6265 | qt_noop(); | - |
6266 | if (id) partially evaluated: id no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
6267 | (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 |
6268 | } executed: } Execution Count:16 | 16 |
6269 | void QWidget::setShortcutAutoRepeat(int id, bool enable) | - |
6270 | { | - |
6271 | qt_noop(); | - |
6272 | if (id) | 0 |
6273 | (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 |
6274 | } | 0 |
6275 | | - |
6276 | | - |
6277 | | - |
6278 | | - |
6279 | | - |
6280 | void QWidget::updateMicroFocus() | - |
6281 | { | - |
6282 | | - |
6283 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->update(Qt::ImQueryAll); | - |
6284 | } executed: } Execution Count:14021 | 14021 |
6285 | void QWidget::raise() | - |
6286 | { | - |
6287 | QWidgetPrivate * const d = d_func(); | - |
6288 | if (!isWindow()) { evaluated: !isWindow() yes Evaluation Count:4364 | yes Evaluation Count:93 |
| 93-4364 |
6289 | QWidget *p = parentWidget(); | - |
6290 | const int parentChildCount = p->d_func()->children.size(); | - |
6291 | if (parentChildCount < 2) evaluated: parentChildCount < 2 yes Evaluation Count:7 | yes Evaluation Count:4357 |
| 7-4357 |
6292 | return; executed: return; Execution Count:7 | 7 |
6293 | const int from = p->d_func()->children.indexOf(this); | - |
6294 | qt_noop(); | - |
6295 | | - |
6296 | if (from != parentChildCount -1) evaluated: from != parentChildCount -1 yes Evaluation Count:2250 | yes Evaluation Count:2107 |
| 2107-2250 |
6297 | p->d_func()->children.move(from, parentChildCount - 1); executed: p->d_func()->children.move(from, parentChildCount - 1); Execution Count:2250 | 2250 |
6298 | if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1746 | yes Evaluation Count:2611 |
evaluated: p->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:549 | yes Evaluation Count:1197 |
| 549-2611 |
6299 | create(); executed: create(); Execution Count:549 | 549 |
6300 | else if (from == parentChildCount - 1) evaluated: from == parentChildCount - 1 yes Evaluation Count:2056 | yes Evaluation Count:1752 |
| 1752-2056 |
6301 | return; executed: return; Execution Count:2056 | 2056 |
6302 | | - |
6303 | QRegion region(rect()); | - |
6304 | d->subtractOpaqueSiblings(region); | - |
6305 | d->invalidateBuffer(region); | - |
6306 | } executed: } Execution Count:2301 | 2301 |
6307 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1956 | yes Evaluation Count:438 |
| 438-1956 |
6308 | d->raise_sys(); executed: d->raise_sys(); Execution Count:1956 | 1956 |
6309 | | - |
6310 | QEvent e(QEvent::ZOrderChange); | - |
6311 | QApplication::sendEvent(this, &e); | - |
6312 | } executed: } Execution Count:2394 | 2394 |
6313 | void QWidget::lower() | - |
6314 | { | - |
6315 | QWidgetPrivate * const d = d_func(); | - |
6316 | if (!isWindow()) { partially evaluated: !isWindow() yes Evaluation Count:883 | no Evaluation Count:0 |
| 0-883 |
6317 | QWidget *p = parentWidget(); | - |
6318 | const int parentChildCount = p->d_func()->children.size(); | - |
6319 | if (parentChildCount < 2) partially evaluated: parentChildCount < 2 no Evaluation Count:0 | yes Evaluation Count:883 |
| 0-883 |
6320 | return; | 0 |
6321 | const int from = p->d_func()->children.indexOf(this); | - |
6322 | qt_noop(); | - |
6323 | | - |
6324 | if (from != 0) evaluated: from != 0 yes Evaluation Count:716 | yes Evaluation Count:167 |
| 167-716 |
6325 | p->d_func()->children.move(from, 0); executed: p->d_func()->children.move(from, 0); Execution Count:716 | 716 |
6326 | if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:863 | yes Evaluation Count:20 |
evaluated: p->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:25 | yes Evaluation Count:838 |
| 20-863 |
6327 | create(); executed: create(); Execution Count:25 | 25 |
6328 | else if (from == 0) evaluated: from == 0 yes Evaluation Count:157 | yes Evaluation Count:701 |
| 157-701 |
6329 | return; executed: return; Execution Count:157 | 157 |
6330 | } | - |
6331 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:37 | yes Evaluation Count:689 |
| 37-689 |
6332 | d->lower_sys(); executed: d->lower_sys(); Execution Count:37 | 37 |
6333 | | - |
6334 | QEvent e(QEvent::ZOrderChange); | - |
6335 | QApplication::sendEvent(this, &e); | - |
6336 | } executed: } Execution Count:726 | 726 |
6337 | void QWidget::stackUnder(QWidget* w) | - |
6338 | { | - |
6339 | QWidgetPrivate * const d = d_func(); | - |
6340 | QWidget *p = parentWidget(); | - |
6341 | if (!w || isWindow() || p != w->parentWidget() || this == w) partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:10 |
partially evaluated: isWindow() no Evaluation Count:0 | yes Evaluation Count:10 |
partially evaluated: p != w->parentWidget() no Evaluation Count:0 | yes Evaluation Count:10 |
partially evaluated: this == w no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
6342 | return; | 0 |
6343 | if (p) { partially evaluated: p yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
6344 | int from = p->d_func()->children.indexOf(this); | - |
6345 | int to = p->d_func()->children.indexOf(w); | - |
6346 | qt_noop(); | - |
6347 | qt_noop(); | - |
6348 | if (from < to) evaluated: from < to yes Evaluation Count:9 | yes Evaluation Count:1 |
| 1-9 |
6349 | --to; executed: --to; Execution Count:9 | 9 |
6350 | | - |
6351 | if (from != to) evaluated: from != to yes Evaluation Count:2 | yes Evaluation Count:8 |
| 2-8 |
6352 | p->d_func()->children.move(from, to); executed: p->d_func()->children.move(from, to); Execution Count:2 | 2 |
6353 | 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:9 |
partially evaluated: p->testAttribute(Qt::WA_WState_Created) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-9 |
6354 | create(); never executed: create(); | 0 |
6355 | else if (from == to) evaluated: from == to yes Evaluation Count:8 | yes Evaluation Count:2 |
| 2-8 |
6356 | return; executed: return; Execution Count:8 | 8 |
6357 | } | - |
6358 | if (testAttribute(Qt::WA_WState_Created)) evaluated: testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
6359 | d->stackUnder_sys(w); executed: d->stackUnder_sys(w); Execution Count:1 | 1 |
6360 | | - |
6361 | QEvent e(QEvent::ZOrderChange); | - |
6362 | QApplication::sendEvent(this, &e); | - |
6363 | } executed: } Execution Count:2 | 2 |
6364 | QRect QWidgetPrivate::frameStrut() const | - |
6365 | { | - |
6366 | const QWidget * const q = q_func(); | - |
6367 | if (!q->isWindow() || (q->windowType() == Qt::Desktop) || q->testAttribute(Qt::WA_DontShowOnScreen)) { partially evaluated: !q->isWindow() no Evaluation Count:0 | yes Evaluation Count:5173 |
evaluated: (q->windowType() == Qt::Desktop) yes Evaluation Count:106 | yes Evaluation Count:5067 |
evaluated: q->testAttribute(Qt::WA_DontShowOnScreen) yes Evaluation Count:6 | yes Evaluation Count:5061 |
| 0-5173 |
6368 | | - |
6369 | return QRect(0, 0, 1, 1); executed: return QRect(0, 0, 1, 1); Execution Count:112 | 112 |
6370 | } | - |
6371 | | - |
6372 | if (data.fstrut_dirty evaluated: data.fstrut_dirty yes Evaluation Count:4725 | yes Evaluation Count:336 |
| 336-4725 |
6373 | | - |
6374 | | - |
6375 | && q->isVisible() evaluated: q->isVisible() yes Evaluation Count:1907 | yes Evaluation Count:2818 |
| 1907-2818 |
6376 | | - |
6377 | && q->testAttribute(Qt::WA_WState_Created)) partially evaluated: q->testAttribute(Qt::WA_WState_Created) yes Evaluation Count:1907 | no Evaluation Count:0 |
| 0-1907 |
6378 | const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); executed: const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); Execution Count:1907 | 1907 |
6379 | | - |
6380 | return maybeTopData() ? maybeTopData()->frameStrut : QRect(); executed: return maybeTopData() ? maybeTopData()->frameStrut : QRect(); Execution Count:5061 | 5061 |
6381 | } | - |
6382 | void QWidget::setBackingStore(QBackingStore *store) | - |
6383 | { | - |
6384 | | - |
6385 | | - |
6386 | if (!isTopLevel()) partially evaluated: !isTopLevel() no Evaluation Count:0 | yes Evaluation Count:1482 |
| 0-1482 |
6387 | return; | 0 |
6388 | | - |
6389 | QWidgetPrivate * const d = d_func(); | - |
6390 | | - |
6391 | QTLWExtra *topData = d->topData(); | - |
6392 | if (topData->backingStore == store) partially evaluated: topData->backingStore == store no Evaluation Count:0 | yes Evaluation Count:1482 |
| 0-1482 |
6393 | return; | 0 |
6394 | | - |
6395 | QBackingStore *oldStore = topData->backingStore; | - |
6396 | delete topData->backingStore; | - |
6397 | topData->backingStore = store; | - |
6398 | | - |
6399 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - |
6400 | if (!bs) partially evaluated: !bs yes Evaluation Count:1482 | no Evaluation Count:0 |
| 0-1482 |
6401 | return; executed: return; Execution Count:1482 | 1482 |
6402 | | - |
6403 | if (isTopLevel()) { never evaluated: isTopLevel() | 0 |
6404 | if (bs->store != oldStore && bs->store != store) never evaluated: bs->store != oldStore never evaluated: bs->store != store | 0 |
6405 | delete bs->store; never executed: delete bs->store; | 0 |
6406 | bs->store = store; | - |
6407 | } | 0 |
6408 | } | 0 |
6409 | | - |
6410 | | - |
6411 | | - |
6412 | | - |
6413 | | - |
6414 | | - |
6415 | QBackingStore *QWidget::backingStore() const | - |
6416 | { | - |
6417 | const QWidgetPrivate * const d = d_func(); | - |
6418 | QTLWExtra *extra = d->maybeTopData(); | - |
6419 | if (extra && extra->backingStore) partially evaluated: extra yes Evaluation Count:4630 | no Evaluation Count:0 |
evaluated: extra->backingStore yes Evaluation Count:3035 | yes Evaluation Count:1595 |
| 0-4630 |
6420 | return extra->backingStore; executed: return extra->backingStore; Execution Count:3035 | 3035 |
6421 | | - |
6422 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - |
6423 | | - |
6424 | return bs ? bs->store : 0; executed: return bs ? bs->store : 0; Execution Count:1595 | 1595 |
6425 | } | - |
6426 | | - |
6427 | void QWidgetPrivate::getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const | - |
6428 | { | - |
6429 | if (left) partially evaluated: left yes Evaluation Count:441 | no Evaluation Count:0 |
| 0-441 |
6430 | *left = (int)leftLayoutItemMargin; executed: *left = (int)leftLayoutItemMargin; Execution Count:441 | 441 |
6431 | if (top) partially evaluated: top yes Evaluation Count:441 | no Evaluation Count:0 |
| 0-441 |
6432 | *top = (int)topLayoutItemMargin; executed: *top = (int)topLayoutItemMargin; Execution Count:441 | 441 |
6433 | if (right) partially evaluated: right yes Evaluation Count:441 | no Evaluation Count:0 |
| 0-441 |
6434 | *right = (int)rightLayoutItemMargin; executed: *right = (int)rightLayoutItemMargin; Execution Count:441 | 441 |
6435 | if (bottom) partially evaluated: bottom yes Evaluation Count:441 | no Evaluation Count:0 |
| 0-441 |
6436 | *bottom = (int)bottomLayoutItemMargin; executed: *bottom = (int)bottomLayoutItemMargin; Execution Count:441 | 441 |
6437 | } executed: } Execution Count:441 | 441 |
6438 | | - |
6439 | void QWidgetPrivate::setLayoutItemMargins(int left, int top, int right, int bottom) | - |
6440 | { | - |
6441 | if (leftLayoutItemMargin == left never evaluated: leftLayoutItemMargin == left | 0 |
6442 | && topLayoutItemMargin == top never evaluated: topLayoutItemMargin == top | 0 |
6443 | && rightLayoutItemMargin == right never evaluated: rightLayoutItemMargin == right | 0 |
6444 | && bottomLayoutItemMargin == bottom) never evaluated: bottomLayoutItemMargin == bottom | 0 |
6445 | return; | 0 |
6446 | | - |
6447 | QWidget * const q = q_func(); | - |
6448 | leftLayoutItemMargin = (signed char)left; | - |
6449 | topLayoutItemMargin = (signed char)top; | - |
6450 | rightLayoutItemMargin = (signed char)right; | - |
6451 | bottomLayoutItemMargin = (signed char)bottom; | - |
6452 | q->updateGeometry(); | - |
6453 | } | 0 |
6454 | | - |
6455 | void QWidgetPrivate::setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt) | - |
6456 | { | - |
6457 | QWidget * const q = q_func(); | - |
6458 | QStyleOption myOpt; | - |
6459 | if (!opt) { evaluated: !opt yes Evaluation Count:19965 | yes Evaluation Count:3959 |
| 3959-19965 |
6460 | myOpt.initFrom(q); | - |
6461 | myOpt.rect.setRect(0, 0, 32768, 32768); | - |
6462 | opt = &myOpt; | - |
6463 | } executed: } Execution Count:19965 | 19965 |
6464 | | - |
6465 | QRect liRect = q->style()->subElementRect(element, opt, q); | - |
6466 | if (liRect.isValid()) { evaluated: liRect.isValid() yes Evaluation Count:30 | yes Evaluation Count:23894 |
| 30-23894 |
6467 | leftLayoutItemMargin = (signed char)(opt->rect.left() - liRect.left()); | - |
6468 | topLayoutItemMargin = (signed char)(opt->rect.top() - liRect.top()); | - |
6469 | rightLayoutItemMargin = (signed char)(liRect.right() - opt->rect.right()); | - |
6470 | bottomLayoutItemMargin = (signed char)(liRect.bottom() - opt->rect.bottom()); | - |
6471 | } else { executed: } Execution Count:30 | 30 |
6472 | leftLayoutItemMargin = 0; | - |
6473 | topLayoutItemMargin = 0; | - |
6474 | rightLayoutItemMargin = 0; | - |
6475 | bottomLayoutItemMargin = 0; | - |
6476 | } executed: } Execution Count:23894 | 23894 |
6477 | } | - |
6478 | | - |
6479 | void QWidgetPrivate::adjustQuitOnCloseAttribute() | - |
6480 | { | - |
6481 | QWidget * const q = q_func(); | - |
6482 | | - |
6483 | if (!q->parentWidget()) { evaluated: !q->parentWidget() yes Evaluation Count:33939 | yes Evaluation Count:35 |
| 35-33939 |
6484 | Qt::WindowType type = q->windowType(); | - |
6485 | if (type == Qt::Widget || type == Qt::SubWindow) evaluated: type == Qt::Widget yes Evaluation Count:32614 | yes Evaluation Count:1325 |
partially evaluated: type == Qt::SubWindow no Evaluation Count:0 | yes Evaluation Count:1325 |
| 0-32614 |
6486 | type = Qt::Window; executed: type = Qt::Window; Execution Count:32614 | 32614 |
6487 | if (type != Qt::Widget && type != Qt::Window && type != Qt::Dialog) partially evaluated: type != Qt::Widget yes Evaluation Count:33939 | no Evaluation Count:0 |
evaluated: type != Qt::Window yes Evaluation Count:1079 | yes Evaluation Count:32860 |
evaluated: type != Qt::Dialog yes Evaluation Count:773 | yes Evaluation Count:306 |
| 0-33939 |
6488 | q->setAttribute(Qt::WA_QuitOnClose, false); executed: q->setAttribute(Qt::WA_QuitOnClose, false); Execution Count:773 | 773 |
6489 | } executed: } Execution Count:33939 | 33939 |
6490 | } executed: } Execution Count:33974 | 33974 |
6491 | | - |
6492 | | - |
6493 | | - |
6494 | __attribute__((visibility("default"))) QWidgetData *qt_qwidget_data(QWidget *widget) | - |
6495 | { | - |
6496 | return widget->data; never executed: return widget->data; | 0 |
6497 | } | - |
6498 | | - |
6499 | __attribute__((visibility("default"))) QWidgetPrivate *qt_widget_private(QWidget *widget) | - |
6500 | { | - |
6501 | return widget->d_func(); executed: return widget->d_func(); Execution Count:787 | 787 |
6502 | } | - |
6503 | QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const | - |
6504 | { | - |
6505 | const QWidgetPrivate * const d = d_func(); | - |
6506 | if (d->extra) { evaluated: d->extra yes Evaluation Count:4015 | yes Evaluation Count:31062 |
| 4015-31062 |
6507 | return d->extra->proxyWidget; executed: return d->extra->proxyWidget; Execution Count:4015 | 4015 |
6508 | } | - |
6509 | return 0; executed: return 0; Execution Count:31062 | 31062 |
6510 | } | - |
6511 | void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags) | - |
6512 | { | - |
6513 | QWidgetPrivate * const d = d_func(); | - |
6514 | d->gestureContext.insert(gesture, flags); | - |
6515 | (void)QGestureManager::instance(); | - |
6516 | } executed: } Execution Count:4092 | 4092 |
6517 | | - |
6518 | | - |
6519 | | - |
6520 | | - |
6521 | | - |
6522 | | - |
6523 | | - |
6524 | void QWidget::ungrabGesture(Qt::GestureType gesture) | - |
6525 | { | - |
6526 | QWidgetPrivate * const d = d_func(); | - |
6527 | if (d->gestureContext.remove(gesture)) { partially evaluated: d->gestureContext.remove(gesture) yes Evaluation Count:3422 | no Evaluation Count:0 |
| 0-3422 |
6528 | if (QGestureManager *manager = QGestureManager::instance()) partially evaluated: QGestureManager *manager = QGestureManager::instance() yes Evaluation Count:3422 | no Evaluation Count:0 |
| 0-3422 |
6529 | manager->cleanupCachedGestures(this, gesture); executed: manager->cleanupCachedGestures(this, gesture); Execution Count:3422 | 3422 |
6530 | } executed: } Execution Count:3422 | 3422 |
6531 | } executed: } Execution Count:3422 | 3422 |
6532 | void QWidget::initPainter(QPainter *painter) const | - |
6533 | { | - |
6534 | const QPalette &pal = palette(); | - |
6535 | painter->d_func()->state->pen = QPen(pal.brush(foregroundRole()), 1); | - |
6536 | painter->d_func()->state->bgBrush = pal.brush(backgroundRole()); | - |
6537 | QFont f(font(), const_cast<QWidget *>(this)); | - |
6538 | painter->d_func()->state->deviceFont = f; | - |
6539 | painter->d_func()->state->font = f; | - |
6540 | } executed: } Execution Count:11729 | 11729 |
6541 | | - |
6542 | QPaintDevice *QWidget::redirected(QPoint *offset) const | - |
6543 | { | - |
6544 | return d_func()->redirected(offset); executed: return d_func()->redirected(offset); Execution Count:11728 | 11728 |
6545 | } | - |
6546 | | - |
6547 | QPainter *QWidget::sharedPainter() const | - |
6548 | { | - |
6549 | | - |
6550 | if (!d_func()->redirectDev) partially evaluated: !d_func()->redirectDev no Evaluation Count:0 | yes Evaluation Count:21788 |
| 0-21788 |
6551 | return 0; never executed: return 0; | 0 |
6552 | | - |
6553 | QPainter *sp = d_func()->sharedPainter(); | - |
6554 | if (!sp || !sp->isActive()) evaluated: !sp yes Evaluation Count:21786 | yes Evaluation Count:2 |
partially evaluated: !sp->isActive() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-21786 |
6555 | return 0; executed: return 0; Execution Count:21786 | 21786 |
6556 | | - |
6557 | if (sp->paintEngine()->paintDevice() != d_func()->redirectDev) partially evaluated: sp->paintEngine()->paintDevice() != d_func()->redirectDev no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
6558 | return 0; never executed: return 0; | 0 |
6559 | | - |
6560 | return sp; executed: return sp; Execution Count:2 | 2 |
6561 | } | - |
6562 | void QWidget::setMask(const QRegion &newMask) | - |
6563 | { | - |
6564 | QWidgetPrivate * const d = d_func(); | - |
6565 | | - |
6566 | d->createExtra(); | - |
6567 | if (newMask == d->extra->mask) evaluated: newMask == d->extra->mask yes Evaluation Count:22 | yes Evaluation Count:26 |
| 22-26 |
6568 | return; executed: return; Execution Count:22 | 22 |
6569 | | - |
6570 | | - |
6571 | const QRegion oldMask(d->extra->mask); | - |
6572 | | - |
6573 | | - |
6574 | d->extra->mask = newMask; | - |
6575 | d->extra->hasMask = !newMask.isEmpty(); | - |
6576 | | - |
6577 | | - |
6578 | if (!testAttribute(Qt::WA_WState_Created)) evaluated: !testAttribute(Qt::WA_WState_Created) yes Evaluation Count:5 | yes Evaluation Count:21 |
| 5-21 |
6579 | return; executed: return; Execution Count:5 | 5 |
6580 | | - |
6581 | | - |
6582 | d->setMask_sys(newMask); | - |
6583 | | - |
6584 | | - |
6585 | if (!isVisible()) evaluated: !isVisible() yes Evaluation Count:1 | yes Evaluation Count:20 |
| 1-20 |
6586 | return; executed: return; Execution Count:1 | 1 |
6587 | | - |
6588 | if (!d->extra->hasMask) { partially evaluated: !d->extra->hasMask no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
6589 | | - |
6590 | QRegion expose(rect()); | - |
6591 | expose -= oldMask; | - |
6592 | if (!expose.isEmpty()) { never evaluated: !expose.isEmpty() | 0 |
6593 | d->setDirtyOpaqueRegion(); | - |
6594 | update(expose); | - |
6595 | } | 0 |
6596 | return; | 0 |
6597 | } | - |
6598 | | - |
6599 | if (!isWindow()) { partially evaluated: !isWindow() yes Evaluation Count:20 | no Evaluation Count:0 |
| 0-20 |
6600 | | - |
6601 | QRegion parentExpose(rect()); | - |
6602 | parentExpose -= newMask; | - |
6603 | if (!parentExpose.isEmpty()) { partially evaluated: !parentExpose.isEmpty() yes Evaluation Count:20 | no Evaluation Count:0 |
| 0-20 |
6604 | d->setDirtyOpaqueRegion(); | - |
6605 | parentExpose.translate(data->crect.topLeft()); | - |
6606 | parentWidget()->update(parentExpose); | - |
6607 | } executed: } Execution Count:20 | 20 |
6608 | | - |
6609 | | - |
6610 | if (!oldMask.isEmpty()) partially evaluated: !oldMask.isEmpty() yes Evaluation Count:20 | no Evaluation Count:0 |
| 0-20 |
6611 | update(newMask - oldMask); executed: update(newMask - oldMask); Execution Count:20 | 20 |
6612 | } executed: } Execution Count:20 | 20 |
6613 | | - |
6614 | } executed: } Execution Count:20 | 20 |
6615 | void QWidget::setMask(const QBitmap &bitmap) | - |
6616 | { | - |
6617 | setMask(QRegion(bitmap)); | - |
6618 | } executed: } Execution Count:4 | 4 |
6619 | void QWidget::clearMask() | - |
6620 | { | - |
6621 | setMask(QRegion()); | - |
6622 | } | 0 |
6623 | | - |
6624 | | - |
6625 | | - |
| | |