OpenCoverage

qwidget.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwidget.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22static bool qt_enable_backingstore = true;-
23static inline bool qRectIntersects(const QRect &r1, const QRect &r2)-
24{-
25 return
never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
(qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) &&
never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
0
26 qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
0
27}-
28-
29static inline bool hasBackingStoreSupport()-
30{-
31 return
never executed: return true;
true;
never executed: return true;
0
32}-
33-
34-
35-
36-
37-
38extern bool qt_sendSpontaneousEvent(QObject*, QEvent*);-
39extern QDesktopWidget *qt_desktopWidget;-
40QWidgetBackingStoreTracker::QWidgetBackingStoreTracker()-
41 : m_ptr(0)-
42{-
43-
44}
never executed: end of block
0
45-
46QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker()-
47{-
48 delete m_ptr;-
49}
never executed: end of block
0
50-
51-
52-
53-
54-
55-
56-
57void QWidgetBackingStoreTracker::create(QWidget *widget)-
58{-
59 destroy();-
60 m_ptr = new QWidgetBackingStore(widget);-
61}
never executed: end of block
0
62-
63-
64-
65-
66-
67-
68void QWidgetBackingStoreTracker::destroy()-
69{-
70 delete m_ptr;-
71 m_ptr = 0;-
72 m_widgets.clear();-
73}
never executed: end of block
0
74-
75-
76-
77-
78-
79-
80void QWidgetBackingStoreTracker::registerWidget(QWidget *w)-
81{-
82 ((!(m_ptr)) ? qt_assert("m_ptr",__FILE__,203) : qt_noop());-
83 ((!(w->internalWinId())) ? qt_assert("w->internalWinId()",__FILE__,204) : qt_noop());-
84 ((!(qt_widget_private(w)->maybeBackingStore() == m_ptr)) ? qt_assert("qt_widget_private(w)->maybeBackingStore() == m_ptr",__FILE__,205) : qt_noop());-
85 m_widgets.insert(w);-
86}
never executed: end of block
0
87void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)-
88{-
89 if (m_widgets.remove(w)
m_widgets.remove(w)Description
TRUEnever evaluated
FALSEnever evaluated
&& m_widgets.isEmpty()
m_widgets.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
90 delete m_ptr;-
91 m_ptr = 0;-
92 }
never executed: end of block
0
93}
never executed: end of block
0
94-
95-
96-
97-
98-
99void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget)-
100{-
101 unregisterWidget(widget);-
102 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(widget->children())>::type> _container_((widget->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *child = *_container_.i; _container_.control; _container_.control = 0)-
103 if (QWidget *childWidget = qobject_cast<QWidget *>(child)
QWidget *child...dget *>(child)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
104 unregisterWidgetSubtree(childWidget);
never executed: unregisterWidgetSubtree(childWidget);
0
105}
never executed: end of block
0
106-
107QWidgetPrivate::QWidgetPrivate(int version)-
108 : QObjectPrivate(version)-
109 , extra(0)-
110 , focus_next(0)-
111 , focus_prev(0)-
112 , focus_child(0)-
113 , layout(0)-
114 , needsFlush(0)-
115 , redirectDev(0)-
116 , widgetItem(0)-
117 , extraPaintEngine(0)-
118 , polished(0)-
119 , graphicsEffect(0)-
120-
121 , imHints(Qt::ImhNone)-
122-
123-
124 , toolTipDuration(-1)-
125-
126 , inheritedFontResolveMask(0)-
127 , inheritedPaletteResolveMask(0)-
128 , leftmargin(0)-
129 , topmargin(0)-
130 , rightmargin(0)-
131 , bottommargin(0)-
132 , leftLayoutItemMargin(0)-
133 , topLayoutItemMargin(0)-
134 , rightLayoutItemMargin(0)-
135 , bottomLayoutItemMargin(0)-
136 , hd(0)-
137 , size_policy(QSizePolicy::Preferred, QSizePolicy::Preferred)-
138 , fg_role(QPalette::NoRole)-
139 , bg_role(QPalette::NoRole)-
140 , dirtyOpaqueChildren(1)-
141 , isOpaque(0)-
142 , retainSizeWhenHiddenChanged(0)-
143 , inDirtyList(0)-
144 , isScrolled(0)-
145 , isMoved(0)-
146 , usesDoubleBufferedGLContext(0)-
147 , mustHaveWindowHandle(0)-
148 , renderToTexture(0)-
149 , textureChildSeen(0)-
150-
151 , inheritsInputMethodHints(0)-
152-
153-
154 , renderToTextureReallyDirty(1)-
155 , renderToTextureComposeActive(0)-
156-
157 , childrenHiddenByWState(0)-
158 , childrenShownByExpose(0)-
159{-
160 if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
__builtin_expe...e()))), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
161 QMessageLogger(__FILE__, 304, __PRETTY_FUNCTION__).fatal("QWidget: Must construct a QApplication before a QWidget");-
162 return;
never executed: return;
0
163 }-
164-
165-
166-
167-
168 (void)version;;-
169-
170-
171-
172-
173-
174-
175 isWidget = true;-
176 memset(high_attributes, 0, sizeof(high_attributes));-
177}
never executed: end of block
0
178-
179-
180QWidgetPrivate::~QWidgetPrivate()-
181{-
182 if (widgetItem
widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
183 widgetItem->wid = 0;
never executed: widgetItem->wid = 0;
0
184-
185 if (extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
186 deleteExtra();
never executed: deleteExtra();
0
187-
188-
189 delete graphicsEffect;-
190-
191}
never executed: end of block
0
192-
193-
194-
195-
196void QWidgetPrivate::scrollChildren(int dx, int dy)-
197{-
198 QWidget * const q = q_func();-
199 if (q->children().size() > 0
q->children().size() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
200 QPoint pd(dx, dy);-
201 QObjectList childObjects = q->children();-
202 for (int i = 0; i < childObjects.size()
i < childObjects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
203 QWidget *w = qobject_cast<QWidget*>(childObjects.at(i));-
204 if (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
&& !w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
205 QPoint oldp = w->pos();-
206 QRect r(w->pos() + pd, w->size());-
207 w->data->crect = r;-
208 if (w->testAttribute(Qt::WA_WState_Created)
w->testAttribu...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
209 w->d_func()->setWSGeometry();
never executed: w->d_func()->setWSGeometry();
0
210 w->d_func()->setDirtyOpaqueRegion();-
211 QMoveEvent e(r.topLeft(), oldp);-
212 QApplication::sendEvent(w, &e);-
213 }
never executed: end of block
0
214 }
never executed: end of block
0
215 }
never executed: end of block
0
216}
never executed: end of block
0
217-
218void QWidgetPrivate::setWSGeometry()-
219{-
220 QWidget * const q = q_func();-
221 if (QWindow *window = q->windowHandle()
QWindow *windo...windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
222 window->setGeometry(data.crect);
never executed: window->setGeometry(data.crect);
0
223}
never executed: end of block
0
224-
225void QWidgetPrivate::updateWidgetTransform(QEvent *event)-
226{-
227 QWidget * const q = q_func();-
228 if (q == QGuiApplication::focusObject()
q == QGuiAppli...:focusObject()Description
TRUEnever evaluated
FALSEnever evaluated
|| event->type() == QEvent::FocusIn
event->type() ...Event::FocusInDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
229 QTransform t;-
230 QPoint p = q->mapTo(q->topLevelWidget(), QPoint(0,0));-
231 t.translate(p.x(), p.y());-
232 QGuiApplication::inputMethod()->setInputItemTransform(t);-
233 QGuiApplication::inputMethod()->setInputItemRectangle(q->rect());-
234 QGuiApplication::inputMethod()->update(Qt::ImInputItemClipRectangle);-
235 }
never executed: end of block
0
236}
never executed: end of block
0
237bool QWidget::autoFillBackground() const-
238{-
239 const QWidgetPrivate * const d = d_func();-
240 return
never executed: return d->extra && d->extra->autoFillBackground;
d->extra && d->extra->autoFillBackground;
never executed: return d->extra && d->extra->autoFillBackground;
0
241}-
242-
243void QWidget::setAutoFillBackground(bool enabled)-
244{-
245 QWidgetPrivate * const d = d_func();-
246 if (!d->extra
!d->extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
247 d->createExtra();
never executed: d->createExtra();
0
248 if (d->extra->autoFillBackground == enabled
d->extra->auto...und == enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
249 return;
never executed: return;
0
250-
251 d->extra->autoFillBackground = enabled;-
252 d->updateIsOpaque();-
253 update();-
254 d->updateIsOpaque();-
255}
never executed: end of block
0
256QWidgetMapper *QWidgetPrivate::mapper = 0;-
257QWidgetSet *QWidgetPrivate::allWidgets = 0;-
258-
259-
260-
261-
262-
263-
264QRegion qt_dirtyRegion(QWidget *widget)-
265{-
266 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
267 return
never executed: return QRegion();
QRegion();
never executed: return QRegion();
0
268-
269 QWidgetBackingStore *bs = qt_widget_private(widget)->maybeBackingStore();-
270 if (!bs
!bsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
271 return
never executed: return QRegion();
QRegion();
never executed: return QRegion();
0
272-
273 return
never executed: return bs->dirtyRegion(widget);
bs->dirtyRegion(widget);
never executed: return bs->dirtyRegion(widget);
0
274}-
275struct QWidgetExceptionCleaner-
276{-
277-
278 static inline void cleanup(QWidget *that, QWidgetPrivate *d)-
279 {-
280-
281 (void)that;;-
282 (void)d;;-
283 }
never executed: end of block
0
284};-
285QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)-
286 : QObject(*new QWidgetPrivate, 0), QPaintDevice()-
287{-
288 if (true) {-
289 d_func()->init(parent, f);-
290 }
never executed: end of block
else {
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
291 QWidgetExceptionCleaner::cleanup(this, d_func());
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
292 qt_noop();
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
293 }
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
294}-
295-
296-
297-
298-
299QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f)-
300 : QObject(dd, 0), QPaintDevice()-
301{-
302 QWidgetPrivate * const d = d_func();-
303 if (true) {-
304 d->init(parent, f);-
305 }
never executed: end of block
else {
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
306 QWidgetExceptionCleaner::cleanup(this, d_func());
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
307 qt_noop();
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
308 }
dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); }
-
309}-
310-
311-
312-
313-
314int QWidget::devType() const-
315{-
316 return
never executed: return QInternal::Widget;
QInternal::Widget;
never executed: return QInternal::Widget;
0
317}-
318-
319-
320-
321void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)-
322{-
323 bool customize = (flags & (Qt::CustomizeWindowHint-
324 | Qt::FramelessWindowHint-
325 | Qt::WindowTitleHint-
326 | Qt::WindowSystemMenuHint-
327 | Qt::WindowMinimizeButtonHint-
328 | Qt::WindowMaximizeButtonHint-
329 | Qt::WindowCloseButtonHint-
330 | Qt::WindowContextHelpButtonHint));-
331-
332 uint type = (flags & Qt::WindowType_Mask);-
333-
334 if ((type == Qt::Widget
type == Qt::WidgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| type == Qt::SubWindow
type == Qt::SubWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) && w
wDescription
TRUEnever evaluated
FALSEnever evaluated
&& !w->parent()
!w->parent()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
335 type = Qt::Window;-
336 flags |= Qt::Window;-
337 }
never executed: end of block
0
338-
339 if (flags & Qt::CustomizeWindowHint
flags & Qt::Cu...mizeWindowHintDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
340-
341-
342-
343-
344-
345 if ((
(flags & (Qt::...lpButtonHint))Description
TRUEnever evaluated
FALSEnever evaluated
flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint))
(flags & (Qt::...lpButtonHint))Description
TRUEnever evaluated
FALSEnever evaluated
0
346-
347-
348-
349 ) {-
350 flags |= Qt::WindowSystemMenuHint;-
351-
352-
353-
354-
355 flags |= Qt::WindowTitleHint;-
356 flags &= ~Qt::FramelessWindowHint;-
357 }
never executed: end of block
0
358 }
never executed: end of block
else if (customize
customizeDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(flags & Qt::FramelessWindowHint)
!(flags & Qt::...essWindowHint)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
359-
360-
361-
362 flags |= Qt::WindowSystemMenuHint;-
363 flags |= Qt::WindowTitleHint;-
364 }
never executed: end of block
0
365 if (customize
customizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
366 ;
never executed: ;
0
367 else if (type == Qt::Dialog
type == Qt::DialogDescription
TRUEnever evaluated
FALSEnever evaluated
|| type == Qt::Sheet
type == Qt::SheetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
368-
369 flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint;
never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint;
0
370-
371-
372-
373 else if (type == Qt::Tool
type == Qt::ToolDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
374 flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
0
375 else-
376 flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint |
never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint;
0
377 Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint;
never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint;
0
378 if (w->testAttribute(Qt::WA_TransparentForMouseEvents)
w->testAttribu...orMouseEvents)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
379 flags |= Qt::WindowTransparentForInput;
never executed: flags |= Qt::WindowTransparentForInput;
0
380}
never executed: end of block
0
381-
382void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)-
383{-
384 QWidget * const q = q_func();-
385 if (__builtin_expect(!!(!qobject_cast<QApplication *>(QCoreApplication::instance())), false)
__builtin_expe...ce())), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
386 QMessageLogger(__FILE__, 1136, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication");
never executed: QMessageLogger(__FILE__, 1136, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication");
0
387-
388 ((!(allWidgets)) ? qt_assert("allWidgets",__FILE__,1138) : qt_noop());-
389 if (allWidgets
allWidgetsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
390 allWidgets->insert(q);
never executed: allWidgets->insert(q);
0
391-
392 int targetScreen = -1;-
393 if (parentWidget
parentWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& parentWidget->windowType() == Qt::Desktop
parentWidget->...== Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
394 const QDesktopScreenWidget *sw = qobject_cast<const QDesktopScreenWidget *>(parentWidget);-
395 targetScreen = sw
swDescription
TRUEnever evaluated
FALSEnever evaluated
? sw->screenNumber() : 0;
0
396 parentWidget = 0;-
397 }
never executed: end of block
0
398-
399 q->data = &data;-
400-
401-
402 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
403 ((!(q->thread() == (static_cast<QApplication *>(QCoreApplication::instance()))->thread())) ? qt_assert_x("QWidget", "Widgets must be created in the GUI thread.",-
404 __FILE__-
405 ,-
406 1154-
407 ) : qt_noop())-
408 ;-
409 }
never executed: end of block
0
410 if (targetScreen >= 0
targetScreen >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
411 topData()->initialScreenIndex = targetScreen;-
412 if (QWindow *window = q->windowHandle()
QWindow *windo...windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
413 window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr));
never executed: window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr));
0
414 }
never executed: end of block
0
415-
416 data.fstrut_dirty = true;-
417-
418 data.winid = 0;-
419 data.widget_attributes = 0;-
420 data.window_flags = f;-
421 data.window_state = 0;-
422 data.focus_policy = 0;-
423 data.context_menu_policy = Qt::DefaultContextMenu;-
424 data.window_modality = Qt::NonModal;-
425-
426 data.sizehint_forced = 0;-
427 data.is_closing = 0;-
428 data.in_show = 0;-
429 data.in_set_window_state = 0;-
430 data.in_destructor = false;-
431-
432-
433 if (f & Qt::MSWindowsOwnDC
f & Qt::MSWindowsOwnDCDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
434 mustHaveWindowHandle = 1;-
435 q->setAttribute(Qt::WA_NativeWindow);-
436 }
never executed: end of block
0
437-
438-
439-
440-
441 q->setAttribute(Qt::WA_QuitOnClose);-
442 adjustQuitOnCloseAttribute();-
443-
444 q->setAttribute(Qt::WA_WState_Hidden);-
445-
446-
447 data.crect = parentWidget
parentWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
? QRect(0,0,100,30) : QRect(0,0,640,480);
0
448 focus_next = focus_prev = q;-
449-
450 if ((
(f & Qt::Windo...== Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
f & Qt::WindowType_Mask) == Qt::Desktop
(f & Qt::Windo...== Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
451 q->create();
never executed: q->create();
0
452 else if (parentWidget
parentWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
453 q->setParent(parentWidget, data.window_flags);
never executed: q->setParent(parentWidget, data.window_flags);
0
454 else {-
455 adjustFlags(data.window_flags, q);-
456 resolveLayoutDirection();-
457-
458 const QBrush &background = q->palette().brush(QPalette::Window);-
459 setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque());-
460 }
never executed: end of block
0
461 data.fnt = QFont(data.fnt, q);-
462-
463-
464-
465-
466 q->setAttribute(Qt::WA_PendingMoveEvent);-
467 q->setAttribute(Qt::WA_PendingResizeEvent);-
468-
469 if (++
++QWidgetPriva...::maxInstancesDescription
TRUEnever evaluated
FALSEnever evaluated
QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances
++QWidgetPriva...::maxInstancesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
470 QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter;
never executed: QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter;
0
471-
472 if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)
QApplicationPr...idgetCreation)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
473 q->create();
never executed: q->create();
0
474-
475 QEvent e(QEvent::Create);-
476 QApplication::sendEvent(q, &e);-
477 QApplication::postEvent(q, new QEvent(QEvent::PolishRequest));-
478-
479 extraPaintEngine = 0;-
480}
never executed: end of block
0
481-
482-
483-
484void QWidgetPrivate::createRecursively()-
485{-
486 QWidget * const q = q_func();-
487 q->create(0, true, true);-
488 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
489 QWidget *child = qobject_cast<QWidget *>(children.at(i));-
490 if (child
childDescription
TRUEnever evaluated
FALSEnever evaluated
&& !child->isHidden()
!child->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& !child->isWindow()
!child->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !child->testAttribute(Qt::WA_WState_Created)
!child->testAt...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
491 child->d_func()->createRecursively();
never executed: child->d_func()->createRecursively();
0
492 }
never executed: end of block
0
493}
never executed: end of block
0
494void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)-
495{-
496 QWidgetPrivate * const d = d_func();-
497 if (__builtin_expect(!!(window), false)
__builtin_expe...indow), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
498 QMessageLogger(__FILE__, 1289, __PRETTY_FUNCTION__).warning("QWidget::create(): Parameter 'window' does not have any effect.");
never executed: QMessageLogger(__FILE__, 1289, __PRETTY_FUNCTION__).warning("QWidget::create(): Parameter 'window' does not have any effect.");
0
499 if (testAttribute(Qt::WA_WState_Created)
testAttribute(...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
&& window == 0
window == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& internalWinId()
internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
500 return;
never executed: return;
0
501-
502 if (d->data.in_destructor
d->data.in_destructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
503 return;
never executed: return;
0
504-
505 Qt::WindowType type = windowType();-
506 Qt::WindowFlags &flags = data->window_flags;-
507-
508 if ((type == Qt::Widget
type == Qt::WidgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| type == Qt::SubWindow
type == Qt::SubWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) && !parentWidget()
!parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
509 type = Qt::Window;-
510 flags |= Qt::Window;-
511 }
never executed: end of block
0
512-
513 if (QWidget *parent = parentWidget()
QWidget *paren...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
514 if (type & Qt::Window
type & Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
515 if (!parent->testAttribute(Qt::WA_WState_Created)
!parent->testA...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
516 parent->createWinId();
never executed: parent->createWinId();
0
517 }
never executed: end of block
else if (testAttribute(Qt::WA_NativeWindow)
testAttribute(..._NativeWindow)Description
TRUEnever evaluated
FALSEnever evaluated
&& !parent->internalWinId()
!parent->internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
0
518 && !testAttribute(Qt::WA_DontCreateNativeAncestors)
!testAttribute...tiveAncestors)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
519-
520-
521-
522 d->createWinId();-
523-
524 ((!(testAttribute(Qt::WA_WState_Created))) ? qt_assert("testAttribute(Qt::WA_WState_Created)",__FILE__,1315) : qt_noop());-
525 ((!(internalWinId())) ? qt_assert("internalWinId()",__FILE__,1316) : qt_noop());-
526 return;
never executed: return;
0
527 }-
528 }
never executed: end of block
0
529-
530-
531 static const bool paintOnScreenEnv = qEnvironmentVariableIntValue("QT_ONSCREEN_PAINT") > 0;-
532 if (paintOnScreenEnv
paintOnScreenEnvDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
533 setAttribute(Qt::WA_PaintOnScreen);
never executed: setAttribute(Qt::WA_PaintOnScreen);
0
534-
535 if (QApplicationPrivate::testAttribute(Qt::AA_NativeWindows)
QApplicationPr...NativeWindows)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
536 setAttribute(Qt::WA_NativeWindow);
never executed: setAttribute(Qt::WA_NativeWindow);
0
537 d->updateIsOpaque();-
538-
539 setAttribute(Qt::WA_WState_Created);-
540 d->create_sys(window, initializeWindow, destroyOldWindow);-
541-
542-
543 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& windowType() != Qt::Desktop
windowType() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
544 d->topData()->backingStoreTracker.destroy();-
545 if (hasBackingStoreSupport()
hasBackingStoreSupport()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
546 d->topData()->backingStoreTracker.create(this);
never executed: d->topData()->backingStoreTracker.create(this);
0
547 }
never executed: end of block
0
548-
549 d->setModal_sys();-
550-
551 if (!isWindow()
!isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& parentWidget()
parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& parentWidget()->testAttribute(Qt::WA_DropSiteRegistered)
parentWidget()...iteRegistered)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
552 setAttribute(Qt::WA_DropSiteRegistered, true);
never executed: setAttribute(Qt::WA_DropSiteRegistered, true);
0
553-
554-
555-
556-
557-
558-
559-
560 if (testAttribute(Qt::WA_SetWindowIcon)
testAttribute(...SetWindowIcon)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
561 d->setWindowIcon_sys();
never executed: d->setWindowIcon_sys();
0
562-
563 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !d->topData()->iconText.isEmpty()
!d->topData()-...Text.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
564 d->setWindowIconText_helper(d->topData()->iconText);
never executed: d->setWindowIconText_helper(d->topData()->iconText);
0
565 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !d->topData()->caption.isEmpty()
!d->topData()-...tion.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
566 d->setWindowTitle_helper(d->topData()->caption);
never executed: d->setWindowTitle_helper(d->topData()->caption);
0
567 if (windowType() != Qt::Desktop
windowType() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
568 d->updateSystemBackground();-
569-
570 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !testAttribute(Qt::WA_SetWindowIcon)
!testAttribute...SetWindowIcon)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
571 d->setWindowIcon_sys();
never executed: d->setWindowIcon_sys();
0
572 }
never executed: end of block
0
573-
574-
575-
576-
577-
578-
579 d->updateFrameStrut();-
580}
never executed: end of block
0
581-
582void q_createNativeChildrenAndSetParent(const QWidget *parentWidget)-
583{-
584 QObjectList children = parentWidget->children();-
585 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
586 if (children.at(i)->isWidgetType()
children.at(i)->isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
587 const QWidget *childWidget = qobject_cast<const QWidget *>(children.at(i));-
588 if (childWidget
childWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
589 if (childWidget->testAttribute(Qt::WA_NativeWindow)
childWidget->t..._NativeWindow)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
590 if (!childWidget->internalWinId()
!childWidget->internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
591 childWidget->winId();
never executed: childWidget->winId();
0
592 if (childWidget->windowHandle()
childWidget->windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
593 if (childWidget->isWindow()
childWidget->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
594 childWidget->windowHandle()->setTransientParent(parentWidget->window()->windowHandle());-
595 }
never executed: end of block
else {
0
596 childWidget->windowHandle()->setParent(childWidget->nativeParentWidget()->windowHandle());-
597 }
never executed: end of block
0
598 }-
599 }
never executed: end of block
else {
0
600 q_createNativeChildrenAndSetParent(childWidget);-
601 }
never executed: end of block
0
602 }-
603 }
never executed: end of block
0
604 }
never executed: end of block
0
605-
606}
never executed: end of block
0
607-
608void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)-
609{-
610 QWidget * const q = q_func();-
611-
612 (void)window;;-
613 (void)initializeWindow;;-
614 (void)destroyOldWindow;;-
615-
616 Qt::WindowFlags flags = data.window_flags;-
617-
618 if (!q->testAttribute(Qt::WA_NativeWindow)
!q->testAttrib..._NativeWindow)Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->isWindow()
!q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
619 return;
never executed: return;
0
620-
621 QWindow *win = topData()->window;-
622-
623-
624 if (!win
!winDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
625 createTLSysExtra();-
626 win = topData()->window;-
627 }
never executed: end of block
0
628-
629 const auto dynamicPropertyNames = q->dynamicPropertyNames();-
630 for (const QByteArray &propertyName : dynamicPropertyNames) {-
631 if (!qstrncmp(propertyName, "_q_platform_", 12)
!qstrncmp(prop...latform_", 12)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
632 win->setProperty(propertyName, q->property(propertyName));
never executed: win->setProperty(propertyName, q->property(propertyName));
0
633 }
never executed: end of block
0
634-
635 if (q->testAttribute(Qt::WA_ShowWithoutActivating)
q->testAttribu...outActivating)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
636 win->setProperty("_q_showWithoutActivating", QVariant(true));
never executed: win->setProperty("_q_showWithoutActivating", QVariant(true));
0
637 if (q->testAttribute(Qt::WA_MacAlwaysShowToolWindow)
q->testAttribu...howToolWindow)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
638 win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true)));
never executed: win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true)));
0
639 setNetWmWindowTypes(true);-
640 win->setFlags(data.window_flags);-
641 fixPosIncludesFrame();-
642 if (q->testAttribute(Qt::WA_Moved)
q->testAttribute(Qt::WA_Moved)Description
TRUEnever evaluated
FALSEnever evaluated
0
643 || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)
!QGuiApplicati...dowManagement)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
644 win->setGeometry(q->geometry());
never executed: win->setGeometry(q->geometry());
0
645 else-
646 win->resize(q->size());
never executed: win->resize(q->size());
0
647 if (win->isTopLevel()
win->isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
648 int screenNumber = topData()->initialScreenIndex;-
649 topData()->initialScreenIndex = -1;-
650 if (screenNumber < 0
screenNumber < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
651 screenNumber = q->windowType() != Qt::Desktop
q->windowType() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
0
652 ? QApplication::desktop()->screenNumber(q) : 0;-
653 }
never executed: end of block
0
654 win->setScreen(QGuiApplication::screens().value(screenNumber, nullptr));-
655 }
never executed: end of block
0
656-
657 QSurfaceFormat format = win->requestedFormat();-
658 if ((
(flags & Qt::Window)Description
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Window)
(flags & Qt::Window)Description
TRUEnever evaluated
FALSEnever evaluated
&& win->surfaceType() != QSurface::OpenGLSurface
win->surfaceTy...:OpenGLSurfaceDescription
TRUEnever evaluated
FALSEnever evaluated
0
659 && q->testAttribute(Qt::WA_TranslucentBackground)
q->testAttribu...entBackground)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
660 format.setAlphaBufferSize(8);-
661 }
never executed: end of block
0
662 win->setFormat(format);-
663-
664 if (QWidget *nativeParent = q->nativeParentWidget()
QWidget *nativ...ParentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
665 if (nativeParent->windowHandle()
nativeParent->windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
666 if (flags & Qt::Window
flags & Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
667 win->setTransientParent(nativeParent->window()->windowHandle());-
668 win->setParent(0);-
669 }
never executed: end of block
else {
0
670 win->setTransientParent(0);-
671 win->setParent(nativeParent->windowHandle());-
672 }
never executed: end of block
0
673 }-
674 }
never executed: end of block
0
675-
676 qt_window_private(win)->positionPolicy = topData()->posIncludesFrame
topData()->posIncludesFrameDescription
TRUEnever evaluated
FALSEnever evaluated
?
0
677 QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;-
678 win->create();-
679-
680 if ((
(flags & Qt::D... == Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Desktop) == Qt::Window
(flags & Qt::D... == Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
681 win->handle()->setFrameStrutEventsEnabled(true);
never executed: win->handle()->setFrameStrutEventsEnabled(true);
0
682-
683 data.window_flags = win->flags();-
684-
685 if (!topData()->role.isNull()
!topData()->role.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
686 QXcbWindowFunctions::setWmWindowRole(win, topData()->role.toLatin1());
never executed: QXcbWindowFunctions::setWmWindowRole(win, topData()->role.toLatin1());
0
687-
688 QBackingStore *store = q->backingStore();-
689-
690 if (!store
!storeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
691 if (win
winDescription
TRUEnever evaluated
FALSEnever evaluated
&& q->windowType() != Qt::Desktop
q->windowType() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
692 if (q->isTopLevel()
q->isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
693 q->setBackingStore(new QBackingStore(win));
never executed: q->setBackingStore(new QBackingStore(win));
0
694 }
never executed: end of block
else {
0
695 q->setAttribute(Qt::WA_PaintOnScreen, true);-
696 }
never executed: end of block
0
697 }-
698-
699 setWindowModified_helper();-
700 WId id = win->winId();-
701-
702 ((!(id != WId(0))) ? qt_assert("id != WId(0)",__FILE__,1508) : qt_noop());-
703 setWinId(id);-
704-
705-
706 q_createNativeChildrenAndSetParent(q);-
707-
708 if (extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& !extra->mask.isEmpty()
!extra->mask.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
709 setMask_sys(extra->mask);
never executed: setMask_sys(extra->mask);
0
710-
711 if (data.crect.width() == 0
data.crect.width() == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| data.crect.height() == 0
data.crect.height() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
712 q->setAttribute(Qt::WA_OutsideWSRange, true);-
713 }
never executed: end of block
else if (q->isVisible()
q->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
714-
715 win->setVisible(true);-
716 }
never executed: end of block
0
717}
never executed: end of block
0
718-
719-
720-
721-
722-
723void QWidgetPrivate::createTLSysExtra()-
724{-
725 QWidget * const q = q_func();-
726 if (!extra->topextra->window
!extra->topextra->windowDescription
TRUEnever evaluated
FALSEnever evaluated
&& (q->testAttribute(Qt::WA_NativeWindow)
q->testAttribu..._NativeWindow)Description
TRUEnever evaluated
FALSEnever evaluated
|| q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
727 extra->topextra->window = new QWidgetWindow(q);-
728 if (extra->minw
extra->minwDescription
TRUEnever evaluated
FALSEnever evaluated
|| extra->minh
extra->minhDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
729 extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh));
never executed: extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh));
0
730 if (extra->maxw != ((1<<24)-1)
extra->maxw != ((1<<24)-1)Description
TRUEnever evaluated
FALSEnever evaluated
|| extra->maxh != ((1<<24)-1)
extra->maxh != ((1<<24)-1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
731 extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh));
never executed: extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh));
0
732 if (extra->topextra->opacity != 255
extra->topextr...opacity != 255Description
TRUEnever evaluated
FALSEnever evaluated
&& q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
733 extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255));
never executed: extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255));
0
734 }
never executed: end of block
0
735-
736}
never executed: end of block
0
737QWidget::~QWidget()-
738{-
739 QWidgetPrivate * const d = d_func();-
740 d->data.in_destructor = true;-
741-
742-
743-
744-
745-
746-
747-
748 if (QGestureManager *manager = QGestureManager::instance()
QGestureManage...er::instance()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
749-
750 for (auto it = d->gestureContext.keyBegin(), end = d->gestureContext.keyEnd(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
751 manager->cleanupCachedGestures(this, *it);
never executed: manager->cleanupCachedGestures(this, *it);
0
752 }
never executed: end of block
0
753 d->gestureContext.clear();-
754-
755-
756-
757 d->registerDropSite(false);-
758-
759-
760-
761 for (int i = 0; i < d->actions.size()
i < d->actions.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
762 QActionPrivate *apriv = d->actions.at(i)->d_func();-
763 apriv->widgets.removeAll(this);-
764 }
never executed: end of block
0
765 d->actions.clear();-
766-
767-
768-
769-
770-
771 if (!QApplicationPrivate::is_app_closing
!QApplicationP...is_app_closingDescription
TRUEnever evaluated
FALSEnever evaluated
&& testAttribute(Qt::WA_GrabbedShortcut)
testAttribute(...abbedShortcut)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
772 (static_cast<
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());
QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());
0
773-
774-
775-
776 delete d->layout;-
777 d->layout = 0;-
778-
779-
780 ((!(d->focus_next->d_func()->focus_prev == this)) ? qt_assert("d->focus_next->d_func()->focus_prev == this",__FILE__,1602) : qt_noop());-
781 ((!(d->focus_prev->d_func()->focus_next == this)) ? qt_assert("d->focus_prev->d_func()->focus_next == this",__FILE__,1603) : qt_noop());-
782-
783 if (d->focus_next != this
d->focus_next != thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
784 d->focus_next->d_func()->focus_prev = d->focus_prev;-
785 d->focus_prev->d_func()->focus_next = d->focus_next;-
786 d->focus_next = d->focus_prev = 0;-
787 }
never executed: end of block
0
788-
789-
790 if (true) {-
791-
792 const QWidget* w = this;-
793 while (w->d_func()->extra
w->d_func()->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& w->d_func()->extra->focus_proxy
w->d_func()->e...a->focus_proxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
794 w = w->d_func()->extra->focus_proxy;
never executed: w = w->d_func()->extra->focus_proxy;
0
795 QWidget *window = w->window();-
796 QWExtra *e = window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
? window->d_func()->extra : 0;
0
797 if (!e
!eDescription
TRUEnever evaluated
FALSEnever evaluated
|| !e->proxyWidget
!e->proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| (w->parentWidget()
w->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& w->parentWidget()->d_func()->focus_child == this
w->parentWidge..._child == thisDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
798-
799 clearFocus();
never executed: clearFocus();
0
800 }
never executed: end of block
else {
dead code: { }
-
801-
802 }
dead code: { }
-
803-
804 d->setDirtyOpaqueRegion();-
805-
806 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& internalWinId()
internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
807 if (true) {-
808 d->close_helper(QWidgetPrivate::CloseNoEvent);-
809 }
never executed: end of block
else {
dead code: { if (true) { hide(); } else { } }
-
810-
811 if (true) {
dead code: { if (true) { hide(); } else { } }
-
812 hide();
dead code: { if (true) { hide(); } else { } }
-
813 } else {
dead code: { }
dead code: { if (true) { hide(); } else { } }
-
814-
815 }
dead code: { }
dead code: { if (true) { hide(); } else { } }
-
816 }
dead code: { if (true) { hide(); } else { } }
-
817 }-
818-
819-
820-
821-
822-
823-
824 else if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
825 (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this);-
826 }
never executed: end of block
0
827-
828 if (QWidgetBackingStore *bs = d->maybeBackingStore()
QWidgetBacking...BackingStore()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
829 bs->removeDirtyWidget(this);-
830 if (testAttribute(Qt::WA_StaticContents)
testAttribute(...taticContents)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
831 bs->removeStaticWidget(this);
never executed: bs->removeStaticWidget(this);
0
832 }
never executed: end of block
0
833-
834 delete d->needsFlush;-
835 d->needsFlush = 0;-
836-
837-
838-
839 bool blocked = d->blockSig;-
840 d->blockSig = 0;-
841-
842 if (d->isSignalConnected(0)
d->isSignalConnected(0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
843 if (true) {-
844 destroyed(this);-
845 }
never executed: end of block
else {
dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); }
-
846-
847-
848 QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed().");
dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); }
-
849 qt_noop();
dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); }
-
850 }
dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); }
-
851 }-
852-
853 if (d->declarativeData
d->declarativeDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
854 if (static_cast<
static_cast<QA...)->ownedByQml1Description
TRUEnever evaluated
FALSEnever evaluated
QAbstractDeclarativeDataImpl*>(d->declarativeData)->ownedByQml1
static_cast<QA...)->ownedByQml1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
855 if (QAbstractDeclarativeData::destroyed_qml1
QAbstractDecla...destroyed_qml1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
856 QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
never executed: QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
0
857 }
never executed: end of block
else {
0
858 if (QAbstractDeclarativeData::destroyed
QAbstractDecla...ata::destroyedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
859 QAbstractDeclarativeData::destroyed(d->declarativeData, this);
never executed: QAbstractDeclarativeData::destroyed(d->declarativeData, this);
0
860 }
never executed: end of block
0
861 d->declarativeData = 0;-
862 }
never executed: end of block
0
863-
864 d->blockSig = blocked;-
865 if (!d->children.isEmpty()
!d->children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
866 d->deleteChildren();
never executed: d->deleteChildren();
0
867-
868 QApplication::removePostedEvents(this);-
869-
870 if (true) {-
871 destroy();-
872 }
never executed: end of block
else {
dead code: { }
-
873-
874 }
dead code: { }
-
875 --QWidgetPrivate::instanceCounter;-
876-
877 if (QWidgetPrivate::allWidgets
QWidgetPrivate::allWidgetsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
878 QWidgetPrivate::allWidgets->remove(this);
never executed: QWidgetPrivate::allWidgets->remove(this);
0
879-
880 if (true) {-
881 QEvent e(QEvent::Destroy);-
882 QCoreApplication::sendEvent(this, &e);-
883 }
never executed: end of block
else {
dead code: { }
-
884-
885 }
dead code: { }
-
886}-
887-
888int QWidgetPrivate::instanceCounter = 0;-
889int QWidgetPrivate::maxInstances = 0;-
890-
891void QWidgetPrivate::setWinId(WId id)-
892{-
893 QWidget * const q = q_func();-
894-
895-
896-
897-
898-
899 bool userDesktopWidget = qt_desktopWidget != 0
qt_desktopWidget != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& qt_desktopWidget != q
qt_desktopWidget != qDescription
TRUEnever evaluated
FALSEnever evaluated
&& q->windowType() == Qt::Desktop
q->windowType() == Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
900 if (mapper
mapperDescription
TRUEnever evaluated
FALSEnever evaluated
&& data.winid
data.winidDescription
TRUEnever evaluated
FALSEnever evaluated
&& !userDesktopWidget
!userDesktopWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
901 mapper->remove(data.winid);-
902 }
never executed: end of block
0
903-
904 const WId oldWinId = data.winid;-
905-
906 data.winid = id;-
907-
908-
909-
910 if (mapper
mapperDescription
TRUEnever evaluated
FALSEnever evaluated
&& id
idDescription
TRUEnever evaluated
FALSEnever evaluated
&& !userDesktopWidget
!userDesktopWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
911 mapper->insert(data.winid, q);-
912 }
never executed: end of block
0
913-
914 if(oldWinId != id
oldWinId != idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
915 QEvent e(QEvent::WinIdChange);-
916 QCoreApplication::sendEvent(q, &e);-
917 }
never executed: end of block
0
918}
never executed: end of block
0
919-
920void QWidgetPrivate::createTLExtra()-
921{-
922 if (!extra
!extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
923 createExtra();
never executed: createExtra();
0
924 if (!extra->topextra
!extra->topextraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
925 QTLWExtra* x = extra->topextra = new QTLWExtra;-
926 x->icon = 0;-
927 x->backingStore = 0;-
928 x->sharedPainter = 0;-
929 x->incw = x->inch = 0;-
930 x->basew = x->baseh = 0;-
931 x->frameStrut.setCoords(0, 0, 0, 0);-
932 x->normalGeometry = QRect(0,0,-1,-1);-
933 x->savedFlags = 0;-
934 x->opacity = 255;-
935 x->posIncludesFrame = 0;-
936 x->sizeAdjusted = false;-
937 x->inTopLevelResize = false;-
938 x->inRepaint = false;-
939 x->embedded = 0;-
940 x->window = 0;-
941 x->shareContext = 0;-
942 x->initialScreenIndex = -1;-
943-
944-
945-
946-
947-
948-
949-
950 }
never executed: end of block
0
951}
never executed: end of block
0
952-
953-
954-
955-
956-
957-
958void QWidgetPrivate::createExtra()-
959{-
960 if (!extra
!extraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
961 extra = new QWExtra;-
962 extra->glContext = 0;-
963 extra->topextra = 0;-
964-
965 extra->proxyWidget = 0;-
966-
967-
968 extra->curs = 0;-
969-
970 extra->minw = 0;-
971 extra->minh = 0;-
972 extra->maxw = ((1<<24)-1);-
973 extra->maxh = ((1<<24)-1);-
974 extra->customDpiX = 0;-
975 extra->customDpiY = 0;-
976 extra->explicitMinSize = 0;-
977 extra->explicitMaxSize = 0;-
978 extra->autoFillBackground = 0;-
979 extra->nativeChildrenForced = 0;-
980 extra->inRenderWithPainter = 0;-
981 extra->hasWindowContainer = false;-
982 extra->hasMask = 0;-
983 createSysExtra();-
984-
985-
986-
987-
988 }
never executed: end of block
0
989}
never executed: end of block
0
990-
991void QWidgetPrivate::createSysExtra()-
992{-
993}-
994-
995-
996-
997-
998-
999-
1000void QWidgetPrivate::deleteExtra()-
1001{-
1002 if (extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1003-
1004 delete extra->curs;-
1005-
1006 deleteSysExtra();-
1007-
1008-
1009 if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style)
QStyleSheetSty...(extra->style)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1010 proxy->deref();
never executed: proxy->deref();
0
1011-
1012 if (extra->topextra
extra->topextraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1013 deleteTLSysExtra();-
1014-
1015 delete extra->topextra->icon;-
1016 delete extra->topextra;-
1017 }
never executed: end of block
0
1018 delete extra;-
1019-
1020 extra = 0;-
1021 }
never executed: end of block
0
1022}
never executed: end of block
0
1023-
1024void QWidgetPrivate::deleteSysExtra()-
1025{-
1026}-
1027-
1028static void deleteBackingStore(QWidgetPrivate *d)-
1029{-
1030 QTLWExtra *topData = d->topData();-
1031-
1032-
1033-
1034-
1035-
1036 QScopedPointer<QOffscreenSurface> tempSurface;-
1037-
1038 if (d->textureChildSeen
d->textureChildSeenDescription
TRUEnever evaluated
FALSEnever evaluated
&& topData->shareContext
topData->shareContextDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1039 if (topData->window->handle()
topData->window->handle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1040 topData->shareContext->makeCurrent(topData->window);-
1041 }
never executed: end of block
else {
0
1042 tempSurface.reset(new QOffscreenSurface);-
1043 tempSurface->setFormat(topData->shareContext->format());-
1044 tempSurface->create();-
1045 topData->shareContext->makeCurrent(tempSurface.data());-
1046 }
never executed: end of block
0
1047 }-
1048-
1049-
1050 delete topData->backingStore;-
1051 topData->backingStore = 0;-
1052-
1053-
1054 if (d->textureChildSeen
d->textureChildSeenDescription
TRUEnever evaluated
FALSEnever evaluated
&& topData->shareContext
topData->shareContextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1055 topData->shareContext->doneCurrent();
never executed: topData->shareContext->doneCurrent();
0
1056-
1057}
never executed: end of block
0
1058-
1059void QWidgetPrivate::deleteTLSysExtra()-
1060{-
1061 if (extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& extra->topextra
extra->topextraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1062-
1063-
1064-
1065-
1066 extra->topextra->backingStoreTracker.destroy();-
1067 deleteBackingStore(this);-
1068-
1069 qDeleteAll(extra->topextra->widgetTextures);-
1070 extra->topextra->widgetTextures.clear();-
1071 delete extra->topextra->shareContext;-
1072 extra->topextra->shareContext = 0;-
1073-
1074-
1075-
1076-
1077-
1078-
1079 if (extra->topextra->window
extra->topextra->windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1080 extra->topextra->window->destroy();-
1081 }
never executed: end of block
0
1082 delete extra->topextra->window;-
1083 extra->topextra->window = 0;-
1084-
1085 }
never executed: end of block
0
1086}
never executed: end of block
0
1087-
1088-
1089-
1090-
1091-
1092-
1093bool QWidgetPrivate::isOverlapped(const QRect &rect) const-
1094{-
1095 const QWidget * const q = q_func();-
1096-
1097 const QWidget *w = q;-
1098 QRect r = rect;-
1099 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1100 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1101 return
never executed: return false;
false;
never executed: return false;
0
1102 QWidgetPrivate *pd = w->parentWidget()->d_func();-
1103 bool above = false;-
1104 for (int i = 0; i < pd->children.size()
i < pd->children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1105 QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i));-
1106 if (!sibling
!siblingDescription
TRUEnever evaluated
FALSEnever evaluated
|| !sibling->isVisible()
!sibling->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| sibling->isWindow()
sibling->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1107 continue;
never executed: continue;
0
1108 if (!above
!aboveDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1109 above = (sibling == w);-
1110 continue;
never executed: continue;
0
1111 }-
1112-
1113 if (qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r)
qRectIntersect...ta->crect), r)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1114 const QWExtra *siblingExtra = sibling->d_func()->extra;-
1115 if (siblingExtra
siblingExtraDescription
TRUEnever evaluated
FALSEnever evaluated
&& siblingExtra->hasMask
siblingExtra->hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
&& !sibling->d_func()->graphicsEffect
!sibling->d_fu...graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
0
1116 && !siblingExtra->mask.translated(sibling->data->crect.topLeft()).intersects(r)
!siblingExtra-....intersects(r)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1117 continue;
never executed: continue;
0
1118 }-
1119 return
never executed: return true;
true;
never executed: return true;
0
1120 }-
1121 }
never executed: end of block
0
1122 w = w->parentWidget();-
1123 r.translate(pd->data.crect.topLeft());-
1124 }
never executed: end of block
0
1125 return
never executed: return false;
false;
never executed: return false;
0
1126}-
1127-
1128void QWidgetPrivate::syncBackingStore()-
1129{-
1130 if (paintOnScreen()
paintOnScreen()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1131 repaint_sys(dirty);-
1132 dirty = QRegion();-
1133 }
never executed: end of block
else if (QWidgetBackingStore *bs = maybeBackingStore()
QWidgetBacking...BackingStore()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1134 bs->sync();-
1135 }
never executed: end of block
0
1136}
never executed: end of block
0
1137-
1138void QWidgetPrivate::syncBackingStore(const QRegion &region)-
1139{-
1140 if (paintOnScreen()
paintOnScreen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1141 repaint_sys(region);
never executed: repaint_sys(region);
0
1142 else if (QWidgetBackingStore *bs = maybeBackingStore()
QWidgetBacking...BackingStore()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1143 bs->sync(q_func(), region);-
1144 }
never executed: end of block
0
1145}
never executed: end of block
0
1146-
1147void QWidgetPrivate::setUpdatesEnabled_helper(bool enable)-
1148{-
1149 QWidget * const q = q_func();-
1150-
1151 if (enable
enableDescription
TRUEnever evaluated
FALSEnever evaluated
&& !q->isWindow()
!q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& q->parentWidget()
q->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->parentWidget()->updatesEnabled()
!q->parentWidg...datesEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1152 return;
never executed: return;
0
1153-
1154 if (enable != q->testAttribute(Qt::WA_UpdatesDisabled)
enable != q->t...datesDisabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1155 return;
never executed: return;
0
1156-
1157 q->setAttribute(Qt::WA_UpdatesDisabled, !enable);-
1158 if (enable
enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1159 q->update();
never executed: q->update();
0
1160-
1161 Qt::WidgetAttribute attribute = enable
enableDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::WA_ForceUpdatesDisabled : Qt::WA_UpdatesDisabled;
0
1162 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1163 QWidget *w = qobject_cast<QWidget *>(children.at(i));-
1164 if (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
&& !w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !w->testAttribute(attribute)
!w->testAttribute(attribute)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1165 w->d_func()->setUpdatesEnabled_helper(enable);
never executed: w->d_func()->setUpdatesEnabled_helper(enable);
0
1166 }
never executed: end of block
0
1167}
never executed: end of block
0
1168void QWidgetPrivate::propagatePaletteChange()-
1169{-
1170 QWidget * const q = q_func();-
1171-
1172-
1173 if (!q->parentWidget()
!q->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& extra->proxyWidget
extra->proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1174 QGraphicsProxyWidget *p = extra->proxyWidget;-
1175 inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve();-
1176 }
never executed: end of block
else
0
1177-
1178 if (q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->testAttribute(Qt::WA_WindowPropagation)
!q->testAttrib...owPropagation)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1179 inheritedPaletteResolveMask = 0;-
1180 }
never executed: end of block
0
1181 int mask = data.pal.resolve() | inheritedPaletteResolveMask;-
1182-
1183 const bool useStyleSheetPropagationInWidgetStyles =-
1184 QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles);-
1185-
1186 QEvent pc(QEvent::PaletteChange);-
1187 QApplication::sendEvent(q, &pc);-
1188 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1189 QWidget *w = qobject_cast<QWidget*>(children.at(i));-
1190 if (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!w->testAttribute(Qt::WA_StyleSheet)
!w->testAttrib...WA_StyleSheet)Description
TRUEnever evaluated
FALSEnever evaluated
|| useStyleSheetPropagationInWidgetStyles
useStyleSheetP...InWidgetStylesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1191 && (!w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
|| w->testAttribute(Qt::WA_WindowPropagation)
w->testAttribu...owPropagation)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1192 QWidgetPrivate *wd = w->d_func();-
1193 wd->inheritedPaletteResolveMask = mask;-
1194 wd->resolvePalette();-
1195 }
never executed: end of block
0
1196 }
never executed: end of block
0
1197}
never executed: end of block
0
1198-
1199-
1200-
1201-
1202QRect QWidgetPrivate::clipRect() const-
1203{-
1204 const QWidget * const q = q_func();-
1205 const QWidget * w = q;-
1206 if (!w->isVisible()
!w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1207 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1208 QRect r = effectiveRectFor(q->rect());-
1209 int ox = 0;-
1210 int oy = 0;-
1211 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
0
1212 && w->isVisible()
w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
0
1213 && !w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
1214 && w->parentWidget()
w->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1215 ox -= w->x();-
1216 oy -= w->y();-
1217 w = w->parentWidget();-
1218 r &= QRect(ox, oy, w->width(), w->height());-
1219 }
never executed: end of block
0
1220 return
never executed: return r;
r;
never executed: return r;
0
1221}-
1222-
1223-
1224-
1225-
1226QRegion QWidgetPrivate::clipRegion() const-
1227{-
1228 const QWidget * const q = q_func();-
1229 if (!q->isVisible()
!q->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1230 return
never executed: return QRegion();
QRegion();
never executed: return QRegion();
0
1231 QRegion r(q->rect());-
1232 const QWidget * w = q;-
1233 const QWidget *ignoreUpTo;-
1234 int ox = 0;-
1235 int oy = 0;-
1236 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
0
1237 && w->isVisible()
w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
0
1238 && !w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
1239 && w->parentWidget()
w->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1240 ox -= w->x();-
1241 oy -= w->y();-
1242 ignoreUpTo = w;-
1243 w = w->parentWidget();-
1244 r &= QRegion(ox, oy, w->width(), w->height());-
1245-
1246 int i = 0;-
1247 while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo)
w->d_func()->c...*>(ignoreUpTo)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1248 ;
never executed: ;
0
1249 for ( ; i < w->d_func()->children.size()
i < w->d_func(...hildren.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1250 if(QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))
QWidget *sibli...hildren.at(i))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1251 if(sibling->isVisible()
sibling->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& !sibling->isWindow()
!sibling->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1252 QRect siblingRect(ox+sibling->x(), oy+sibling->y(),-
1253 sibling->width(), sibling->height());-
1254 if (qRectIntersects(siblingRect, q->rect())
qRectIntersect...ct, q->rect())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1255 r -= QRegion(siblingRect);
never executed: r -= QRegion(siblingRect);
0
1256 }
never executed: end of block
0
1257 }
never executed: end of block
0
1258 }
never executed: end of block
0
1259 }
never executed: end of block
0
1260 return
never executed: return r;
r;
never executed: return r;
0
1261}-
1262-
1263void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion &region)-
1264{-
1265-
1266 QPaintEngine *paintEngine = paintDevice->paintEngine();-
1267 QTransform scaleTransform;-
1268 const qreal devicePixelRatio = paintDevice->devicePixelRatioF();-
1269 scaleTransform.scale(devicePixelRatio, devicePixelRatio);-
1270 paintEngine->d_func()->systemClip = scaleTransform.map(region);-
1271}
never executed: end of block
0
1272-
1273-
1274void QWidgetPrivate::invalidateGraphicsEffectsRecursively()-
1275{-
1276 QWidget * const q = q_func();-
1277 QWidget *w = q;-
1278 do {-
1279 if (w->graphicsEffect()
w->graphicsEffect()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1280 QWidgetEffectSourcePrivate *sourced =-
1281 static_cast<QWidgetEffectSourcePrivate *>(w->graphicsEffect()->source()->d_func());-
1282 if (!sourced->updateDueToGraphicsEffect
!sourced->upda...GraphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1283 w->graphicsEffect()->source()->d_func()->invalidateCache();
never executed: w->graphicsEffect()->source()->d_func()->invalidateCache();
0
1284 }
never executed: end of block
0
1285 w = w->parentWidget();-
1286 }
never executed: end of block
while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1287}
never executed: end of block
0
1288-
1289-
1290void QWidgetPrivate::setDirtyOpaqueRegion()-
1291{-
1292 QWidget * const q = q_func();-
1293-
1294 dirtyOpaqueChildren = true;-
1295-
1296-
1297 invalidateGraphicsEffectsRecursively();-
1298-
1299-
1300 if (q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1301 return;
never executed: return;
0
1302-
1303 QWidget *parent = q->parentWidget();-
1304 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1305 return;
never executed: return;
0
1306-
1307-
1308 QWidgetPrivate *pd = parent->d_func();-
1309 if (!pd->dirtyOpaqueChildren
!pd->dirtyOpaqueChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1310 pd->setDirtyOpaqueRegion();
never executed: pd->setDirtyOpaqueRegion();
0
1311}
never executed: end of block
0
1312-
1313const QRegion &QWidgetPrivate::getOpaqueChildren() const-
1314{-
1315 if (!dirtyOpaqueChildren
!dirtyOpaqueChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1316 return
never executed: return opaqueChildren;
opaqueChildren;
never executed: return opaqueChildren;
0
1317-
1318 QWidgetPrivate *that = const_cast<QWidgetPrivate*>(this);-
1319 that->opaqueChildren = QRegion();-
1320-
1321 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1322 QWidget *child = qobject_cast<QWidget *>(children.at(i));-
1323 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->isVisible()
!child->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| child->isWindow()
child->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1324 continue;
never executed: continue;
0
1325-
1326 const QPoint offset = child->geometry().topLeft();-
1327 QWidgetPrivate *childd = child->d_func();-
1328 QRegion r = childd->isOpaque
childd->isOpaqueDescription
TRUEnever evaluated
FALSEnever evaluated
? child->rect() : childd->getOpaqueChildren();
0
1329 if (childd->extra
childd->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& childd->extra->hasMask
childd->extra->hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1330 r &= childd->extra->mask;
never executed: r &= childd->extra->mask;
0
1331 if (r.isEmpty()
r.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1332 continue;
never executed: continue;
0
1333 r.translate(offset);-
1334 that->opaqueChildren += r;-
1335 }
never executed: end of block
0
1336-
1337 that->opaqueChildren &= q_func()->rect();-
1338 that->dirtyOpaqueChildren = false;-
1339-
1340 return
never executed: return that->opaqueChildren;
that->opaqueChildren;
never executed: return that->opaqueChildren;
0
1341}-
1342-
1343void QWidgetPrivate::subtractOpaqueChildren(QRegion &source, const QRect &clipRect) const-
1344{-
1345 if (children.isEmpty()
children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
|| clipRect.isEmpty()
clipRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1346 return;
never executed: return;
0
1347-
1348 const QRegion &r = getOpaqueChildren();-
1349 if (!r.isEmpty()
!r.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1350 source -= (r & clipRect);
never executed: source -= (r & clipRect);
0
1351}
never executed: end of block
0
1352-
1353-
1354void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirtySiblingsAbove,-
1355 bool alsoNonOpaque) const-
1356{-
1357 const QWidget * const q = q_func();-
1358 static int disableSubtractOpaqueSiblings = qEnvironmentVariableIntValue("QT_NO_SUBTRACTOPAQUESIBLINGS");-
1359 if (disableSubtractOpaqueSiblings
disableSubtractOpaqueSiblingsDescription
TRUEnever evaluated
FALSEnever evaluated
|| q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1360 return;
never executed: return;
0
1361-
1362-
1363-
1364-
1365-
1366-
1367 QRect clipBoundingRect;-
1368 bool dirtyClipBoundingRect = true;-
1369-
1370 QRegion parentClip;-
1371 bool dirtyParentClip = true;-
1372-
1373 QPoint parentOffset = data.crect.topLeft();-
1374-
1375 const QWidget *w = q;-
1376-
1377 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1378 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1379 break;
never executed: break;
0
1380 QWidgetPrivate *pd = w->parentWidget()->d_func();-
1381 const int myIndex = pd->children.indexOf(const_cast<QWidget *>(w));-
1382 const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->data->crect);-
1383 for (int i = myIndex + 1; i < pd->children.size()
i < pd->children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1384 QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i));-
1385 if (!sibling
!siblingDescription
TRUEnever evaluated
FALSEnever evaluated
|| !sibling->isVisible()
!sibling->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| sibling->isWindow()
sibling->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1386 continue;
never executed: continue;
0
1387-
1388 const QRect siblingGeometry = sibling->d_func()->effectiveRectFor(sibling->data->crect);-
1389 if (!qRectIntersects(siblingGeometry, widgetGeometry)
!qRectIntersec...idgetGeometry)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1390 continue;
never executed: continue;
0
1391-
1392 if (dirtyClipBoundingRect
dirtyClipBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1393 clipBoundingRect = sourceRegion.boundingRect();-
1394 dirtyClipBoundingRect = false;-
1395 }
never executed: end of block
0
1396-
1397 if (!qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset))
!qRectIntersec...parentOffset))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1398 continue;
never executed: continue;
0
1399-
1400 if (dirtyParentClip
dirtyParentClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1401 parentClip = sourceRegion.translated(parentOffset);-
1402 dirtyParentClip = false;-
1403 }
never executed: end of block
0
1404-
1405 const QPoint siblingPos(sibling->data->crect.topLeft());-
1406 const QRect siblingClipRect(sibling->d_func()->clipRect());-
1407 QRegion siblingDirty(parentClip);-
1408 siblingDirty &= (siblingClipRect.translated(siblingPos));-
1409 const bool hasMask = sibling->d_func()->extra
sibling->d_func()->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& sibling->d_func()->extra->hasMask
sibling->d_fun...extra->hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
0
1410 && !sibling->d_func()->graphicsEffect
!sibling->d_fu...graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1411 if (hasMask
hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1412 siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos);
never executed: siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos);
0
1413 if (siblingDirty.isEmpty()
siblingDirty.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1414 continue;
never executed: continue;
0
1415-
1416 if (sibling->d_func()->isOpaque
sibling->d_func()->isOpaqueDescription
TRUEnever evaluated
FALSEnever evaluated
|| alsoNonOpaque
alsoNonOpaqueDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1417 if (hasMask
hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1418 siblingDirty.translate(-parentOffset);-
1419 sourceRegion -= siblingDirty;-
1420 }
never executed: end of block
else {
0
1421 sourceRegion -= siblingGeometry.translated(-parentOffset);-
1422 }
never executed: end of block
0
1423 } else {-
1424 if (hasDirtySiblingsAbove
hasDirtySiblingsAboveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1425 *
never executed: *hasDirtySiblingsAbove = true;
hasDirtySiblingsAbove = true;
never executed: *hasDirtySiblingsAbove = true;
0
1426 if (sibling->d_func()->children.isEmpty()
sibling->d_fun...dren.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1427 continue;
never executed: continue;
0
1428 QRegion opaqueSiblingChildren(sibling->d_func()->getOpaqueChildren());-
1429 opaqueSiblingChildren.translate(-parentOffset + siblingPos);-
1430 sourceRegion -= opaqueSiblingChildren;-
1431 }
never executed: end of block
0
1432 if (sourceRegion.isEmpty()
sourceRegion.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1433 return;
never executed: return;
0
1434-
1435 dirtyClipBoundingRect = true;-
1436 dirtyParentClip = true;-
1437 }
never executed: end of block
0
1438-
1439 w = w->parentWidget();-
1440 parentOffset += pd->data.crect.topLeft();-
1441 dirtyParentClip = true;-
1442 }
never executed: end of block
0
1443}
never executed: end of block
0
1444-
1445void QWidgetPrivate::clipToEffectiveMask(QRegion &region) const-
1446{-
1447 const QWidget * const q = q_func();-
1448-
1449 const QWidget *w = q;-
1450 QPoint offset;-
1451-
1452-
1453 if (graphicsEffect
graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1454 w = q->parentWidget();-
1455 offset -= data.crect.topLeft();-
1456 }
never executed: end of block
0
1457-
1458-
1459 while (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1460 const QWidgetPrivate *wd = w->d_func();-
1461 if (wd->extra
wd->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& wd->extra->hasMask
wd->extra->hasMaskDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1462 region &= (
(w != q)Description
TRUEnever evaluated
FALSEnever evaluated
w != q)
(w != q)Description
TRUEnever evaluated
FALSEnever evaluated
? wd->extra->mask.translated(offset) : wd->extra->mask;
never executed: region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask;
0
1463 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1464 return;
never executed: return;
0
1465 offset -= wd->data.crect.topLeft();-
1466 w = w->parentWidget();-
1467 }
never executed: end of block
0
1468}
never executed: end of block
0
1469-
1470bool QWidgetPrivate::paintOnScreen() const-
1471{-
1472-
1473-
1474-
1475 const QWidget * const q = q_func();-
1476 if (q->testAttribute(Qt::WA_PaintOnScreen)
q->testAttribu...PaintOnScreen)Description
TRUEnever evaluated
FALSEnever evaluated
0
1477 || (!q->isWindow()
!q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& q->window()->testAttribute(Qt::WA_PaintOnScreen)
q->window()->t...PaintOnScreen)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1478 return
never executed: return true;
true;
never executed: return true;
0
1479 }-
1480-
1481 return
never executed: return !qt_enable_backingstore;
!qt_enable_backingstore;
never executed: return !qt_enable_backingstore;
0
1482-
1483}-
1484-
1485void QWidgetPrivate::updateIsOpaque()-
1486{-
1487-
1488 setDirtyOpaqueRegion();-
1489-
1490-
1491 if (graphicsEffect
graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1492-
1493 setOpaque(false);-
1494 return;
never executed: return;
0
1495 }-
1496-
1497-
1498 QWidget * const q = q_func();-
1499-
1500-
1501-
1502-
1503-
1504-
1505-
1506 if (q->testAttribute(Qt::WA_OpaquePaintEvent)
q->testAttribu...quePaintEvent)Description
TRUEnever evaluated
FALSEnever evaluated
|| q->testAttribute(Qt::WA_PaintOnScreen)
q->testAttribu...PaintOnScreen)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1507 setOpaque(true);-
1508 return;
never executed: return;
0
1509 }-
1510-
1511 const QPalette &pal = q->palette();-
1512-
1513 if (q->autoFillBackground()
q->autoFillBackground()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1514 const QBrush &autoFillBrush = pal.brush(q->backgroundRole());-
1515 if (autoFillBrush.style() != Qt::NoBrush
autoFillBrush....!= Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
&& autoFillBrush.isOpaque()
autoFillBrush.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1516 setOpaque(true);-
1517 return;
never executed: return;
0
1518 }-
1519 }
never executed: end of block
0
1520-
1521 if (q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->testAttribute(Qt::WA_NoSystemBackground)
!q->testAttrib...temBackground)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1522 const QBrush &windowBrush = q->palette().brush(QPalette::Window);-
1523 if (windowBrush.style() != Qt::NoBrush
windowBrush.st...!= Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
&& windowBrush.isOpaque()
windowBrush.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1524 setOpaque(true);-
1525 return;
never executed: return;
0
1526 }-
1527 }
never executed: end of block
0
1528 setOpaque(false);-
1529}
never executed: end of block
0
1530-
1531void QWidgetPrivate::setOpaque(bool opaque)-
1532{-
1533 if (isOpaque != opaque
isOpaque != opaqueDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1534 isOpaque = opaque;-
1535 updateIsTranslucent();-
1536 }
never executed: end of block
0
1537}
never executed: end of block
0
1538-
1539void QWidgetPrivate::updateIsTranslucent()-
1540{-
1541 QWidget * const q = q_func();-
1542 if (QWindow *window = q->windowHandle()
QWindow *windo...windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1543 QSurfaceFormat format = window->format();-
1544 const int oldAlpha = format.alphaBufferSize();-
1545 const int newAlpha = q->testAttribute(Qt::WA_TranslucentBackground)
q->testAttribu...entBackground)Description
TRUEnever evaluated
FALSEnever evaluated
? 8 : 0;
0
1546 if (oldAlpha != newAlpha
oldAlpha != newAlphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1547 format.setAlphaBufferSize(newAlpha);-
1548 window->setFormat(format);-
1549 }
never executed: end of block
0
1550 }
never executed: end of block
0
1551}
never executed: end of block
0
1552-
1553static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush)-
1554{-
1555 ((!(painter)) ? qt_assert("painter",__FILE__,2395) : qt_noop());-
1556-
1557 if (brush.style() == Qt::TexturePattern
brush.style() ...TexturePatternDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1558-
1559-
1560-
1561-
1562-
1563-
1564-
1565 {-
1566 const QRect rect(rgn.boundingRect());-
1567 painter->setClipRegion(rgn);-
1568 painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());-
1569 }-
1570-
1571-
1572 }
never executed: end of block
else if (brush.gradient()
brush.gradient()Description
TRUEnever evaluated
FALSEnever evaluated
0
1573 && brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode
brush.gradient...ctBoundingModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1574 painter->save();-
1575 painter->setClipRegion(rgn);-
1576 painter->fillRect(0, 0, painter->device()->width(), painter->device()->height(), brush);-
1577 painter->restore();-
1578 }
never executed: end of block
else {
0
1579 const QVector<QRect> &rects = rgn.rects();-
1580 for (int i = 0; i < rects.size()
i < rects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1581 painter->fillRect(rects.at(i), brush);
never executed: painter->fillRect(rects.at(i), brush);
0
1582 }
never executed: end of block
0
1583}-
1584-
1585void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int flags) const-
1586{-
1587 const QWidget * const q = q_func();-
1588-
1589-
1590 bool resetBrushOrigin = false;-
1591 QPointF oldBrushOrigin;-
1592-
1593 QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent);-
1594 if (scrollArea
scrollAreaDescription
TRUEnever evaluated
FALSEnever evaluated
&& scrollArea->viewport() == q
scrollArea->viewport() == qDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1595 QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr.data();-
1596 QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate);-
1597 oldBrushOrigin = painter->brushOrigin();-
1598 resetBrushOrigin = true;-
1599 painter->setBrushOrigin(-priv->contentsOffset());-
1600-
1601 }
never executed: end of block
0
1602-
1603-
1604 const QBrush autoFillBrush = q->palette().brush(q->backgroundRole());-
1605-
1606 if ((
(flags & DrawAsRoot)Description
TRUEnever evaluated
FALSEnever evaluated
flags & DrawAsRoot)
(flags & DrawAsRoot)Description
TRUEnever evaluated
FALSEnever evaluated
&& !(q->autoFillBackground()
q->autoFillBackground()Description
TRUEnever evaluated
FALSEnever evaluated
&& autoFillBrush.isOpaque()
autoFillBrush.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1607 const QBrush bg = q->palette().brush(QPalette::Window);-
1608 if (!(flags & DontSetCompositionMode)
!(flags & Dont...mpositionMode)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1609-
1610 QPainter::CompositionMode oldMode = painter->compositionMode();-
1611 painter->setCompositionMode(QPainter::CompositionMode_Source);-
1612 fillRegion(painter, rgn, bg);-
1613 painter->setCompositionMode(oldMode);-
1614 }
never executed: end of block
else {
0
1615 fillRegion(painter, rgn, bg);-
1616 }
never executed: end of block
0
1617 }-
1618-
1619 if (q->autoFillBackground()
q->autoFillBackground()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1620 fillRegion(painter, rgn, autoFillBrush);
never executed: fillRegion(painter, rgn, autoFillBrush);
0
1621-
1622 if (q->testAttribute(Qt::WA_StyledBackground)
q->testAttribu...ledBackground)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1623 painter->setClipRegion(rgn);-
1624 QStyleOption opt;-
1625 opt.initFrom(q);-
1626 q->style()->drawPrimitive(QStyle::PE_Widget, &opt, painter, q);-
1627 }
never executed: end of block
0
1628-
1629-
1630 if (resetBrushOrigin
resetBrushOriginDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1631 painter->setBrushOrigin(oldBrushOrigin);
never executed: painter->setBrushOrigin(oldBrushOrigin);
0
1632-
1633}
never executed: end of block
0
1634 extern QWidget *qt_button_down;-
1635-
1636-
1637void QWidgetPrivate::deactivateWidgetCleanup()-
1638{-
1639 QWidget * const q = q_func();-
1640-
1641 if (QApplication::activeWindow() == q
QApplication::...eWindow() == qDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1642 QApplication::setActiveWindow(0);
never executed: QApplication::setActiveWindow(0);
0
1643-
1644 if (q == qt_button_down
q == qt_button_downDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1645 qt_button_down = 0;
never executed: qt_button_down = 0;
0
1646}
never executed: end of block
0
1647QWidget *QWidget::find(WId id)-
1648{-
1649 return
never executed: return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0;
QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0;
never executed: return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0;
0
1650}-
1651WId QWidget::winId() const-
1652{-
1653 if (!testAttribute(Qt::WA_WState_Created)
!testAttribute...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
|| !internalWinId()
!internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1654-
1655-
1656-
1657 QWidget *that = const_cast<QWidget*>(this);-
1658 that->setAttribute(Qt::WA_NativeWindow);-
1659 that->d_func()->createWinId();-
1660 return
never executed: return that->data->winid;
that->data->winid;
never executed: return that->data->winid;
0
1661 }-
1662 return
never executed: return data->winid;
data->winid;
never executed: return data->winid;
0
1663}-
1664-
1665void QWidgetPrivate::createWinId()-
1666{-
1667 QWidget * const q = q_func();-
1668-
1669-
1670-
1671-
1672 const bool forceNativeWindow = q->testAttribute(Qt::WA_NativeWindow);-
1673 if (!q->testAttribute(Qt::WA_WState_Created)
!q->testAttrib...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
|| (forceNativeWindow
forceNativeWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& !q->internalWinId()
!q->internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1674 if (!q->isWindow()
!q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1675 QWidget *parent = q->parentWidget();-
1676 QWidgetPrivate *pd = parent->d_func();-
1677 if (forceNativeWindow
forceNativeWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& !q->testAttribute(Qt::WA_DontCreateNativeAncestors)
!q->testAttrib...tiveAncestors)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1678 parent->setAttribute(Qt::WA_NativeWindow);
never executed: parent->setAttribute(Qt::WA_NativeWindow);
0
1679 if (!parent->internalWinId()
!parent->internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1680 pd->createWinId();-
1681 }
never executed: end of block
0
1682-
1683 for (int i = 0; i < pd->children.size()
i < pd->children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1684 QWidget *w = qobject_cast<QWidget *>(pd->children.at(i));-
1685 if (w
wDescription
TRUEnever evaluated
FALSEnever evaluated
&& !w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& (!w->testAttribute(Qt::WA_WState_Created)
!w->testAttrib...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
0
1686 || (!w->internalWinId()
!w->internalWinId()Description
TRUEnever evaluated
FALSEnever evaluated
&& w->testAttribute(Qt::WA_NativeWindow)
w->testAttribu..._NativeWindow)Description
TRUEnever evaluated
FALSEnever evaluated
))) {
0
1687 w->create();-
1688 }
never executed: end of block
0
1689 }
never executed: end of block
0
1690 }
never executed: end of block
else {
0
1691 q->create();-
1692 }
never executed: end of block
0
1693 }-
1694}
never executed: end of block
0
1695void QWidget::createWinId()-
1696{-
1697 QWidgetPrivate * const d = d_func();-
1698-
1699-
1700-
1701-
1702 d->createWinId();-
1703}
never executed: end of block
0
1704WId QWidget::effectiveWinId() const-
1705{-
1706 const WId id = internalWinId();-
1707 if (id
idDescription
TRUEnever evaluated
FALSEnever evaluated
|| !testAttribute(Qt::WA_WState_Created)
!testAttribute...State_Created)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1708 return
never executed: return id;
id;
never executed: return id;
0
1709 if (const
const QWidget ...ParentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
QWidget *realParent = nativeParentWidget()
const QWidget ...ParentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1710 return
never executed: return realParent->internalWinId();
realParent->internalWinId();
never executed: return realParent->internalWinId();
0
1711 return
never executed: return 0;
0;
never executed: return 0;
0
1712}-
1713QWindow *QWidget::windowHandle() const-
1714{-
1715 const QWidgetPrivate * const d = d_func();-
1716 QTLWExtra *extra = d->maybeTopData();-
1717 if (extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1718 return
never executed: return extra->window;
extra->window;
never executed: return extra->window;
0
1719-
1720 return
never executed: return 0;
0;
never executed: return 0;
0
1721}-
1722QString QWidget::styleSheet() const-
1723{-
1724 const QWidgetPrivate * const d = d_func();-
1725 if (!d->extra
!d->extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1726 return
never executed: return QString();
QString();
never executed: return QString();
0
1727 return
never executed: return d->extra->styleSheet;
d->extra->styleSheet;
never executed: return d->extra->styleSheet;
0
1728}-
1729-
1730void QWidget::setStyleSheet(const QString& styleSheet)-
1731{-
1732 QWidgetPrivate * const d = d_func();-
1733 if (data->in_destructor
data->in_destructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1734 return;
never executed: return;
0
1735 d->createExtra();-
1736-
1737 QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(d->extra->style);-
1738 d->extra->styleSheet = styleSheet;-
1739 if (styleSheet.isEmpty()
styleSheet.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1740 if (!proxy
!proxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1741 return;
never executed: return;
0
1742-
1743 d->inheritStyle();-
1744 return;
never executed: return;
0
1745 }-
1746-
1747 if (proxy
proxyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1748 if (d->polished
d->polishedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1749 proxy->repolish(this);
never executed: proxy->repolish(this);
0
1750 return;
never executed: return;
0
1751 }-
1752-
1753 if (testAttribute(Qt::WA_SetStyle)
testAttribute(Qt::WA_SetStyle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1754 d->setStyle_helper(new QStyleSheetStyle(d->extra->style), true);-
1755 }
never executed: end of block
else {
0
1756 d->setStyle_helper(new QStyleSheetStyle(0), true);-
1757 }
never executed: end of block
0
1758}-
1759-
1760-
1761-
1762-
1763-
1764-
1765-
1766QStyle *QWidget::style() const-
1767{-
1768 const QWidgetPrivate * const d = d_func();-
1769-
1770 if (d->extra
d->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->extra->style
d->extra->styleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1771 return
never executed: return d->extra->style;
d->extra->style;
never executed: return d->extra->style;
0
1772 return
never executed: return QApplication::style();
QApplication::style();
never executed: return QApplication::style();
0
1773}-
1774void QWidget::setStyle(QStyle *style)-
1775{-
1776 QWidgetPrivate * const d = d_func();-
1777 setAttribute(Qt::WA_SetStyle, style != 0);-
1778 d->createExtra();-
1779-
1780 if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style)
QStyleSheetSty...tyle *>(style)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1781-
1782-
1783 proxy->ref();-
1784 d->setStyle_helper(style, false);-
1785 }
never executed: end of block
else if (qobject_cast<QStyleSheetStyle *>(d->extra->style)
qobject_cast<Q...>extra->style)Description
TRUEnever evaluated
FALSEnever evaluated
|| !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()
!(static_cast<...et().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1786-
1787 d->setStyle_helper(new QStyleSheetStyle(style), true);-
1788 }
never executed: end of block
else
0
1789-
1790 d->setStyle_helper(style, false);
never executed: d->setStyle_helper(style, false);
0
1791}-
1792-
1793void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool-
1794-
1795-
1796-
1797 )-
1798{-
1799 QWidget * const q = q_func();-
1800 QStyle *oldStyle = q->style();-
1801-
1802 QPointer<QStyle> origStyle;-
1803 {-
1804 createExtra();-
1805-
1806-
1807 origStyle = extra->style.data();-
1808-
1809 extra->style = newStyle;-
1810 }-
1811-
1812-
1813 if (q->windowType() != Qt::Desktop
q->windowType() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1814 if (polished
polishedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1815 oldStyle->unpolish(q);-
1816-
1817-
1818-
1819-
1820 q->style()->polish(q);-
1821-
1822-
1823-
1824-
1825 }
never executed: end of block
0
1826 }
never executed: end of block
0
1827-
1828 if (propagate
propagateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1829-
1830 const QObjectList childrenList = children;-
1831 for (int i = 0; i < childrenList.size()
i < childrenList.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1832 QWidget *c = qobject_cast<QWidget*>(childrenList.at(i));-
1833 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1834 c->d_func()->inheritStyle();
never executed: c->d_func()->inheritStyle();
0
1835 }
never executed: end of block
0
1836 }
never executed: end of block
0
1837-
1838-
1839 if (!qobject_cast<QStyleSheetStyle*>(newStyle)
!qobject_cast<...le*>(newStyle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1840 if (const
const QStyleSh...gStyle.data())Description
TRUEnever evaluated
FALSEnever evaluated
QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data())
const QStyleSh...gStyle.data())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1841 cssStyle->clearWidgetFont(q);-
1842 }
never executed: end of block
0
1843 }
never executed: end of block
0
1844-
1845-
1846 QEvent e(QEvent::StyleChange);-
1847 QApplication::sendEvent(q, &e);-
1848-
1849-
1850-
1851 if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data())
QStyleSheetSty...gStyle.data())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1852 proxy->deref();
never executed: proxy->deref();
0
1853-
1854}
never executed: end of block
0
1855-
1856-
1857void QWidgetPrivate::inheritStyle()-
1858{-
1859-
1860 QWidget * const q = q_func();-
1861-
1862 QStyleSheetStyle *proxy = extra
extraDescription
TRUEnever evaluated
FALSEnever evaluated
? qobject_cast<QStyleSheetStyle *>(extra->style) : 0;
0
1863-
1864 if (!q->styleSheet().isEmpty()
!q->styleSheet().isEmpty()Description