qgraphicswidget.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicswidget.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12QGraphicsWidget::QGraphicsWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags)-
13 : QGraphicsObject(*new QGraphicsWidgetPrivate, 0), QGraphicsLayoutItem(0, false)-
14{-
15 QGraphicsWidgetPrivate * const d = d_func();-
16 d->init(parent, wFlags);-
17}
never executed: end of block
0
18-
19-
20-
21-
22-
23-
24QGraphicsWidget::QGraphicsWidget(QGraphicsWidgetPrivate &dd, QGraphicsItem *parent, Qt::WindowFlags wFlags)-
25 : QGraphicsObject(dd, 0), QGraphicsLayoutItem(0, false)-
26{-
27 QGraphicsWidgetPrivate * const d = d_func();-
28 d->init(parent, wFlags);-
29}
never executed: end of block
0
30class QGraphicsWidgetStyles-
31{-
32public:-
33 QStyle *styleForWidget(const QGraphicsWidget *widget) const-
34 {-
35 QMutexLocker locker(&mutex);-
36 return
never executed: return styles.value(widget, 0);
styles.value(widget, 0);
never executed: return styles.value(widget, 0);
0
37 }-
38-
39 void setStyleForWidget(QGraphicsWidget *widget, QStyle *style)-
40 {-
41 QMutexLocker locker(&mutex);-
42 if (style
styleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
43 styles[widget] = style;
never executed: styles[widget] = style;
0
44 else-
45 styles.remove(widget);
never executed: styles.remove(widget);
0
46 }-
47-
48private:-
49 QHash<const QGraphicsWidget *, QStyle *> styles;-
50 mutable QMutex mutex;-
51};-
52namespace { namespace Q_QGS_widgetStyles { typedef QGraphicsWidgetStyles Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QGraphicsWidgetStyles, Q_QGS_widgetStyles::innerFunction, Q_QGS_widgetStyles::guard> widgetStyles;
0
53-
54-
55-
56-
57QGraphicsWidget::~QGraphicsWidget()-
58{-
59 QGraphicsWidgetPrivate * const d = d_func();-
60-
61-
62 for (int i = 0; i < d->actions.size()
i < d->actions.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
63 QActionPrivate *apriv = d->actions.at(i)->d_func();-
64 apriv->graphicsWidgets.removeAll(this);-
65 }
never executed: end of block
0
66 d->actions.clear();-
67-
68-
69 if (QGraphicsScene *scn = scene()
QGraphicsScene *scn = scene()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
70 QGraphicsScenePrivate *sceneD = scn->d_func();-
71 if (sceneD->tabFocusFirst == this
sceneD->tabFocusFirst == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
72 sceneD->tabFocusFirst = (d->focusNext == this
d->focusNext == thisDescription
TRUEnever evaluated
FALSEnever evaluated
? 0 : d->focusNext);
never executed: sceneD->tabFocusFirst = (d->focusNext == this ? 0 : d->focusNext);
0
73 }
never executed: end of block
0
74 d->focusPrev->d_func()->focusNext = d->focusNext;-
75 d->focusNext->d_func()->focusPrev = d->focusPrev;-
76-
77-
78 d->focusNext = this;-
79 d->focusPrev = this;-
80-
81 clearFocus();-
82-
83-
84 if (d->layout
d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
85 QGraphicsLayout *temp = d->layout;-
86 const auto items = childItems();-
87 for (QGraphicsItem *item : items) {-
88-
89-
90-
91 if (item->isWidget()
item->isWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
92 QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item);-
93 if (widget->parentLayoutItem() == d->layout
widget->parent...) == d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
94 widget->setParentLayoutItem(0);
never executed: widget->setParentLayoutItem(0);
0
95 }
never executed: end of block
0
96 }
never executed: end of block
0
97 d->layout = 0;-
98 delete temp;-
99 }
never executed: end of block
0
100-
101-
102 widgetStyles()->setStyleForWidget(this, 0);-
103-
104-
105-
106-
107 setParentItem(nullptr);-
108}
never executed: end of block
0
109QSizeF QGraphicsWidget::size() const-
110{-
111 return
never executed: return QGraphicsLayoutItem::geometry().size();
QGraphicsLayoutItem::geometry().size();
never executed: return QGraphicsLayoutItem::geometry().size();
0
112}-
113-
114void QGraphicsWidget::resize(const QSizeF &size)-
115{-
116 setGeometry(QRectF(pos(), size));-
117}
never executed: end of block
0
118void QGraphicsWidget::setGeometry(const QRectF &rect)-
119{-
120 QGraphicsWidgetPrivate *wd = QGraphicsWidget::d_func();-
121 QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr.data();-
122 QRectF newGeom;-
123 QPointF oldPos = d->geom.topLeft();-
124 if (!wd->inSetPos
!wd->inSetPosDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
125 setAttribute(Qt::WA_Resized);-
126 newGeom = rect;-
127 newGeom.setSize(rect.size().expandedTo(effectiveSizeHint(Qt::MinimumSize))-
128 .boundedTo(effectiveSizeHint(Qt::MaximumSize)));-
129-
130 if (newGeom == d->geom
newGeom == d->geomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
131 goto
never executed: goto relayoutChildrenAndReturn;
relayoutChildrenAndReturn;
never executed: goto relayoutChildrenAndReturn;
0
132 }-
133-
134-
135 wd->inSetGeometry = 1;-
136 setPos(newGeom.topLeft());-
137 wd->inSetGeometry = 0;-
138 newGeom.moveTopLeft(pos());-
139-
140 if (newGeom == d->geom
newGeom == d->geomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
141 goto
never executed: goto relayoutChildrenAndReturn;
relayoutChildrenAndReturn;
never executed: goto relayoutChildrenAndReturn;
0
142 }-
143-
144-
145 if (wd->scene
wd->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
146 if (rect.topLeft() == d->geom.topLeft()
rect.topLeft()...geom.topLeft()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
147 prepareGeometryChange();-
148 }
never executed: end of block
0
149 }
never executed: end of block
0
150 }
never executed: end of block
0
151-
152-
153 {-
154 bool moved = oldPos != pos();-
155 if (moved
movedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
156-
157 QGraphicsSceneMoveEvent event;-
158 event.setOldPos(oldPos);-
159 event.setNewPos(pos());-
160 QApplication::sendEvent(this, &event);-
161 if (wd->inSetPos
wd->inSetPosDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
162-
163 d->geom.moveTopLeft(pos());-
164 geometryChanged();-
165 goto
never executed: goto relayoutChildrenAndReturn;
relayoutChildrenAndReturn;
never executed: goto relayoutChildrenAndReturn;
0
166 }-
167 }
never executed: end of block
0
168 QSizeF oldSize = size();-
169 QGraphicsLayoutItem::setGeometry(newGeom);-
170-
171 bool resized = newGeom.size() != oldSize;-
172 if (resized
resizedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
173 QGraphicsSceneResizeEvent re;-
174 re.setOldSize(oldSize);-
175 re.setNewSize(newGeom.size());-
176 if (oldSize.width() != newGeom.size().width()
oldSize.width(...size().width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
177 widthChanged();
never executed: widthChanged();
0
178 if (oldSize.height() != newGeom.size().height()
oldSize.height...ize().height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
179 heightChanged();
never executed: heightChanged();
0
180 QGraphicsLayout *lay = wd->layout;-
181 if (QGraphicsLayout::instantInvalidatePropagation()
QGraphicsLayou...ePropagation()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
182 if (!lay
!layDescription
TRUEnever evaluated
FALSEnever evaluated
|| lay->isActivated()
lay->isActivated()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
183 QApplication::sendEvent(this, &re);-
184 }
never executed: end of block
0
185 }
never executed: end of block
else {
0
186 QApplication::sendEvent(this, &re);-
187 }
never executed: end of block
0
188 }-
189 }-
190-
191 geometryChanged();-
192relayoutChildrenAndReturn:
code before this statement never executed: relayoutChildrenAndReturn:
0
193 if (QGraphicsLayout::instantInvalidatePropagation()
QGraphicsLayou...ePropagation()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
194 if (QGraphicsLayout *lay = wd->layout
QGraphicsLayou...y = wd->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
195 if (!lay->isActivated()
!lay->isActivated()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
196 QEvent layoutRequest(QEvent::LayoutRequest);-
197 QApplication::sendEvent(this, &layoutRequest);-
198 }
never executed: end of block
0
199 }
never executed: end of block
0
200 }
never executed: end of block
0
201}
never executed: end of block
0
202void QGraphicsWidget::setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)-
203{-
204 QGraphicsWidgetPrivate * const d = d_func();-
205-
206 if (!d->margins
!d->marginsDescription
TRUEnever evaluated
FALSEnever evaluated
&& left == 0
left == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& top == 0
top == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& right == 0
right == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& bottom == 0
bottom == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
207 return;
never executed: return;
0
208 d->ensureMargins();-
209 if (left == d->margins[d->Left]
left == d->margins[d->Left]Description
TRUEnever evaluated
FALSEnever evaluated
0
210 && top == d->margins[d->Top]
top == d->margins[d->Top]Description
TRUEnever evaluated
FALSEnever evaluated
0
211 && right == d->margins[d->Right]
right == d->margins[d->Right]Description
TRUEnever evaluated
FALSEnever evaluated
0
212 && bottom == d->margins[d->Bottom]
bottom == d->m...ins[d->Bottom]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
213 return;
never executed: return;
0
214-
215 d->margins[d->Left] = left;-
216 d->margins[d->Top] = top;-
217 d->margins[d->Right] = right;-
218 d->margins[d->Bottom] = bottom;-
219-
220 if (QGraphicsLayout *l = d->layout
QGraphicsLayout *l = d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
221 l->invalidate();
never executed: l->invalidate();
0
222 else-
223 updateGeometry();
never executed: updateGeometry();
0
224-
225 QEvent e(QEvent::ContentsRectChange);-
226 QApplication::sendEvent(this, &e);-
227}
never executed: end of block
0
228void QGraphicsWidget::getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const-
229{-
230 const QGraphicsWidgetPrivate * const d = d_func();-
231 if (left
leftDescription
TRUEnever evaluated
FALSEnever evaluated
|| top
topDescription
TRUEnever evaluated
FALSEnever evaluated
|| right
rightDescription
TRUEnever evaluated
FALSEnever evaluated
|| bottom
bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
232 d->ensureMargins();
never executed: d->ensureMargins();
0
233 if (left
leftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
234 *
never executed: *left = d->margins[d->Left];
left = d->margins[d->Left];
never executed: *left = d->margins[d->Left];
0
235 if (top
topDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
236 *
never executed: *top = d->margins[d->Top];
top = d->margins[d->Top];
never executed: *top = d->margins[d->Top];
0
237 if (right
rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
238 *
never executed: *right = d->margins[d->Right];
right = d->margins[d->Right];
never executed: *right = d->margins[d->Right];
0
239 if (bottom
bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
240 *
never executed: *bottom = d->margins[d->Bottom];
bottom = d->margins[d->Bottom];
never executed: *bottom = d->margins[d->Bottom];
0
241}
never executed: end of block
0
242void QGraphicsWidget::setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom)-
243{-
244 QGraphicsWidgetPrivate * const d = d_func();-
245-
246 if (!d->windowFrameMargins
!d->windowFrameMarginsDescription
TRUEnever evaluated
FALSEnever evaluated
&& left == 0
left == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& top == 0
top == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& right == 0
right == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& bottom == 0
bottom == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
247 return;
never executed: return;
0
248 d->ensureWindowFrameMargins();-
249 bool unchanged =-
250 d->windowFrameMargins[d->Left] == left
d->windowFrame...>Left] == leftDescription
TRUEnever evaluated
FALSEnever evaluated
0
251 && d->windowFrameMargins[d->Top] == top
d->windowFrame...d->Top] == topDescription
TRUEnever evaluated
FALSEnever evaluated
0
252 && d->windowFrameMargins[d->Right] == right
d->windowFrame...ight] == rightDescription
TRUEnever evaluated
FALSEnever evaluated
0
253 && d->windowFrameMargins[d->Bottom] == bottom
d->windowFrame...tom] == bottomDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
254 if (d->setWindowFrameMargins
d->setWindowFrameMarginsDescription
TRUEnever evaluated
FALSEnever evaluated
&& unchanged
unchangedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
255 return;
never executed: return;
0
256 if (!unchanged
!unchangedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
257 prepareGeometryChange();
never executed: prepareGeometryChange();
0
258 d->windowFrameMargins[d->Left] = left;-
259 d->windowFrameMargins[d->Top] = top;-
260 d->windowFrameMargins[d->Right] = right;-
261 d->windowFrameMargins[d->Bottom] = bottom;-
262 d->setWindowFrameMargins = true;-
263}
never executed: end of block
0
264void QGraphicsWidget::getWindowFrameMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const-
265{-
266 const QGraphicsWidgetPrivate * const d = d_func();-
267 if (left
leftDescription
TRUEnever evaluated
FALSEnever evaluated
|| top
topDescription
TRUEnever evaluated
FALSEnever evaluated
|| right
rightDescription
TRUEnever evaluated
FALSEnever evaluated
|| bottom
bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
268 d->ensureWindowFrameMargins();
never executed: d->ensureWindowFrameMargins();
0
269 if (left
leftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
270 *
never executed: *left = d->windowFrameMargins[d->Left];
left = d->windowFrameMargins[d->Left];
never executed: *left = d->windowFrameMargins[d->Left];
0
271 if (top
topDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
272 *
never executed: *top = d->windowFrameMargins[d->Top];
top = d->windowFrameMargins[d->Top];
never executed: *top = d->windowFrameMargins[d->Top];
0
273 if (right
rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
274 *
never executed: *right = d->windowFrameMargins[d->Right];
right = d->windowFrameMargins[d->Right];
never executed: *right = d->windowFrameMargins[d->Right];
0
275 if (bottom
bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
276 *
never executed: *bottom = d->windowFrameMargins[d->Bottom];
bottom = d->windowFrameMargins[d->Bottom];
never executed: *bottom = d->windowFrameMargins[d->Bottom];
0
277}
never executed: end of block
0
278-
279-
280-
281-
282-
283-
284void QGraphicsWidget::unsetWindowFrameMargins()-
285{-
286 QGraphicsWidgetPrivate * const d = d_func();-
287 if ((
(d->windowFlags & Qt::Window)Description
TRUEnever evaluated
FALSEnever evaluated
d->windowFlags & Qt::Window)
(d->windowFlags & Qt::Window)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(d->windowFlag...) != Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
d->windowFlags & Qt::WindowType_Mask) != Qt::Popup
(d->windowFlag...) != Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
&&
0
288 (
(d->windowFlag...!= Qt::ToolTipDescription
TRUEnever evaluated
FALSEnever evaluated
d->windowFlags & Qt::WindowType_Mask) != Qt::ToolTip
(d->windowFlag...!= Qt::ToolTipDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(d->windowFlags & Qt::FramelessWindowHint)
!(d->windowFla...essWindowHint)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
289 QStyleOptionTitleBar bar;-
290 d->initStyleOptionTitleBar(&bar);-
291 QStyle *style = this->style();-
292 qreal margin = style->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth);-
293 qreal titleBarHeight = d->titleBarHeight(bar);-
294 setWindowFrameMargins(margin, titleBarHeight, margin, margin);-
295 }
never executed: end of block
else {
0
296 setWindowFrameMargins(0, 0, 0, 0);-
297 }
never executed: end of block
0
298 d->setWindowFrameMargins = false;-
299}
never executed: end of block
0
300-
301-
302-
303-
304-
305-
306-
307QRectF QGraphicsWidget::windowFrameGeometry() const-
308{-
309 const QGraphicsWidgetPrivate * const d = d_func();-
310 return
never executed: return d->windowFrameMargins ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : geometry();
d->windowFrameMargins
never executed: return d->windowFrameMargins ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : geometry();
0
311 ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top],
never executed: return d->windowFrameMargins ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : geometry();
0
312 d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom])
never executed: return d->windowFrameMargins ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : geometry();
0
313 : geometry();
never executed: return d->windowFrameMargins ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : geometry();
0
314}-
315-
316-
317-
318-
319-
320-
321QRectF QGraphicsWidget::windowFrameRect() const-
322{-
323 const QGraphicsWidgetPrivate * const d = d_func();-
324 return
never executed: return d->windowFrameMargins ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : rect();
d->windowFrameMargins
never executed: return d->windowFrameMargins ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : rect();
0
325 ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top],
never executed: return d->windowFrameMargins ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : rect();
0
326 d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom])
never executed: return d->windowFrameMargins ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : rect();
0
327 : rect();
never executed: return d->windowFrameMargins ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top], d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom]) : rect();
0
328}-
329void QGraphicsWidget::initStyleOption(QStyleOption *option) const-
330{-
331 ((!(option)) ? qt_assert("option",__FILE__,692) : qt_noop());-
332-
333 option->state = QStyle::State_None;-
334 if (isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
335 option->state |= QStyle::State_Enabled;
never executed: option->state |= QStyle::State_Enabled;
0
336 if (hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
337 option->state |= QStyle::State_HasFocus;
never executed: option->state |= QStyle::State_HasFocus;
0
338-
339-
340 if (isUnderMouse()
isUnderMouse()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
341 option->state |= QStyle::State_MouseOver;
never executed: option->state |= QStyle::State_MouseOver;
0
342 if (QGraphicsWidget *w = window()
QGraphicsWidget *w = window()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
343 if (w->isActiveWindow()
w->isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
344 option->state |= QStyle::State_Active;
never executed: option->state |= QStyle::State_Active;
0
345 }
never executed: end of block
0
346 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
347 option->state |= QStyle::State_Window;
never executed: option->state |= QStyle::State_Window;
0
348 option->direction = layoutDirection();-
349 option->rect = rect().toRect();-
350 option->palette = palette();-
351 if (!isEnabled()
!isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
352 option->palette.setCurrentColorGroup(QPalette::Disabled);-
353 }
never executed: end of block
else if (isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
354 option->palette.setCurrentColorGroup(QPalette::Active);-
355 }
never executed: end of block
else {
0
356 option->palette.setCurrentColorGroup(QPalette::Inactive);-
357 }
never executed: end of block
0
358 option->fontMetrics = QFontMetrics(font());-
359 option->styleObject = const_cast<QGraphicsWidget *>(this);-
360}
never executed: end of block
0
361-
362-
363-
364-
365QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const-
366{-
367 const QGraphicsWidgetPrivate * const d = d_func();-
368 QSizeF sh;-
369 if (d->layout
d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
370 QSizeF marginSize(0,0);-
371 if (d->margins
d->marginsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
372 marginSize = QSizeF(d->margins[d->Left] + d->margins[d->Right],-
373 d->margins[d->Top] + d->margins[d->Bottom]);-
374 }
never executed: end of block
0
375 sh = d->layout->effectiveSizeHint(which, constraint - marginSize);-
376 sh += marginSize;-
377 }
never executed: end of block
else {
0
378 switch (which) {-
379 case
never executed: case Qt::MinimumSize:
Qt::MinimumSize:
never executed: case Qt::MinimumSize:
0
380 sh = QSizeF(0, 0);-
381 break;
never executed: break;
0
382 case
never executed: case Qt::PreferredSize:
Qt::PreferredSize:
never executed: case Qt::PreferredSize:
0
383 sh = QSizeF(50, 50);-
384 break;
never executed: break;
0
385 case
never executed: case Qt::MaximumSize:
Qt::MaximumSize:
never executed: case Qt::MaximumSize:
0
386 sh = QSizeF(((1<<24)-1), ((1<<24)-1));-
387 break;
never executed: break;
0
388 default
never executed: default:
:
never executed: default:
0
389 QMessageLogger(__FILE__, 773, __PRETTY_FUNCTION__).warning("QGraphicsWidget::sizeHint(): Don't know how to handle the value of 'which'");-
390 break;
never executed: break;
0
391 }-
392 }-
393 return
never executed: return sh;
sh;
never executed: return sh;
0
394}-
395QGraphicsLayout *QGraphicsWidget::layout() const-
396{-
397 const QGraphicsWidgetPrivate * const d = d_func();-
398 return
never executed: return d->layout;
d->layout;
never executed: return d->layout;
0
399}-
400void QGraphicsWidget::setLayout(QGraphicsLayout *l)-
401{-
402 QGraphicsWidgetPrivate * const d = d_func();-
403 if (d->layout == l
d->layout == lDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
404 return;
never executed: return;
0
405 d->setLayout_helper(l);-
406 if (!l
!lDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
407 return;
never executed: return;
0
408-
409-
410 QGraphicsLayoutItem *oldParent = l->parentLayoutItem();-
411 if (oldParent
oldParentDescription
TRUEnever evaluated
FALSEnever evaluated
&& oldParent != this
oldParent != thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
412 QMessageLogger(__FILE__, 850, __PRETTY_FUNCTION__).warning("QGraphicsWidget::setLayout: Attempting to set a layout on %s"-
413 " \"%s\", when the layout already has a parent",-
414 metaObject()->className(), QString(objectName()).toLocal8Bit().constData());-
415 return;
never executed: return;
0
416 }-
417-
418-
419 l->setParentLayoutItem(this);-
420 l->d_func()->reparentChildItems(this);-
421 l->invalidate();-
422 layoutChanged();-
423}
never executed: end of block
0
424void QGraphicsWidget::adjustSize()-
425{-
426 QSizeF sz = effectiveSizeHint(Qt::PreferredSize);-
427-
428 if (sz.isValid()
sz.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
429 resize(sz);
never executed: resize(sz);
0
430}
never executed: end of block
0
431Qt::LayoutDirection QGraphicsWidget::layoutDirection() const-
432{-
433 return
never executed: return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight;
testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight;
never executed: return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight;
0
434}-
435void QGraphicsWidget::setLayoutDirection(Qt::LayoutDirection direction)-
436{-
437 QGraphicsWidgetPrivate * const d = d_func();-
438 setAttribute(Qt::WA_SetLayoutDirection, true);-
439 d->setLayoutDirection_helper(direction);-
440}
never executed: end of block
0
441void QGraphicsWidget::unsetLayoutDirection()-
442{-
443 QGraphicsWidgetPrivate * const d = d_func();-
444 setAttribute(Qt::WA_SetLayoutDirection, false);-
445 d->resolveLayoutDirection();-
446}
never executed: end of block
0
447QStyle *QGraphicsWidget::style() const-
448{-
449 if (QStyle *style = widgetStyles()->styleForWidget(this)
QStyle *style ...orWidget(this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
450 return
never executed: return style;
style;
never executed: return style;
0
451-
452 return
never executed: return scene() ? scene()->style() : QApplication::style();
scene() ? scene()->style() : QApplication::style();
never executed: return scene() ? scene()->style() : QApplication::style();
0
453}-
454void QGraphicsWidget::setStyle(QStyle *style)-
455{-
456 setAttribute(Qt::WA_SetStyle, style != 0);-
457 widgetStyles()->setStyleForWidget(this, style);-
458-
459-
460 QEvent event(QEvent::StyleChange);-
461 QApplication::sendEvent(this, &event);-
462}
never executed: end of block
0
463QFont QGraphicsWidget::font() const-
464{-
465 const QGraphicsWidgetPrivate * const d = d_func();-
466 QFont fnt = d->font;-
467 fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask);-
468 return
never executed: return fnt;
fnt;
never executed: return fnt;
0
469}-
470void QGraphicsWidget::setFont(const QFont &font)-
471{-
472 QGraphicsWidgetPrivate * const d = d_func();-
473 setAttribute(Qt::WA_SetFont, font.resolve() != 0);-
474-
475 QFont naturalFont = d->naturalWidgetFont();-
476 QFont resolvedFont = font.resolve(naturalFont);-
477 d->setFont_helper(resolvedFont);-
478}
never executed: end of block
0
479QPalette QGraphicsWidget::palette() const-
480{-
481 const QGraphicsWidgetPrivate * const d = d_func();-
482 return
never executed: return d->palette;
d->palette;
never executed: return d->palette;
0
483}-
484void QGraphicsWidget::setPalette(const QPalette &palette)-
485{-
486 QGraphicsWidgetPrivate * const d = d_func();-
487 setAttribute(Qt::WA_SetPalette, palette.resolve() != 0);-
488-
489 QPalette naturalPalette = d->naturalWidgetPalette();-
490 QPalette resolvedPalette = palette.resolve(naturalPalette);-
491 d->setPalette_helper(resolvedPalette);-
492}
never executed: end of block
0
493bool QGraphicsWidget::autoFillBackground() const-
494{-
495 const QGraphicsWidgetPrivate * const d = d_func();-
496 return
never executed: return d->autoFillBackground;
d->autoFillBackground;
never executed: return d->autoFillBackground;
0
497}-
498void QGraphicsWidget::setAutoFillBackground(bool enabled)-
499{-
500 QGraphicsWidgetPrivate * const d = d_func();-
501 if (d->autoFillBackground != enabled
d->autoFillBac...und != enabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
502 d->autoFillBackground = enabled;-
503 update();-
504 }
never executed: end of block
0
505}
never executed: end of block
0
506void QGraphicsWidget::updateGeometry()-
507{-
508 QGraphicsLayoutItem::updateGeometry();-
509 QGraphicsLayoutItem *parentItem = parentLayoutItem();-
510-
511 if (parentItem
parentItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& parentItem->isLayout()
parentItem->isLayout()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
512 if (QGraphicsLayout::instantInvalidatePropagation()
QGraphicsLayou...ePropagation()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
513 static_cast<QGraphicsLayout *>(parentItem)->invalidate();-
514 }
never executed: end of block
else {
0
515 parentItem->updateGeometry();-
516 }
never executed: end of block
0
517 } else {-
518 if (parentItem
parentItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
519-
520 QGraphicsWidget *parentWid = parentWidget();-
521 if (parentWid->isVisible()
parentWid->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
522 QApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest));
never executed: QApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest));
0
523 }
never executed: end of block
else {
0
524-
525-
526-
527-
528-
529 if (QGraphicsLayout::instantInvalidatePropagation()
QGraphicsLayou...ePropagation()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
530 QApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest));
never executed: QApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest));
0
531 }
never executed: end of block
0
532 if (!QGraphicsLayout::instantInvalidatePropagation()
!QGraphicsLayo...ePropagation()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
533 bool wasResized = testAttribute(Qt::WA_Resized);-
534 resize(size());-
535 setAttribute(Qt::WA_Resized, wasResized);-
536 }
never executed: end of block
0
537 }
never executed: end of block
0
538}-
539QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &value)-
540{-
541 QGraphicsWidgetPrivate * const d = d_func();-
542 switch (change) {-
543 case
never executed: case ItemEnabledHasChanged:
ItemEnabledHasChanged:
never executed: case ItemEnabledHasChanged:
{
0
544-
545 QEvent event(QEvent::EnabledChange);-
546 QApplication::sendEvent(this, &event);-
547 break;
never executed: break;
0
548 }-
549 case
never executed: case ItemVisibleChange:
ItemVisibleChange:
never executed: case ItemVisibleChange:
0
550 if (value.toBool()
value.toBool()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
551-
552 QShowEvent event;-
553 QApplication::sendEvent(this, &event);-
554 bool resized = testAttribute(Qt::WA_Resized);-
555 if (!resized
!resizedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
556 adjustSize();-
557 setAttribute(Qt::WA_Resized, false);-
558 }
never executed: end of block
0
559 }
never executed: end of block
0
560-
561-
562 if (value.toBool()
value.toBool()Description
TRUEnever evaluated
FALSEnever evaluated
|| d->explicitlyHidden
d->explicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
563 updateGeometry();
never executed: updateGeometry();
0
564 break;
never executed: break;
0
565 case
never executed: case ItemVisibleHasChanged:
ItemVisibleHasChanged:
never executed: case ItemVisibleHasChanged:
0
566 if (!value.toBool()
!value.toBool()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
567-
568 QHideEvent event;-
569 QApplication::sendEvent(this, &event);-
570 }
never executed: end of block
0
571 break;
never executed: break;
0
572 case
never executed: case ItemPositionHasChanged:
ItemPositionHasChanged:
never executed: case ItemPositionHasChanged:
0
573 d->setGeometryFromSetPos();-
574 break;
never executed: break;
0
575 case
never executed: case ItemParentChange:
ItemParentChange:
never executed: case ItemParentChange:
{
0
576-
577 QEvent event(QEvent::ParentAboutToChange);-
578 QApplication::sendEvent(this, &event);-
579 break;
never executed: break;
0
580 }-
581 case
never executed: case ItemParentHasChanged:
ItemParentHasChanged:
never executed: case ItemParentHasChanged:
{
0
582-
583 QEvent event(QEvent::ParentChange);-
584 QApplication::sendEvent(this, &event);-
585 break;
never executed: break;
0
586 }-
587 case
never executed: case ItemCursorHasChanged:
ItemCursorHasChanged:
never executed: case ItemCursorHasChanged:
{
0
588-
589 QEvent event(QEvent::CursorChange);-
590 QApplication::sendEvent(this, &event);-
591 break;
never executed: break;
0
592 }-
593 case
never executed: case ItemToolTipHasChanged:
ItemToolTipHasChanged:
never executed: case ItemToolTipHasChanged:
{
0
594-
595 QEvent event(QEvent::ToolTipChange);-
596 QApplication::sendEvent(this, &event);-
597 break;
never executed: break;
0
598 }-
599 default
never executed: default:
:
never executed: default:
0
600 break;
never executed: break;
0
601 }-
602 return
never executed: return QGraphicsItem::itemChange(change, value);
QGraphicsItem::itemChange(change, value);
never executed: return QGraphicsItem::itemChange(change, value);
0
603}-
604QVariant QGraphicsWidget::propertyChange(const QString &propertyName, const QVariant &value)-
605{-
606 (void)propertyName;;-
607 return
never executed: return value;
value;
never executed: return value;
0
608}-
609bool QGraphicsWidget::sceneEvent(QEvent *event)-
610{-
611 return
never executed: return QGraphicsItem::sceneEvent(event);
QGraphicsItem::sceneEvent(event);
never executed: return QGraphicsItem::sceneEvent(event);
0
612}-
613bool QGraphicsWidget::windowFrameEvent(QEvent *event)-
614{-
615 QGraphicsWidgetPrivate * const d = d_func();-
616 switch (event->type()) {-
617 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
618 d->windowFrameMousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
619 break;
never executed: break;
0
620 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
621 d->ensureWindowData();-
622 if (d->windowData->grabbedSection != Qt::NoSection
d->windowData-... Qt::NoSectionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
623 d->windowFrameMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
624 event->accept();-
625 }
never executed: end of block
0
626 break;
never executed: break;
0
627 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
628 d->windowFrameMouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
629 break;
never executed: break;
0
630 case
never executed: case QEvent::GraphicsSceneHoverMove:
QEvent::GraphicsSceneHoverMove:
never executed: case QEvent::GraphicsSceneHoverMove:
0
631 d->windowFrameHoverMoveEvent(static_cast<QGraphicsSceneHoverEvent *>(event));-
632 break;
never executed: break;
0
633 case
never executed: case QEvent::GraphicsSceneHoverLeave:
QEvent::GraphicsSceneHoverLeave:
never executed: case QEvent::GraphicsSceneHoverLeave:
0
634 d->windowFrameHoverLeaveEvent(static_cast<QGraphicsSceneHoverEvent *>(event));-
635 break;
never executed: break;
0
636 default
never executed: default:
:
never executed: default:
0
637 break;
never executed: break;
0
638 }-
639 return
never executed: return event->isAccepted();
event->isAccepted();
never executed: return event->isAccepted();
0
640}-
641Qt::WindowFrameSection QGraphicsWidget::windowFrameSectionAt(const QPointF &pos) const-
642{-
643 const QGraphicsWidgetPrivate * const d = d_func();-
644-
645 const QRectF r = windowFrameRect();-
646 if (!r.contains(pos)
!r.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
647 return
never executed: return Qt::NoSection;
Qt::NoSection;
never executed: return Qt::NoSection;
0
648-
649 const qreal left = r.left();-
650 const qreal top = r.top();-
651 const qreal right = r.right();-
652 const qreal bottom = r.bottom();-
653 const qreal x = pos.x();-
654 const qreal y = pos.y();-
655-
656 const qreal cornerMargin = 20;-
657-
658 const qreal windowFrameWidth = d->windowFrameMargins
d->windowFrameMarginsDescription
TRUEnever evaluated
FALSEnever evaluated
0
659 ? d->windowFrameMargins[d->Left] : 0;-
660-
661 Qt::WindowFrameSection s = Qt::NoSection;-
662 if (x <= left + cornerMargin
x <= left + cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
663 if (y <= top + windowFrameWidth
y <= top + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
|| (x <= left + windowFrameWidth
x <= left + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
&& y <= top + cornerMargin
y <= top + cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
664 s = Qt::TopLeftSection;-
665 }
never executed: end of block
else if (y >= bottom - windowFrameWidth
y >= bottom - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
|| (x <= left + windowFrameWidth
x <= left + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
&& y >= bottom - cornerMargin
y >= bottom - cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
666 s = Qt::BottomLeftSection;-
667 }
never executed: end of block
else if (x <= left + windowFrameWidth
x <= left + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
668 s = Qt::LeftSection;-
669 }
never executed: end of block
0
670 }
never executed: end of block
else if (x >= right - cornerMargin
x >= right - cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
671 if (y <= top + windowFrameWidth
y <= top + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
|| (x >= right - windowFrameWidth
x >= right - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
&& y <= top + cornerMargin
y <= top + cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
672 s = Qt::TopRightSection;-
673 }
never executed: end of block
else if (y >= bottom - windowFrameWidth
y >= bottom - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
|| (x >= right - windowFrameWidth
x >= right - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
&& y >= bottom - cornerMargin
y >= bottom - cornerMarginDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
674 s = Qt::BottomRightSection;-
675 }
never executed: end of block
else if (x >= right - windowFrameWidth
x >= right - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
676 s = Qt::RightSection;-
677 }
never executed: end of block
0
678 }
never executed: end of block
else if (y <= top + windowFrameWidth
y <= top + windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
679 s = Qt::TopSection;-
680 }
never executed: end of block
else if (y >= bottom - windowFrameWidth
y >= bottom - windowFrameWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
681 s = Qt::BottomSection;-
682 }
never executed: end of block
0
683 if (s == Qt::NoSection
s == Qt::NoSectionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
684 QRectF r1 = r;-
685 r1.setHeight(d->windowFrameMargins-
686 ? d->windowFrameMargins[d->Top] : 0);-
687 if (r1.contains(pos)
r1.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
688 s = Qt::TitleBarArea;
never executed: s = Qt::TitleBarArea;
0
689 }
never executed: end of block
0
690 return
never executed: return s;
s;
never executed: return s;
0
691}-
692bool QGraphicsWidget::event(QEvent *event)-
693{-
694 QGraphicsWidgetPrivate * const d = d_func();-
695-
696 if (d->layout
d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
697 d->layout->widgetEvent(event);
never executed: d->layout->widgetEvent(event);
0
698-
699-
700 switch (event->type()) {-
701 case
never executed: case QEvent::GraphicsSceneMove:
QEvent::GraphicsSceneMove:
never executed: case QEvent::GraphicsSceneMove:
0
702 moveEvent(static_cast<QGraphicsSceneMoveEvent *>(event));-
703 break;
never executed: break;
0
704 case
never executed: case QEvent::GraphicsSceneResize:
QEvent::GraphicsSceneResize:
never executed: case QEvent::GraphicsSceneResize:
0
705 resizeEvent(static_cast<QGraphicsSceneResizeEvent *>(event));-
706 break;
never executed: break;
0
707 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
0
708 showEvent(static_cast<QShowEvent *>(event));-
709 break;
never executed: break;
0
710 case
never executed: case QEvent::Hide:
QEvent::Hide:
never executed: case QEvent::Hide:
0
711 hideEvent(static_cast<QHideEvent *>(event));-
712 break;
never executed: break;
0
713 case
never executed: case QEvent::Polish:
QEvent::Polish:
never executed: case QEvent::Polish:
0
714 polishEvent();-
715 d->polished = true;-
716 if (!d->font.isCopyOf(QApplication::font())
!d->font.isCop...ation::font())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
717 d->updateFont(d->font);
never executed: d->updateFont(d->font);
0
718 break;
never executed: break;
0
719 case
never executed: case QEvent::WindowActivate:
QEvent::WindowActivate:
never executed: case QEvent::WindowActivate:
0
720 case
never executed: case QEvent::WindowDeactivate:
QEvent::WindowDeactivate:
never executed: case QEvent::WindowDeactivate:
0
721 update();-
722 break;
never executed: break;
0
723 case
never executed: case QEvent::StyleAnimationUpdate:
QEvent::StyleAnimationUpdate:
never executed: case QEvent::StyleAnimationUpdate:
0
724 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
725 event->accept();-
726 update();-
727 }
never executed: end of block
0
728 break;
never executed: break;
0
729-
730 case
never executed: case QEvent::ActivationChange:
QEvent::ActivationChange:
never executed: case QEvent::ActivationChange:
0
731 case
never executed: case QEvent::EnabledChange:
QEvent::EnabledChange:
never executed: case QEvent::EnabledChange:
0
732 case
never executed: case QEvent::FontChange:
QEvent::FontChange:
never executed: case QEvent::FontChange:
0
733 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
734 case
never executed: case QEvent::PaletteChange:
QEvent::PaletteChange:
never executed: case QEvent::PaletteChange:
0
735 case
never executed: case QEvent::ParentChange:
QEvent::ParentChange:
never executed: case QEvent::ParentChange:
0
736 case
never executed: case QEvent::ContentsRectChange:
QEvent::ContentsRectChange:
never executed: case QEvent::ContentsRectChange:
0
737 case
never executed: case QEvent::LayoutDirectionChange:
QEvent::LayoutDirectionChange:
never executed: case QEvent::LayoutDirectionChange:
0
738 changeEvent(event);-
739 break;
never executed: break;
0
740 case
never executed: case QEvent::Close:
QEvent::Close:
never executed: case QEvent::Close:
0
741 closeEvent((QCloseEvent *)event);-
742 break;
never executed: break;
0
743 case
never executed: case QEvent::GrabMouse:
QEvent::GrabMouse:
never executed: case QEvent::GrabMouse:
0
744 grabMouseEvent(event);-
745 break;
never executed: break;
0
746 case
never executed: case QEvent::UngrabMouse:
QEvent::UngrabMouse:
never executed: case QEvent::UngrabMouse:
0
747 ungrabMouseEvent(event);-
748 break;
never executed: break;
0
749 case
never executed: case QEvent::GrabKeyboard:
QEvent::GrabKeyboard:
never executed: case QEvent::GrabKeyboard:
0
750 grabKeyboardEvent(event);-
751 break;
never executed: break;
0
752 case
never executed: case QEvent::UngrabKeyboard:
QEvent::UngrabKeyboard:
never executed: case QEvent::UngrabKeyboard:
0
753 ungrabKeyboardEvent(event);-
754 break;
never executed: break;
0
755 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
756 if (d->hasDecoration()
d->hasDecoration()Description
TRUEnever evaluated
FALSEnever evaluated
&& windowFrameEvent(event)
windowFrameEvent(event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
757 return
never executed: return true;
true;
never executed: return true;
0
758 break;
never executed: break;
0
759 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
760 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
761 case
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
QEvent::GraphicsSceneMouseDoubleClick:
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
0
762 d->ensureWindowData();-
763 if (d->hasDecoration()
d->hasDecoration()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->windowData->grabbedSection != Qt::NoSection
d->windowData-... Qt::NoSectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
764 return
never executed: return windowFrameEvent(event);
windowFrameEvent(event);
never executed: return windowFrameEvent(event);
0
765 break;
never executed: break;
0
766 case
never executed: case QEvent::GraphicsSceneHoverEnter:
QEvent::GraphicsSceneHoverEnter:
never executed: case QEvent::GraphicsSceneHoverEnter:
0
767 case
never executed: case QEvent::GraphicsSceneHoverMove:
QEvent::GraphicsSceneHoverMove:
never executed: case QEvent::GraphicsSceneHoverMove:
0
768 case
never executed: case QEvent::GraphicsSceneHoverLeave:
QEvent::GraphicsSceneHoverLeave:
never executed: case QEvent::GraphicsSceneHoverLeave:
0
769 if (d->hasDecoration()
d->hasDecoration()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
770 windowFrameEvent(event);-
771-
772-
773 if (!acceptHoverEvents()
!acceptHoverEvents()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
774 return
never executed: return true;
true;
never executed: return true;
0
775 }
never executed: end of block
0
776 break;
never executed: break;
0
777 default
never executed: default:
:
never executed: default:
0
778 break;
never executed: break;
0
779 }-
780 return
never executed: return QObject::event(event);
QObject::event(event);
never executed: return QObject::event(event);
0
781}-
782void QGraphicsWidget::changeEvent(QEvent *event)-
783{-
784 QGraphicsWidgetPrivate * const d = d_func();-
785 switch (event->type()) {-
786 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
787-
788 unsetWindowFrameMargins();-
789 if (d->layout
d->layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
790 d->layout->invalidate();
never executed: d->layout->invalidate();
0
791 case
never executed: case QEvent::FontChange:
QEvent::FontChange:
never executed: case QEvent::FontChange:
code before this statement never executed: case QEvent::FontChange:
0
792 update();-
793 updateGeometry();-
794 break;
never executed: break;
0
795 case
never executed: case QEvent::PaletteChange:
QEvent::PaletteChange:
never executed: case QEvent::PaletteChange:
0
796 update();-
797 break;
never executed: break;
0
798 case
never executed: case QEvent::ParentChange:
QEvent::ParentChange:
never executed: case QEvent::ParentChange:
0
799 d->resolveFont(d->inheritedFontResolveMask);-
800 d->resolvePalette(d->inheritedPaletteResolveMask);-
801 break;
never executed: break;
0
802 default
never executed: default:
:
never executed: default:
0
803 break;
never executed: break;
0
804 }-
805}-
806void QGraphicsWidget::closeEvent(QCloseEvent *event)-
807{-
808 event->accept();-
809}
never executed: end of block
0
810-
811-
812-
813-
814void QGraphicsWidget::focusInEvent(QFocusEvent *event)-
815{-
816 (void)event;;-
817 if (focusPolicy() != Qt::NoFocus
focusPolicy() != Qt::NoFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
818 update();
never executed: update();
0
819}
never executed: end of block
0
820bool QGraphicsWidget::focusNextPrevChild(bool next)-
821{-
822 QGraphicsWidgetPrivate * const d = d_func();-
823-
824 QGraphicsWidget *parent = 0;-
825 if (!isWindow()
!isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(parent = parentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
parent = parentWidget())
(parent = parentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
826 return
never executed: return parent->focusNextPrevChild(next);
parent->focusNextPrevChild(next);
never executed: return parent->focusNextPrevChild(next);
0
827 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
828 return
never executed: return false;
false;
never executed: return false;
0
829 if (d->scene->focusNextPrevChild(next)
d->scene->focu...revChild(next)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
830 return
never executed: return true;
true;
never executed: return true;
0
831 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
832 setFocus(next ? Qt::TabFocusReason : Qt::BacktabFocusReason);-
833 if (hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
834 return
never executed: return true;
true;
never executed: return true;
0
835 }
never executed: end of block
0
836 return
never executed: return false;
false;
never executed: return false;
0
837}-
838-
839-
840-
841-
842void QGraphicsWidget::focusOutEvent(QFocusEvent *event)-
843{-
844 (void)event;;-
845 if (focusPolicy() != Qt::NoFocus
focusPolicy() != Qt::NoFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
846 update();
never executed: update();
0
847}
never executed: end of block
0
848void QGraphicsWidget::hideEvent(QHideEvent *event)-
849{-
850-
851-
852 (void)event;;-
853}
never executed: end of block
0
854void QGraphicsWidget::moveEvent(QGraphicsSceneMoveEvent *event)-
855{-
856-
857 (void)event;;-
858}
never executed: end of block
0
859void QGraphicsWidget::polishEvent()-
860{-
861}-
862void QGraphicsWidget::resizeEvent(QGraphicsSceneResizeEvent *event)-
863{-
864 (void)event;;-
865}
never executed: end of block
0
866void QGraphicsWidget::showEvent(QShowEvent *event)-
867{-
868 (void)event;;-
869}
never executed: end of block
0
870-
871-
872-
873-
874void QGraphicsWidget::hoverMoveEvent(QGraphicsSceneHoverEvent *event)-
875{-
876 (void)event;;-
877}
never executed: end of block
0
878-
879-
880-
881-
882void QGraphicsWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)-
883{-
884 QGraphicsObject::hoverLeaveEvent(event);-
885}
never executed: end of block
0
886-
887-
888-
889-
890-
891-
892-
893void QGraphicsWidget::grabMouseEvent(QEvent *event)-
894{-
895 (void)event;;-
896}
never executed: end of block
0
897-
898-
899-
900-
901-
902-
903-
904void QGraphicsWidget::ungrabMouseEvent(QEvent *event)-
905{-
906 (void)event;;-
907}
never executed: end of block
0
908-
909-
910-
911-
912-
913-
914-
915void QGraphicsWidget::grabKeyboardEvent(QEvent *event)-
916{-
917 (void)event;;-
918}
never executed: end of block
0
919-
920-
921-
922-
923-
924-
925-
926void QGraphicsWidget::ungrabKeyboardEvent(QEvent *event)-
927{-
928 (void)event;;-
929}
never executed: end of block
0
930-
931-
932-
933-
934-
935-
936Qt::WindowType QGraphicsWidget::windowType() const-
937{-
938 return
never executed: return Qt::WindowType(int(windowFlags()) & Qt::WindowType_Mask);
Qt::WindowType(int(windowFlags()) & Qt::WindowType_Mask);
never executed: return Qt::WindowType(int(windowFlags()) & Qt::WindowType_Mask);
0
939}-
940Qt::WindowFlags QGraphicsWidget::windowFlags() const-
941{-
942 const QGraphicsWidgetPrivate * const d = d_func();-
943 return
never executed: return d->windowFlags;
d->windowFlags;
never executed: return d->windowFlags;
0
944}-
945void QGraphicsWidget::setWindowFlags(Qt::WindowFlags wFlags)-
946{-
947 QGraphicsWidgetPrivate * const d = d_func();-
948 if (d->windowFlags == wFlags
d->windowFlags == wFlagsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
949 return;
never executed: return;
0
950 bool wasPopup = (d->windowFlags & Qt::WindowType_Mask) == Qt::Popup;-
951-
952 d->adjustWindowFlags(&wFlags);-
953 d->windowFlags = wFlags;-
954 if (!d->setWindowFrameMargins
!d->setWindowFrameMarginsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
955 unsetWindowFrameMargins();
never executed: unsetWindowFrameMargins();
0
956-
957 setFlag(ItemIsPanel, d->windowFlags & Qt::Window);-
958-
959 bool isPopup = (d->windowFlags & Qt::WindowType_Mask) == Qt::Popup;-
960 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& wasPopup != isPopup
wasPopup != isPopupDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
961-
962 if (!isPopup
!isPopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
963 d->scene->d_func()->removePopup(this);
never executed: d->scene->d_func()->removePopup(this);
0
964 else-
965 d->scene->d_func()->addPopup(this);
never executed: d->scene->d_func()->addPopup(this);
0
966 }-
967-
968 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->scene->d_func()->allItemsIgnoreHoverEvents
d->scene->d_fu...oreHoverEventsDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->hasDecoration()
d->hasDecoration()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
969 d->scene->d_func()->allItemsIgnoreHoverEvents = false;-
970 d->scene->d_func()->enableMouseTrackingOnViews();-
971 }
never executed: end of block
0
972}
never executed: end of block
0
973bool QGraphicsWidget::isActiveWindow() const-
974{-
975 return
never executed: return isActive();
isActive();
never executed: return isActive();
0
976}-
977void QGraphicsWidget::setWindowTitle(const QString &title)-
978{-
979 QGraphicsWidgetPrivate * const d = d_func();-
980 d->ensureWindowData();-
981 d->windowData->windowTitle = title;-
982}
never executed: end of block
0
983QString QGraphicsWidget::windowTitle() const-
984{-
985 const QGraphicsWidgetPrivate * const d = d_func();-
986 return
never executed: return d->windowData ? d->windowData->windowTitle : QString();
d->windowData ? d->windowData->windowTitle : QString();
never executed: return d->windowData ? d->windowData->windowTitle : QString();
0
987}-
988Qt::FocusPolicy QGraphicsWidget::focusPolicy() const-
989{-
990 const QGraphicsWidgetPrivate * const d = d_func();-
991 return
never executed: return d->focusPolicy;
d->focusPolicy;
never executed: return d->focusPolicy;
0
992}-
993void QGraphicsWidget::setFocusPolicy(Qt::FocusPolicy policy)-
994{-
995 QGraphicsWidgetPrivate * const d = d_func();-
996 if (d->focusPolicy == policy
d->focusPolicy == policyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
997 return;
never executed: return;
0
998 d->focusPolicy = policy;-
999 if (hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
&& policy == Qt::NoFocus
policy == Qt::NoFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1000 clearFocus();
never executed: clearFocus();
0
1001 setFlag(ItemIsFocusable, policy != Qt::NoFocus);-
1002}
never executed: end of block
0
1003QGraphicsWidget *QGraphicsWidget::focusWidget() const-
1004{-
1005 const QGraphicsWidgetPrivate * const d = d_func();-
1006 if (d->subFocusItem
d->subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->subFocusItem->d_ptr->isWidget
d->subFocusIte..._ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1007 return
never executed: return static_cast<QGraphicsWidget *>(d->subFocusItem);
static_cast<QGraphicsWidget *>(d->subFocusItem);
never executed: return static_cast<QGraphicsWidget *>(d->subFocusItem);
0
1008 return
never executed: return 0;
0;
never executed: return 0;
0
1009}-
1010int QGraphicsWidget::grabShortcut(const QKeySequence &sequence, Qt::ShortcutContext context)-
1011{-
1012 ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,1917) : qt_noop());-
1013 if (sequence.isEmpty()
sequence.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1014 return
never executed: return 0;
0;
never executed: return 0;
0
1015-
1016 return
never executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher);
(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher);
never executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher);
0
1017}-
1018void QGraphicsWidget::releaseShortcut(int id)-
1019{-
1020 ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,1943) : qt_noop());-
1021 if (id
idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1022 (static_cast<
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0);
QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0);
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0);
0
1023}
never executed: end of block
0
1024void QGraphicsWidget::setShortcutEnabled(int id, bool enabled)-
1025{-
1026 ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,1964) : qt_noop());-
1027 if (id
idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1028 (static_cast<
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enabled, id, this, 0);
QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enabled, id, this, 0);
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enabled, id, this, 0);
0
1029}
never executed: end of block
0
1030void QGraphicsWidget::setShortcutAutoRepeat(int id, bool enabled)-
1031{-
1032 ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,1979) : qt_noop());-
1033 if (id
idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1034 (static_cast<
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0);
QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0);
never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0);
0
1035}
never executed: end of block
0
1036void QGraphicsWidget::addAction(QAction *action)-
1037{-
1038 insertAction(0, action);-
1039}
never executed: end of block
0
1040void QGraphicsWidget::addActions(QList<QAction *> actions)-
1041-
1042{-
1043 for (int i = 0; i < actions.count()
i < actions.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1044 insertAction(0, actions.at(i));
never executed: insertAction(0, actions.at(i));
0
1045}
never executed: end of block
0
1046void QGraphicsWidget::insertAction(QAction *before, QAction *action)-
1047{-
1048 if (!action
!actionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1049 QMessageLogger(__FILE__, 2037, __PRETTY_FUNCTION__).warning("QWidget::insertAction: Attempt to insert null action");-
1050 return;
never executed: return;
0
1051 }-
1052-
1053 QGraphicsWidgetPrivate * const d = d_func();-
1054 int index = d->actions.indexOf(action);-
1055 if (index != -1
index != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1056 d->actions.removeAt(index);
never executed: d->actions.removeAt(index);
0
1057-
1058 int pos = d->actions.indexOf(before);-
1059 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1060 before = 0;-
1061 pos = d->actions.size();-
1062 }
never executed: end of block
0
1063 d->actions.insert(pos, action);-
1064-
1065 if (index == -1
index == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1066 QActionPrivate *apriv = action->d_func();-
1067 apriv->graphicsWidgets.append(this);-
1068 }
never executed: end of block
0
1069-
1070 QActionEvent e(QEvent::ActionAdded, action, before);-
1071 QApplication::sendEvent(this, &e);-
1072}
never executed: end of block
0
1073void QGraphicsWidget::insertActions(QAction *before, QList<QAction *> actions)-
1074-
1075{-
1076 for (int i = 0; i < actions.count()
i < actions.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1077 insertAction(before, actions.at(i));
never executed: insertAction(before, actions.at(i));
0
1078}
never executed: end of block
0
1079void QGraphicsWidget::removeAction(QAction *action)-
1080{-
1081 if (!action
!actionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1082 return;
never executed: return;
0
1083-
1084 QGraphicsWidgetPrivate * const d = d_func();-
1085-
1086 QActionPrivate *apriv = action->d_func();-
1087 apriv->graphicsWidgets.removeAll(this);-
1088-
1089 if (d->actions.removeAll(action)
d->actions.removeAll(action)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1090 QActionEvent e(QEvent::ActionRemoved, action);-
1091 QApplication::sendEvent(this, &e);-
1092 }
never executed: end of block
0
1093}
never executed: end of block
0
1094QList<QAction *> QGraphicsWidget::actions() const-
1095{-
1096 const QGraphicsWidgetPrivate * const d = d_func();-
1097 return
never executed: return d->actions;
d->actions;
never executed: return d->actions;
0
1098}-
1099void QGraphicsWidget::setTabOrder(QGraphicsWidget *first, QGraphicsWidget *second)-
1100{-
1101 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
&& !second
!secondDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1102 QMessageLogger(__FILE__, 2148, __PRETTY_FUNCTION__).warning("QGraphicsWidget::setTabOrder(0, 0) is undefined");-
1103 return;
never executed: return;
0
1104 }-
1105 if ((first
firstDescription
TRUEnever evaluated
FALSEnever evaluated
&& second
secondDescription
TRUEnever evaluated
FALSEnever evaluated
) && first->scene() != second->scene()
first->scene()...econd->scene()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1106 QMessageLogger(__FILE__, 2152, __PRETTY_FUNCTION__).warning("QGraphicsWidget::setTabOrder: scenes %p and %p are different",-
1107 first->scene(), second->scene());-
1108 return;
never executed: return;
0
1109 }-
1110 QGraphicsScene *scene = first
firstDescription
TRUEnever evaluated
FALSEnever evaluated
? first->scene() : second->scene();
0
1111 if (!scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
|| !second
!secondDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1112 QMessageLogger(__FILE__, 2158, __PRETTY_FUNCTION__).warning("QGraphicsWidget::setTabOrder: assigning tab order from/to the"-
1113 " scene requires the item to be in a scene.");-
1114 return;
never executed: return;
0
1115 }-
1116-
1117-
1118-
1119-
1120 QGraphicsScenePrivate *sceneD = scene->d_func();-
1121 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1122 sceneD->tabFocusFirst = second;-
1123 return;
never executed: return;
0
1124 }-
1125 if (!second
!secondDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1126 sceneD->tabFocusFirst = first->d_func()->focusNext;-
1127 return;
never executed: return;
0
1128 }-
1129-
1130-
1131 QGraphicsWidget *firstFocusNext = first->d_func()->focusNext;-
1132 if (firstFocusNext == second
firstFocusNext == secondDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1133-
1134 return;
never executed: return;
0
1135 }-
1136-
1137-
1138 QGraphicsWidget *secondFocusPrev = second->d_func()->focusPrev;-
1139 QGraphicsWidget *secondFocusNext = second->d_func()->focusNext;-
1140 firstFocusNext->d_func()->focusPrev = second;-
1141 first->d_func()->focusNext = second;-
1142 second->d_func()->focusNext = firstFocusNext;-
1143 second->d_func()->focusPrev = first;-
1144 secondFocusPrev->d_func()->focusNext = secondFocusNext;-
1145 secondFocusNext->d_func()->focusPrev = secondFocusPrev;-
1146-
1147 ((!(first->d_func()->focusNext->d_func()->focusPrev == first)) ? qt_assert("first->d_func()->focusNext->d_func()->focusPrev == first",__FILE__,2193) : qt_noop());-
1148 ((!(first->d_func()->focusPrev->d_func()->focusNext == first)) ? qt_assert("first->d_func()->focusPrev->d_func()->focusNext == first",__FILE__,2194) : qt_noop());-
1149-
1150 ((!(second->d_func()->focusNext->d_func()->focusPrev == second)) ? qt_assert("second->d_func()->focusNext->d_func()->focusPrev == second",__FILE__,2196) : qt_noop());-
1151 ((!(second->d_func()->focusPrev->d_func()->focusNext == second)) ? qt_assert("second->d_func()->focusPrev->d_func()->focusNext == second",__FILE__,2197) : qt_noop());-
1152-
1153}
never executed: end of block
0
1154void QGraphicsWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)-
1155{-
1156 QGraphicsWidgetPrivate * const d = d_func();-
1157-
1158-
1159-
1160 d->setAttribute(attribute, on);-
1161}
never executed: end of block
0
1162-
1163-
1164-
1165-
1166-
1167-
1168-
1169bool QGraphicsWidget::testAttribute(Qt::WidgetAttribute attribute) const-
1170{-
1171 const QGraphicsWidgetPrivate * const d = d_func();-
1172 return
never executed: return d->testAttribute(attribute);
d->testAttribute(attribute);
never executed: return d->testAttribute(attribute);
0
1173}-
1174-
1175-
1176-
1177-
1178int QGraphicsWidget::type() const-
1179{-
1180 return
never executed: return Type;
Type;
never executed: return Type;
0
1181}-
1182-
1183-
1184-
1185-
1186void QGraphicsWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)-
1187{-
1188 (void)painter;;-
1189 (void)option;;-
1190 (void)widget;;-
1191}
never executed: end of block
0
1192void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,-
1193 QWidget *widget)-
1194{-
1195 const bool fillBackground = !testAttribute(Qt::WA_OpaquePaintEvent)
!testAttribute...quePaintEvent)Description
TRUEnever evaluated
FALSEnever evaluated
0
1196 && !testAttribute(Qt::WA_NoSystemBackground)
!testAttribute...temBackground)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1197 QGraphicsProxyWidget *proxy = qobject_cast<QGraphicsProxyWidget *>(this);-
1198 const bool embeddedWidgetFillsOwnBackground = proxy
proxyDescription
TRUEnever evaluated
FALSEnever evaluated
&& proxy->widget()
proxy->widget()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1199-
1200 if (rect().contains(option->exposedRect)
rect().contain...->exposedRect)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1201 if (fillBackground
fillBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
&& !embeddedWidgetFillsOwnBackground
!embeddedWidge...sOwnBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1202 painter->fillRect(option->exposedRect, palette().window());
never executed: painter->fillRect(option->exposedRect, palette().window());
0
1203 return;
never executed: return;
0
1204 }-
1205-
1206 QGraphicsWidgetPrivate * const d = d_func();-
1207-
1208 QRect windowFrameRect = QRect(QPoint(), windowFrameGeometry().size().toSize());-
1209 QStyleOptionTitleBar bar;-
1210 bar.QStyleOption::operator=(*option);-
1211 d->initStyleOptionTitleBar(&bar);-
1212 d->ensureWindowData();-
1213 bar.state.setFlag(QStyle::State_MouseOver, d->windowData->buttonMouseOver);-
1214 bar.state.setFlag(QStyle::State_Sunken, d->windowData->buttonSunken);-
1215 bar.rect = windowFrameRect;-
1216-
1217-
1218 const QPointF styleOrigin = this->windowFrameRect().topLeft();-
1219 painter->translate(styleOrigin);-
1220 QStyleHintReturnMask mask;-
1221 bool setMask = style()->styleHint(QStyle::SH_WindowFrame_Mask, &bar, widget, &mask)
style()->style...widget, &mask)Description
TRUEnever evaluated
FALSEnever evaluated
&& !mask.region.isEmpty()
!mask.region.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1222 bool hasBorder = !style()->styleHint(QStyle::SH_TitleBar_NoBorder, &bar, widget);-
1223 int frameWidth = style()->pixelMetric(QStyle::PM_MDIFrameWidth, &bar, widget);-
1224 if (setMask
setMaskDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1225 painter->save();-
1226 painter->setClipRegion(mask.region, Qt::IntersectClip);-
1227 }
never executed: end of block
0
1228 if (fillBackground
fillBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1229 if (embeddedWidgetFillsOwnBackground
embeddedWidget...sOwnBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1230-
1231 QPainterPath windowFrameBackground;-
1232 windowFrameBackground.addRect(windowFrameRect);-
1233-
1234-
1235 windowFrameBackground.addRect(rect().translated(-styleOrigin).adjusted(0.5, 0.5, -0.5, -0.5));-
1236 painter->fillPath(windowFrameBackground, palette().window());-
1237 }
never executed: end of block
else {
0
1238 painter->fillRect(windowFrameRect, palette().window());-
1239 }
never executed: end of block
0
1240 }-
1241-
1242-
1243 int height = (int)d->titleBarHeight(bar);-
1244 bar.rect.setHeight(height);-
1245 if (hasBorder
hasBorderDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1246 bar.rect.adjust(frameWidth, frameWidth, -frameWidth, 0);
never executed: bar.rect.adjust(frameWidth, frameWidth, -frameWidth, 0);
0
1247-
1248 painter->save();-
1249 painter->setFont(QApplication::font("QMdiSubWindowTitleBar"));-
1250 style()->drawComplexControl(QStyle::CC_TitleBar, &bar, painter, widget);-
1251 painter->restore();-
1252 if (setMask
setMaskDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1253 painter->restore();
never executed: painter->restore();
0
1254-
1255 QStyleOptionFrame frameOptions;-
1256 frameOptions.QStyleOption::operator=(*option);-
1257 initStyleOption(&frameOptions);-
1258 if (!hasBorder
!hasBorderDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1259 painter->setClipRect(windowFrameRect.adjusted(0, +height, 0, 0), Qt::IntersectClip);
never executed: painter->setClipRect(windowFrameRect.adjusted(0, +height, 0, 0), Qt::IntersectClip);
0
1260 frameOptions.state.setFlag(QStyle::State_HasFocus, hasFocus());-
1261 bool isActive = isActiveWindow();-
1262 frameOptions.state.setFlag(QStyle::State_Active, isActive);-
1263-
1264 frameOptions.palette.setCurrentColorGroup(isActive ? QPalette::Active : QPalette::Normal);-
1265 frameOptions.rect = windowFrameRect;-
1266 frameOptions.lineWidth = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, widget);-
1267 frameOptions.midLineWidth = 1;-
1268 style()->drawPrimitive(QStyle::PE_FrameWindow, &frameOptions, painter, widget);-
1269-
1270-
1271-
1272-
1273-
1274}
never executed: end of block
0
1275-
1276-
1277-
1278-
1279QRectF QGraphicsWidget::boundingRect() const-
1280{-
1281 return
never executed: return windowFrameRect();
windowFrameRect();
never executed: return windowFrameRect();
0
1282}-
1283-
1284-
1285-
1286-
1287QPainterPath QGraphicsWidget::shape() const-
1288{-
1289 QPainterPath path;-
1290 path.addRect(rect());-
1291 return
never executed: return path;
path;
never executed: return path;
0
1292}-
1293bool QGraphicsWidget::close()-
1294{-
1295 QCloseEvent closeEvent;-
1296 QApplication::sendEvent(this, &closeEvent);-
1297 if (!closeEvent.isAccepted()
!closeEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1298 return
never executed: return false;
false;
never executed: return false;
0
1299 }-
1300-
1301 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1302 hide();-
1303 }
never executed: end of block
0
1304 if (testAttribute(Qt::WA_DeleteOnClose)
testAttribute(...DeleteOnClose)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1305 deleteLater();-
1306 }
never executed: end of block
0
1307 return
never executed: return true;
true;
never executed: return true;
0
1308}-
1309-
1310-
Switch to Source codePreprocessed file

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