qgraphicsproxywidget.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicsproxywidget.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);-
8__attribute__((visibility("default"))) extern bool qt_tab_all_widgets();-
9-
10-
11-
12-
13QGraphicsProxyWidgetPrivate::QGraphicsProxyWidgetPrivate()-
14 : QGraphicsWidgetPrivate(),-
15 dragDropWidget(nullptr),-
16 posChangeMode(NoMode),-
17 sizeChangeMode(NoMode),-
18 visibleChangeMode(NoMode),-
19 enabledChangeMode(NoMode),-
20 styleChangeMode(NoMode),-
21 paletteChangeMode(NoMode),-
22 tooltipChangeMode(NoMode),-
23 focusFromWidgetToProxy(false),-
24 proxyIsGivingFocus(false)-
25{-
26}
never executed: end of block
0
27-
28-
29-
30-
31QGraphicsProxyWidgetPrivate::~QGraphicsProxyWidgetPrivate()-
32{-
33}-
34-
35-
36-
37-
38void QGraphicsProxyWidgetPrivate::init()-
39{-
40 QGraphicsProxyWidget * const q = q_func();-
41 q->setFocusPolicy(Qt::WheelFocus);-
42 q->setAcceptDrops(true);-
43}
never executed: end of block
0
44-
45-
46-
47-
48void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneHoverEvent *event)-
49{-
50 QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove);-
51 mouseEvent.setPos(event->pos());-
52 mouseEvent.setScreenPos(event->screenPos());-
53 mouseEvent.setButton(Qt::NoButton);-
54 mouseEvent.setButtons(0);-
55 mouseEvent.setModifiers(event->modifiers());-
56 sendWidgetMouseEvent(&mouseEvent);-
57 event->setAccepted(mouseEvent.isAccepted());-
58}
never executed: end of block
0
59-
60-
61-
62-
63void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent *event)-
64{-
65 if (!event
!eventDescription
TRUEnever evaluated
FALSEnever evaluated
|| !widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !widget->isVisible()
!widget->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
66 return;
never executed: return;
0
67 QGraphicsProxyWidget * const q = q_func();-
68-
69-
70 QPointF pos = event->pos();-
71 QPointer<QWidget> alienWidget = widget->childAt(pos.toPoint());-
72 QPointer<QWidget> receiver = alienWidget
alienWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
? alienWidget : widget;
0
73-
74 if (QWidgetPrivate::nearestGraphicsProxyWidget(receiver) != q
QWidgetPrivate...receiver) != qDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
75 return;
never executed: return;
0
76-
77-
78 QEvent::Type type = QEvent::None;-
79 switch (event->type()) {-
80 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
81 type = QEvent::MouseButtonPress;-
82 if (!embeddedMouseGrabber
!embeddedMouseGrabberDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
83 embeddedMouseGrabber = receiver;
never executed: embeddedMouseGrabber = receiver;
0
84 else-
85 receiver = embeddedMouseGrabber;
never executed: receiver = embeddedMouseGrabber;
0
86 break;
never executed: break;
0
87 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
88 type = QEvent::MouseButtonRelease;-
89 if (embeddedMouseGrabber
embeddedMouseGrabberDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
90 receiver = embeddedMouseGrabber;
never executed: receiver = embeddedMouseGrabber;
0
91 break;
never executed: break;
0
92 case
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
QEvent::GraphicsSceneMouseDoubleClick:
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
0
93 type = QEvent::MouseButtonDblClick;-
94 if (!embeddedMouseGrabber
!embeddedMouseGrabberDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
95 embeddedMouseGrabber = receiver;
never executed: embeddedMouseGrabber = receiver;
0
96 else-
97 receiver = embeddedMouseGrabber;
never executed: receiver = embeddedMouseGrabber;
0
98 break;
never executed: break;
0
99 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
100 type = QEvent::MouseMove;-
101 if (embeddedMouseGrabber
embeddedMouseGrabberDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
102 receiver = embeddedMouseGrabber;
never executed: receiver = embeddedMouseGrabber;
0
103 break;
never executed: break;
0
104 default
never executed: default:
:
never executed: default:
0
105 ((!(false)) ? qt_assert_x("QGraphicsProxyWidget", "internal error",__FILE__,288) : qt_noop());-
106 break;
never executed: break;
0
107 }-
108-
109 if (!lastWidgetUnderMouse
!lastWidgetUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
110 QApplicationPrivate::dispatchEnterLeave(embeddedMouseGrabber ? embeddedMouseGrabber : receiver, 0, event->screenPos());-
111 lastWidgetUnderMouse = receiver;-
112 }
never executed: end of block
0
113-
114-
115 pos = mapToReceiver(pos, receiver);-
116-
117-
118 QMouseEvent mouseEvent(type, pos, receiver->mapTo(receiver->topLevelWidget(), pos.toPoint()),-
119 receiver->mapToGlobal(pos.toPoint()),-
120 event->button(), event->buttons(), event->modifiers(), event->source());-
121-
122 QWidget *embeddedMouseGrabberPtr = (QWidget *)embeddedMouseGrabber;-
123 QApplicationPrivate::sendMouseEvent(receiver, &mouseEvent, alienWidget, widget,-
124 &embeddedMouseGrabberPtr, lastWidgetUnderMouse, event->spontaneous());-
125 embeddedMouseGrabber = embeddedMouseGrabberPtr;-
126-
127-
128-
129 if (embeddedMouseGrabber
embeddedMouseGrabberDescription
TRUEnever evaluated
FALSEnever evaluated
&& type == QEvent::MouseButtonRelease
type == QEvent...eButtonReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& !event->buttons()
!event->buttons()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 QGraphicsProxyWidget * const q = q_func();-
131 if (q->rect().contains(event->pos())
q->rect().cont...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
&& q->acceptHoverEvents()
q->acceptHoverEvents()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
132 lastWidgetUnderMouse = alienWidget
alienWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
? alienWidget : widget;
never executed: lastWidgetUnderMouse = alienWidget ? alienWidget : widget;
0
133 else-
134 lastWidgetUnderMouse = 0;
never executed: lastWidgetUnderMouse = 0;
0
135-
136 QApplicationPrivate::dispatchEnterLeave(lastWidgetUnderMouse, embeddedMouseGrabber, event->screenPos());-
137 embeddedMouseGrabber = 0;-
138-
139-
140-
141 if (!lastWidgetUnderMouse
!lastWidgetUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
142 q->unsetCursor();
never executed: q->unsetCursor();
0
143-
144 }
never executed: end of block
0
145-
146 event->setAccepted(mouseEvent.isAccepted());-
147}
never executed: end of block
0
148-
149void QGraphicsProxyWidgetPrivate::sendWidgetKeyEvent(QKeyEvent *event)-
150{-
151 QGraphicsProxyWidget * const q = q_func();-
152 if (!event
!eventDescription
TRUEnever evaluated
FALSEnever evaluated
|| !widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !widget->isVisible()
!widget->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
153 return;
never executed: return;
0
154-
155 QPointer<QWidget> receiver = widget->focusWidget();-
156 if (!receiver
!receiverDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
157 receiver = widget;
never executed: receiver = widget;
0
158 ((!(receiver)) ? qt_assert("receiver",__FILE__,341) : qt_noop());-
159-
160 do {-
161 bool res = QApplication::sendEvent(receiver, event);-
162 if ((res
resDescription
TRUEnever evaluated
FALSEnever evaluated
&& event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) || (q->isWindow()
q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& receiver == widget
receiver == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
163 break;
never executed: break;
0
164 receiver = receiver->parentWidget();-
165 }
never executed: end of block
while (receiver
receiverDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
166}
never executed: end of block
0
167-
168-
169-
170-
171void QGraphicsProxyWidgetPrivate::removeSubFocusHelper(QWidget *widget, Qt::FocusReason reason)-
172{-
173 QFocusEvent event(QEvent::FocusOut, reason);-
174 QPointer<QWidget> widgetGuard = widget;-
175 QApplication::sendEvent(widget, &event);-
176 if (widgetGuard
widgetGuardDescription
TRUEnever evaluated
FALSEnever evaluated
&& event.isAccepted()
event.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
177 QApplication::sendEvent(widget->style(), &event);
never executed: QApplication::sendEvent(widget->style(), &event);
0
178}
never executed: end of block
0
179-
180-
181-
182-
183-
184QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next) const-
185{-
186 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
187 return
never executed: return 0;
0;
never executed: return 0;
0
188-
189-
190 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
191 child = next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
? (QWidget *)widget : widget->d_func()->focus_prev;
0
192 }
never executed: end of block
else {
0
193 child = next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
? child->d_func()->focus_next : child->d_func()->focus_prev;
0
194 if ((next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
&& child == widget
child == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) || (!next
!nextDescription
TRUEnever evaluated
FALSEnever evaluated
&& child == widget->d_func()->focus_prev
child == widge...()->focus_prevDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
195 return
never executed: return 0;
0;
never executed: return 0;
0
196 }-
197 }
never executed: end of block
0
198-
199 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
200 return
never executed: return 0;
0;
never executed: return 0;
0
201-
202 QWidget *oldChild = child;-
203 uint focus_flag = qt_tab_all_widgets()
qt_tab_all_widgets()Description
TRUEnever evaluated
FALSEnever evaluated
? Qt::TabFocus : Qt::StrongFocus;
0
204 do {-
205 if (child->isEnabled()
child->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
206 && child->isVisibleTo(widget)
child->isVisibleTo(widget)Description
TRUEnever evaluated
FALSEnever evaluated
0
207 && ((
((child->focus...== focus_flag)Description
TRUEnever evaluated
FALSEnever evaluated
child->focusPolicy() & focus_flag) == focus_flag)
((child->focus...== focus_flag)Description
TRUEnever evaluated
FALSEnever evaluated
0
208 && !(child->d_func()->extra
child->d_func()->extraDescription
TRUEnever evaluated
FALSEnever evaluated
&& child->d_func()->extra->focus_proxy
child->d_func(...a->focus_proxyDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
209 return
never executed: return child;
child;
never executed: return child;
0
210 }-
211 child = next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
? child->d_func()->focus_next : child->d_func()->focus_prev;
0
212 }
never executed: end of block
while (child != oldChild
child != oldChildDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
&& child == widget
child == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) && !(!next
!nextDescription
TRUEnever evaluated
FALSEnever evaluated
&& child == widget->d_func()->focus_prev
child == widge...()->focus_prevDescription
TRUEnever evaluated
FALSEnever evaluated
));
0
213 return
never executed: return 0;
0;
never executed: return 0;
0
214}-
215-
216-
217-
218-
219void QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot()-
220{-
221 QGraphicsProxyWidget * const q = q_func();-
222 if (!widget.isNull()
!widget.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
223 if (QWExtra *extra = widget->d_func()->extra
QWExtra *extra..._func()->extraDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
224 extra->proxyWidget = 0;
never executed: extra->proxyWidget = 0;
0
225 }
never executed: end of block
0
226 widget = 0;-
227 delete q;-
228}
never executed: end of block
0
229-
230-
231-
232-
233void QGraphicsProxyWidgetPrivate::updateWidgetGeometryFromProxy()-
234{-
235}-
236-
237-
238-
239-
240void QGraphicsProxyWidgetPrivate::updateProxyGeometryFromWidget()-
241{-
242 QGraphicsProxyWidget * const q = q_func();-
243 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
244 return;
never executed: return;
0
245-
246 QRectF widgetGeometry = widget->geometry();-
247 QWidget *parentWidget = widget->parentWidget();-
248 if (widget->isWindow()
widget->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
249 QGraphicsProxyWidget *proxyParent = 0;-
250 if (parentWidget
parentWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(proxyParent =...rentWidget()))Description
TRUEnever evaluated
FALSEnever evaluated
proxyParent = qobject_cast<QGraphicsProxyWidget *>(q->parentWidget()))
(proxyParent =...rentWidget()))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
251-
252-
253-
254 widgetGeometry.moveTo(proxyParent->subWidgetRect(parentWidget).topLeft()-
255 + parentWidget->mapFromGlobal(widget->pos()));-
256 }
never executed: end of block
0
257 }
never executed: end of block
0
258-
259-
260 if (!widget->size().isValid()
!widget->size().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
261 widgetGeometry.setSize(widget->sizeHint());
never executed: widgetGeometry.setSize(widget->sizeHint());
0
262-
263-
264 posChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
265 sizeChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
266 q->setGeometry(widgetGeometry);-
267 posChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
268 sizeChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
269}
never executed: end of block
0
270-
271-
272-
273-
274void QGraphicsProxyWidgetPrivate::updateProxyInputMethodAcceptanceFromWidget()-
275{-
276 QGraphicsProxyWidget * const q = q_func();-
277 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
278 return;
never executed: return;
0
279-
280 QWidget *focusWidget = widget->focusWidget();-
281 if (!focusWidget
!focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
282 focusWidget = widget;
never executed: focusWidget = widget;
0
283 q->setFlag(QGraphicsItem::ItemAcceptsInputMethod,-
284 focusWidget->testAttribute(Qt::WA_InputMethodEnabled));-
285}
never executed: end of block
0
286void QGraphicsProxyWidgetPrivate::embedSubWindow(QWidget *subWin)-
287{-
288 QWExtra *extra;-
289 if (!((
(extra = subWi...func()->extra)Description
TRUEnever evaluated
FALSEnever evaluated
extra = subWin->d_func()->extra)
(extra = subWi...func()->extra)Description
TRUEnever evaluated
FALSEnever evaluated
&& extra->proxyWidget
extra->proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
290 QGraphicsProxyWidget *subProxy = new QGraphicsProxyWidget(q_func(), subWin->windowFlags());-
291 subProxy->d_func()->setWidget_helper(subWin, false);-
292 }
never executed: end of block
0
293}
never executed: end of block
0
294void QGraphicsProxyWidgetPrivate::unembedSubWindow(QWidget *subWin)-
295{-
296 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(children)>::type> _container_((children)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *child = *_container_.i; _container_.control; _container_.control = 0) {-
297 if (child->isWidget()
child->isWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
298 if (QGraphicsProxyWidget *proxy = qobject_cast<QGraphicsProxyWidget *>(static_cast<QGraphicsWidget *>(child))
QGraphicsProxy...get *>(child))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
299 if (proxy->widget() == subWin
proxy->widget() == subWinDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
300 proxy->setWidget(0);-
301 scene->removeItem(proxy);-
302 delete proxy;-
303 return;
never executed: return;
0
304 }-
305 }
never executed: end of block
0
306 }
never executed: end of block
0
307 }
never executed: end of block
0
308}
never executed: end of block
0
309-
310bool QGraphicsProxyWidgetPrivate::isProxyWidget() const-
311{-
312 return
never executed: return true;
true;
never executed: return true;
0
313}-
314-
315-
316-
317-
318QPointF QGraphicsProxyWidgetPrivate::mapToReceiver(const QPointF &pos, const QWidget *receiver) const-
319{-
320 QPointF p = pos;-
321-
322-
323 while (receiver
receiverDescription
TRUEnever evaluated
FALSEnever evaluated
&& receiver != widget
receiver != widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
324 p -= QPointF(receiver->pos());-
325 receiver = receiver->parentWidget();-
326 }
never executed: end of block
0
327 return
never executed: return p;
p;
never executed: return p;
0
328}-
329-
330-
331-
332-
333-
334QGraphicsProxyWidget::QGraphicsProxyWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags)-
335 : QGraphicsWidget(*new QGraphicsProxyWidgetPrivate, parent, wFlags)-
336{-
337 QGraphicsProxyWidgetPrivate * const d = d_func();-
338 d->init();-
339}
never executed: end of block
0
340-
341-
342-
343-
344QGraphicsProxyWidget::~QGraphicsProxyWidget()-
345{-
346 QGraphicsProxyWidgetPrivate * const d = d_func();-
347 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
348 d->widget->removeEventFilter(this);-
349 QObject::disconnect(d->widget, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "548"), this, qFlagLocation("1""_q_removeWidgetSlot()" "\0" __FILE__ ":" "548"));-
350 delete d->widget;-
351 }
never executed: end of block
0
352}
never executed: end of block
0
353void QGraphicsProxyWidget::setWidget(QWidget *widget)-
354{-
355 QGraphicsProxyWidgetPrivate * const d = d_func();-
356 d->setWidget_helper(widget, true);-
357}
never executed: end of block
0
358-
359void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool autoShow)-
360{-
361 QGraphicsProxyWidget * const q = q_func();-
362 if (newWidget == widget
newWidget == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
363 return;
never executed: return;
0
364 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
365 QObject::disconnect(widget, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "597"), q, qFlagLocation("1""_q_removeWidgetSlot()" "\0" __FILE__ ":" "597"));-
366 widget->removeEventFilter(q);-
367 widget->setAttribute(Qt::WA_DontShowOnScreen, false);-
368 widget->d_func()->extra->proxyWidget = 0;-
369 resolveFont(inheritedFontResolveMask);-
370 resolvePalette(inheritedPaletteResolveMask);-
371 widget->update();-
372-
373 const auto childItems = q->childItems();-
374 for (QGraphicsItem *child : childItems) {-
375 if (child->d_ptr->isProxyWidget()
child->d_ptr->isProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
376 QGraphicsProxyWidget *childProxy = static_cast<QGraphicsProxyWidget *>(child);-
377 QWidget * parent = childProxy->widget();-
378 while (parent->parentWidget() != 0
parent->parentWidget() != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
379 if (parent == widget
parent == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
380 break;
never executed: break;
0
381 parent = parent->parentWidget();-
382 }
never executed: end of block
0
383 if (!childProxy->widget()
!childProxy->widget()Description
TRUEnever evaluated
FALSEnever evaluated
|| parent != widget
parent != widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
384 continue;
never executed: continue;
0
385 childProxy->setWidget(0);-
386 delete childProxy;-
387 }
never executed: end of block
0
388 }
never executed: end of block
0
389-
390 widget = 0;-
391-
392 q->unsetCursor();-
393-
394 q->setAcceptHoverEvents(false);-
395 if (!newWidget
!newWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
396 q->update();
never executed: q->update();
0
397 }
never executed: end of block
0
398 if (!newWidget
!newWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
399 return;
never executed: return;
0
400 if (!newWidget->isWindow()
!newWidget->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
401 QWExtra *extra = newWidget->parentWidget()->d_func()->extra;-
402 if (!extra
!extraDescription
TRUEnever evaluated
FALSEnever evaluated
|| !extra->proxyWidget
!extra->proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
403 QMessageLogger(__FILE__, 635, __PRETTY_FUNCTION__).warning("QGraphicsProxyWidget::setWidget: cannot embed widget %p "-
404 "which is not a toplevel widget, and is not a child of an embedded widget", newWidget);-
405 return;
never executed: return;
0
406 }-
407 }
never executed: end of block
0
408-
409-
410-
411 QWExtra *extra = newWidget->d_func()->extra;-
412 if (!extra
!extraDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
413 newWidget->d_func()->createExtra();-
414 extra = newWidget->d_func()->extra;-
415 }
never executed: end of block
0
416 QGraphicsProxyWidget **proxyWidget = &extra->proxyWidget;-
417 if (*
*proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
proxyWidget
*proxyWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
418 if (*
*proxyWidget != qDescription
TRUEnever evaluated
FALSEnever evaluated
proxyWidget != q
*proxyWidget != qDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
419 QMessageLogger(__FILE__, 651, __PRETTY_FUNCTION__).warning("QGraphicsProxyWidget::setWidget: cannot embed widget %p"-
420 "; already embedded", newWidget);-
421 }
never executed: end of block
0
422 return;
never executed: return;
0
423 }-
424 *proxyWidget = q;-
425-
426 newWidget->setAttribute(Qt::WA_DontShowOnScreen);-
427 newWidget->ensurePolished();-
428-
429-
430 newWidget->setAttribute(Qt::WA_QuitOnClose, false);-
431 q->setAcceptHoverEvents(true);-
432-
433 if (newWidget->testAttribute(Qt::WA_NoSystemBackground)
newWidget->tes...temBackground)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
434 q->setAttribute(Qt::WA_NoSystemBackground);
never executed: q->setAttribute(Qt::WA_NoSystemBackground);
0
435 if (newWidget->testAttribute(Qt::WA_OpaquePaintEvent)
newWidget->tes...quePaintEvent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
436 q->setAttribute(Qt::WA_OpaquePaintEvent);
never executed: q->setAttribute(Qt::WA_OpaquePaintEvent);
0
437-
438 widget = newWidget;-
439-
440-
441 enabledChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
442 visibleChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
443 posChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
444 sizeChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
445-
446 if ((autoShow
autoShowDescription
TRUEnever evaluated
FALSEnever evaluated
&& !newWidget->testAttribute(Qt::WA_WState_ExplicitShowHide)
!newWidget->te...licitShowHide)Description
TRUEnever evaluated
FALSEnever evaluated
) || !newWidget->testAttribute(Qt::WA_WState_Hidden)
!newWidget->te...WState_Hidden)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
447 newWidget->show();-
448 }
never executed: end of block
0
449-
450-
451-
452 if (newWidget->testAttribute(Qt::WA_SetCursor)
newWidget->tes...:WA_SetCursor)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
453 q->setCursor(widget->cursor());
never executed: q->setCursor(widget->cursor());
0
454-
455 q->setEnabled(newWidget->isEnabled());-
456 q->setVisible(newWidget->isVisible());-
457 q->setLayoutDirection(newWidget->layoutDirection());-
458 if (newWidget->testAttribute(Qt::WA_SetStyle)
newWidget->tes...::WA_SetStyle)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
459 q->setStyle(widget->style());
never executed: q->setStyle(widget->style());
0
460-
461 resolveFont(inheritedFontResolveMask);-
462 resolvePalette(inheritedPaletteResolveMask);-
463-
464 if (!newWidget->testAttribute(Qt::WA_Resized)
!newWidget->te...t::WA_Resized)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
465 newWidget->adjustSize();
never executed: newWidget->adjustSize();
0
466-
467 int left, top, right, bottom;-
468 newWidget->getContentsMargins(&left, &top, &right, &bottom);-
469 q->setContentsMargins(left, top, right, bottom);-
470 q->setWindowTitle(newWidget->windowTitle());-
471-
472-
473 q->setSizePolicy(newWidget->sizePolicy());-
474 QSize sz = newWidget->minimumSize();-
475 q->setMinimumSize(sz.isNull() ? QSizeF() : QSizeF(sz));-
476 sz = newWidget->maximumSize();-
477 q->setMaximumSize(sz.isNull() ? QSizeF() : QSizeF(sz));-
478-
479 updateProxyGeometryFromWidget();-
480-
481 updateProxyInputMethodAcceptanceFromWidget();-
482-
483-
484 newWidget->installEventFilter(q);-
485 QObject::connect(newWidget, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "717"), q, qFlagLocation("1""_q_removeWidgetSlot()" "\0" __FILE__ ":" "717"));-
486-
487-
488 enabledChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
489 visibleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
490 posChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
491 sizeChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
492}
never executed: end of block
0
493-
494-
495-
496-
497-
498-
499QWidget *QGraphicsProxyWidget::widget() const-
500{-
501 const QGraphicsProxyWidgetPrivate * const d = d_func();-
502 return
never executed: return d->widget;
d->widget;
never executed: return d->widget;
0
503}-
504QRectF QGraphicsProxyWidget::subWidgetRect(const QWidget *widget) const-
505{-
506 const QGraphicsProxyWidgetPrivate * const d = d_func();-
507 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
508 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
509 if (d->widget == widget
d->widget == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->widget->isAncestorOf(widget)
d->widget->isA...storOf(widget)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
510 return
never executed: return QRectF(widget->mapTo(d->widget, QPoint(0, 0)), widget->size());
QRectF(widget->mapTo(d->widget, QPoint(0, 0)), widget->size());
never executed: return QRectF(widget->mapTo(d->widget, QPoint(0, 0)), widget->size());
0
511 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
512}-
513-
514-
515-
516-
517void QGraphicsProxyWidget::setGeometry(const QRectF &rect)-
518{-
519 QGraphicsProxyWidgetPrivate * const d = d_func();-
520 bool proxyResizesWidget = !d->posChangeMode
!d->posChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->sizeChangeMode
!d->sizeChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
521 if (proxyResizesWidget
proxyResizesWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
522 d->posChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;-
523 d->sizeChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;-
524 }
never executed: end of block
0
525 QGraphicsWidget::setGeometry(rect);-
526 if (proxyResizesWidget
proxyResizesWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
527 d->posChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
528 d->sizeChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
529 }
never executed: end of block
0
530}
never executed: end of block
0
531-
532-
533-
534-
535QVariant QGraphicsProxyWidget::itemChange(GraphicsItemChange change,-
536 const QVariant &value)-
537{-
538 QGraphicsProxyWidgetPrivate * const d = d_func();-
539-
540 switch (change) {-
541 case
never executed: case ItemPositionChange:
ItemPositionChange:
never executed: case ItemPositionChange:
0
542-
543-
544-
545 if (!d->posChangeMode
!d->posChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
546 d->posChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
never executed: d->posChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
0
547 break;
never executed: break;
0
548 case
never executed: case ItemPositionHasChanged:
ItemPositionHasChanged:
never executed: case ItemPositionHasChanged:
0
549-
550-
551 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->posChangeMode != QGraphicsProxyWidgetPrivate::WidgetToProxyMode
d->posChangeMo...getToProxyModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
552 d->widget->move(value.toPoint());
never executed: d->widget->move(value.toPoint());
0
553 if (d->posChangeMode == QGraphicsProxyWidgetPrivate::ProxyToWidgetMode
d->posChangeMo...xyToWidgetModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
554 d->posChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
never executed: d->posChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
0
555 break;
never executed: break;
0
556 case
never executed: case ItemVisibleChange:
ItemVisibleChange:
never executed: case ItemVisibleChange:
0
557 if (!d->visibleChangeMode
!d->visibleChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
558 d->visibleChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
never executed: d->visibleChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
0
559 break;
never executed: break;
0
560 case
never executed: case ItemVisibleHasChanged:
ItemVisibleHasChanged:
never executed: case ItemVisibleHasChanged:
0
561 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->visibleChangeMode != QGraphicsProxyWidgetPrivate::WidgetToProxyMode
d->visibleChan...getToProxyModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
562 d->widget->setVisible(isVisible());
never executed: d->widget->setVisible(isVisible());
0
563 if (d->visibleChangeMode == QGraphicsProxyWidgetPrivate::ProxyToWidgetMode
d->visibleChan...xyToWidgetModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
564 d->visibleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
never executed: d->visibleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
0
565 break;
never executed: break;
0
566 case
never executed: case ItemEnabledChange:
ItemEnabledChange:
never executed: case ItemEnabledChange:
0
567 if (!d->enabledChangeMode
!d->enabledChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
568 d->enabledChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
never executed: d->enabledChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
0
569 break;
never executed: break;
0
570 case
never executed: case ItemEnabledHasChanged:
ItemEnabledHasChanged:
never executed: case ItemEnabledHasChanged:
0
571 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->enabledChangeMode != QGraphicsProxyWidgetPrivate::WidgetToProxyMode
d->enabledChan...getToProxyModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
572 d->widget->setEnabled(isEnabled());
never executed: d->widget->setEnabled(isEnabled());
0
573 if (d->enabledChangeMode == QGraphicsProxyWidgetPrivate::ProxyToWidgetMode
d->enabledChan...xyToWidgetModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
574 d->enabledChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
never executed: d->enabledChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
0
575 break;
never executed: break;
0
576 default
never executed: default:
:
never executed: default:
0
577 break;
never executed: break;
0
578 }-
579 return
never executed: return QGraphicsWidget::itemChange(change, value);
QGraphicsWidget::itemChange(change, value);
never executed: return QGraphicsWidget::itemChange(change, value);
0
580}-
581-
582-
583-
584-
585bool QGraphicsProxyWidget::event(QEvent *event)-
586{-
587 QGraphicsProxyWidgetPrivate * const d = d_func();-
588 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
589 return
never executed: return QGraphicsWidget::event(event);
QGraphicsWidget::event(event);
never executed: return QGraphicsWidget::event(event);
0
590-
591 switch (event->type()) {-
592 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
593-
594 if (!d->styleChangeMode
!d->styleChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
595 d->styleChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;-
596 d->widget->setStyle(style());-
597 d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
598 }
never executed: end of block
0
599 break;
never executed: break;
0
600 case
never executed: case QEvent::FontChange:
QEvent::FontChange:
never executed: case QEvent::FontChange:
{
0
601-
602 QWidgetPrivate *wd = d->widget->d_func();-
603 int mask = d->font.resolve() | d->inheritedFontResolveMask;-
604 wd->inheritedFontResolveMask = mask;-
605 wd->resolveFont();-
606 break;
never executed: break;
0
607 }-
608 case
never executed: case QEvent::PaletteChange:
QEvent::PaletteChange:
never executed: case QEvent::PaletteChange:
{
0
609-
610 QWidgetPrivate *wd = d->widget->d_func();-
611 int mask = d->palette.resolve() | d->inheritedPaletteResolveMask;-
612 wd->inheritedPaletteResolveMask = mask;-
613 wd->resolvePalette();-
614 break;
never executed: break;
0
615 }-
616 case
never executed: case QEvent::InputMethod:
QEvent::InputMethod:
never executed: case QEvent::InputMethod:
{
0
617 inputMethodEvent(static_cast<QInputMethodEvent *>(event));-
618 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
619 return
never executed: return true;
true;
never executed: return true;
0
620 return
never executed: return false;
false;
never executed: return false;
0
621 }-
622 case
never executed: case QEvent::ShortcutOverride:
QEvent::ShortcutOverride:
never executed: case QEvent::ShortcutOverride:
{
0
623 QWidget *focusWidget = d->widget->focusWidget();-
624 while (focusWidget
focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
625 QApplication::sendEvent(focusWidget, event);-
626 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
627 return
never executed: return true;
true;
never executed: return true;
0
628 focusWidget = focusWidget->parentWidget();-
629 }
never executed: end of block
0
630 return
never executed: return false;
false;
never executed: return false;
0
631 }-
632 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
{
0
633 QKeyEvent *k = static_cast<QKeyEvent *>(event);-
634 if (k->key() == Qt::Key_Tab
k->key() == Qt::Key_TabDescription
TRUEnever evaluated
FALSEnever evaluated
|| k->key() == Qt::Key_Backtab
k->key() == Qt::Key_BacktabDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
635 if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))
!(k->modifiers...:AltModifier))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
636 QWidget *focusWidget = d->widget->focusWidget();-
637 while (focusWidget
focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
638 bool res = QApplication::sendEvent(focusWidget, event);-
639 if ((res
resDescription
TRUEnever evaluated
FALSEnever evaluated
&& event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) || (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& focusWidget == d->widget
focusWidget == d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
640 event->accept();-
641 break;
never executed: break;
0
642 }-
643 focusWidget = focusWidget->parentWidget();-
644 }
never executed: end of block
0
645 return
never executed: return true;
true;
never executed: return true;
0
646 }-
647 }
never executed: end of block
0
648 break;
never executed: break;
0
649 }-
650-
651 case
never executed: case QEvent::GraphicsSceneHelp:
QEvent::GraphicsSceneHelp:
never executed: case QEvent::GraphicsSceneHelp:
{
0
652-
653 if (d->lastWidgetUnderMouse
d->lastWidgetUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
654 QGraphicsSceneHelpEvent *he = static_cast<QGraphicsSceneHelpEvent *>(event);-
655 QPoint pos = d->mapToReceiver(mapFromScene(he->scenePos()), d->lastWidgetUnderMouse).toPoint();-
656 QHelpEvent e(QEvent::ToolTip, pos, he->screenPos());-
657 QApplication::sendEvent(d->lastWidgetUnderMouse, &e);-
658 event->setAccepted(e.isAccepted());-
659 return
never executed: return e.isAccepted();
e.isAccepted();
never executed: return e.isAccepted();
0
660 }-
661 break;
never executed: break;
0
662 }-
663 case
never executed: case QEvent::ToolTipChange:
QEvent::ToolTipChange:
never executed: case QEvent::ToolTipChange:
{
0
664-
665 if (!d->tooltipChangeMode
!d->tooltipChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
666 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;-
667 d->widget->setToolTip(toolTip());-
668 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
669 }
never executed: end of block
0
670 break;
never executed: break;
0
671 }-
672-
673 case
never executed: case QEvent::TouchBegin:
QEvent::TouchBegin:
never executed: case QEvent::TouchBegin:
0
674 case
never executed: case QEvent::TouchUpdate:
QEvent::TouchUpdate:
never executed: case QEvent::TouchUpdate:
0
675 case
never executed: case QEvent::TouchEnd:
QEvent::TouchEnd:
never executed: case QEvent::TouchEnd:
{
0
676 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
677 qt_sendSpontaneousEvent(d->widget, event);
never executed: qt_sendSpontaneousEvent(d->widget, event);
0
678 else-
679 QApplication::sendEvent(d->widget, event);
never executed: QApplication::sendEvent(d->widget, event);
0
680-
681 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
682 return
never executed: return true;
true;
never executed: return true;
0
683-
684 break;
never executed: break;
0
685 }-
686 default
never executed: default:
:
never executed: default:
0
687 break;
never executed: break;
0
688 }-
689 return
never executed: return QGraphicsWidget::event(event);
QGraphicsWidget::event(event);
never executed: return QGraphicsWidget::event(event);
0
690}-
691-
692-
693-
694-
695bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event)-
696{-
697 QGraphicsProxyWidgetPrivate * const d = d_func();-
698-
699 if (object == d->widget
object == d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
700 switch (event->type()) {-
701 case
never executed: case QEvent::LayoutRequest:
QEvent::LayoutRequest:
never executed: case QEvent::LayoutRequest:
0
702 updateGeometry();-
703 break;
never executed: break;
0
704 case
never executed: case QEvent::Resize:
QEvent::Resize:
never executed: case QEvent::Resize:
0
705-
706-
707 if (!d->sizeChangeMode
!d->sizeChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
708 d->updateProxyGeometryFromWidget();
never executed: d->updateProxyGeometryFromWidget();
0
709 break;
never executed: break;
0
710 case
never executed: case QEvent::Move:
QEvent::Move:
never executed: case QEvent::Move:
0
711-
712-
713 if (!d->posChangeMode
!d->posChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
714 d->updateProxyGeometryFromWidget();
never executed: d->updateProxyGeometryFromWidget();
0
715 break;
never executed: break;
0
716 case
never executed: case QEvent::Hide:
QEvent::Hide:
never executed: case QEvent::Hide:
0
717 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
0
718-
719 if (!d->visibleChangeMode
!d->visibleChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
720 d->visibleChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
721 setVisible(event->type() == QEvent::Show);-
722 d->visibleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
723 }
never executed: end of block
0
724 break;
never executed: break;
0
725 case
never executed: case QEvent::EnabledChange:
QEvent::EnabledChange:
never executed: case QEvent::EnabledChange:
0
726-
727 if (!d->enabledChangeMode
!d->enabledChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
728 d->enabledChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
729 setEnabled(d->widget->isEnabled());-
730 d->enabledChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
731 }
never executed: end of block
0
732 break;
never executed: break;
0
733 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
734-
735 if (!d->styleChangeMode
!d->styleChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
736 d->styleChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
737 setStyle(d->widget->style());-
738 d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
739 }
never executed: end of block
0
740 break;
never executed: break;
0
741-
742 case
never executed: case QEvent::ToolTipChange:
QEvent::ToolTipChange:
never executed: case QEvent::ToolTipChange:
0
743-
744 if (!d->tooltipChangeMode
!d->tooltipChangeModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
745 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;-
746 setToolTip(d->widget->toolTip());-
747 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode;-
748 }
never executed: end of block
0
749 break;
never executed: break;
0
750-
751 default
never executed: default:
:
never executed: default:
0
752 break;
never executed: break;
0
753 }-
754 }-
755 return
never executed: return QGraphicsWidget::eventFilter(object, event);
QGraphicsWidget::eventFilter(object, event);
never executed: return QGraphicsWidget::eventFilter(object, event);
0
756}-
757-
758-
759-
760-
761void QGraphicsProxyWidget::showEvent(QShowEvent *event)-
762{-
763 (void)event;;-
764}
never executed: end of block
0
765-
766-
767-
768-
769void QGraphicsProxyWidget::hideEvent(QHideEvent *event)-
770{-
771 (void)event;;-
772}
never executed: end of block
0
773-
774-
775-
776-
777-
778void QGraphicsProxyWidget::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)-
779{-
780 QGraphicsProxyWidgetPrivate * const d = d_func();-
781 if (!event
!eventDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->widget->isVisible()
!d->widget->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| !hasFocus()
!hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
782 return;
never executed: return;
0
783-
784-
785 QPointF pos = event->pos();-
786 QPointer<QWidget> alienWidget = d->widget->childAt(pos.toPoint());-
787 QPointer<QWidget> receiver = alienWidget
alienWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
? alienWidget : d->widget;
0
788-
789-
790 pos = d->mapToReceiver(pos, receiver);-
791-
792 QPoint globalPos = receiver->mapToGlobal(pos.toPoint());-
793-
794-
795-
796-
797-
798 if (bypassGraphicsProxyWidget(receiver)
bypassGraphics...dget(receiver)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
799 globalPos = event->screenPos();
never executed: globalPos = event->screenPos();
0
800-
801-
802 QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()),-
803 pos.toPoint(), globalPos, event->modifiers());-
804 QApplication::sendEvent(receiver, &contextMenuEvent);-
805-
806 event->setAccepted(contextMenuEvent.isAccepted());-
807}
never executed: end of block
0
808-
809-
810-
811-
812-
813-
814void QGraphicsProxyWidget::dragEnterEvent(QGraphicsSceneDragDropEvent *event)-
815{-
816-
817-
818-
819 QGraphicsProxyWidgetPrivate * const d = d_func();-
820 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
821 return;
never executed: return;
0
822-
823 QDragEnterEvent proxyDragEnter(event->pos().toPoint(), event->dropAction(), event->mimeData(), event->buttons(), event->modifiers());-
824 proxyDragEnter.setAccepted(event->isAccepted());-
825 QApplication::sendEvent(d->widget, &proxyDragEnter);-
826 event->setAccepted(proxyDragEnter.isAccepted());-
827 if (proxyDragEnter.isAccepted()
proxyDragEnter.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
828 event->setDropAction(proxyDragEnter.dropAction());
never executed: event->setDropAction(proxyDragEnter.dropAction());
0
829-
830}
never executed: end of block
0
831-
832-
833-
834void QGraphicsProxyWidget::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)-
835{-
836 (void)event;;-
837-
838 QGraphicsProxyWidgetPrivate * const d = d_func();-
839 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->dragDropWidget
!d->dragDropWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
840 return;
never executed: return;
0
841 QDragLeaveEvent proxyDragLeave;-
842 QApplication::sendEvent(d->dragDropWidget, &proxyDragLeave);-
843 d->dragDropWidget = 0;-
844-
845}
never executed: end of block
0
846-
847-
848-
849-
850void QGraphicsProxyWidget::dragMoveEvent(QGraphicsSceneDragDropEvent *event)-
851{-
852-
853-
854-
855 QGraphicsProxyWidgetPrivate * const d = d_func();-
856 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
857 return;
never executed: return;
0
858 QPointF p = event->pos();-
859 event->ignore();-
860 QPointer<QWidget> subWidget = d->widget->childAt(p.toPoint());-
861 QPointer<QWidget> receiver = subWidget
subWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
? subWidget : d->widget;
0
862 bool eventDelivered = false;-
863 for (; receiver
receiverDescription
TRUEnever evaluated
FALSEnever evaluated
; receiver = receiver->parentWidget()) {
0
864 if (!receiver->isEnabled()
!receiver->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
|| !receiver->acceptDrops()
!receiver->acceptDrops()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
865 continue;
never executed: continue;
0
866-
867 QPoint receiverPos = d->mapToReceiver(p, receiver).toPoint();-
868 if (receiver != d->dragDropWidget
receiver != d->dragDropWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
869-
870 QDragEnterEvent dragEnter(receiverPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());-
871 dragEnter.setDropAction(event->proposedAction());-
872 QApplication::sendEvent(receiver, &dragEnter);-
873 event->setAccepted(dragEnter.isAccepted());-
874 event->setDropAction(dragEnter.dropAction());-
875 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
876-
877 continue;
never executed: continue;
0
878 }-
879-
880 d->lastDropAction = event->dropAction();-
881-
882 if (d->dragDropWidget
d->dragDropWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
883 QDragLeaveEvent dragLeave;-
884 QApplication::sendEvent(d->dragDropWidget, &dragLeave);-
885 }
never executed: end of block
0
886 d->dragDropWidget = receiver;-
887 }
never executed: end of block
0
888-
889 QDragMoveEvent dragMove(receiverPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());-
890 event->setDropAction(d->lastDropAction);-
891 QApplication::sendEvent(receiver, &dragMove);-
892 event->setAccepted(dragMove.isAccepted());-
893 event->setDropAction(dragMove.dropAction());-
894 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
895 d->lastDropAction = event->dropAction();
never executed: d->lastDropAction = event->dropAction();
0
896 eventDelivered = true;-
897 break;
never executed: break;
0
898 }-
899-
900 if (!eventDelivered
!eventDeliveredDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
901 if (d->dragDropWidget
d->dragDropWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
902-
903 QDragLeaveEvent dragLeave;-
904 QApplication::sendEvent(d->dragDropWidget, &dragLeave);-
905 d->dragDropWidget = 0;-
906 }
never executed: end of block
0
907-
908 event->setDropAction(Qt::IgnoreAction);-
909 }
never executed: end of block
0
910-
911}
never executed: end of block
0
912-
913-
914-
915-
916void QGraphicsProxyWidget::dropEvent(QGraphicsSceneDragDropEvent *event)-
917{-
918-
919-
920-
921 QGraphicsProxyWidgetPrivate * const d = d_func();-
922 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->dragDropWidget
d->dragDropWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
923 QPoint widgetPos = d->mapToReceiver(event->pos(), d->dragDropWidget).toPoint();-
924 QDropEvent dropEvent(widgetPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());-
925 QApplication::sendEvent(d->dragDropWidget, &dropEvent);-
926 event->setAccepted(dropEvent.isAccepted());-
927 d->dragDropWidget = 0;-
928 }
never executed: end of block
0
929-
930}
never executed: end of block
0
931-
932-
933-
934-
935-
936void QGraphicsProxyWidget::hoverEnterEvent(QGraphicsSceneHoverEvent *event)-
937{-
938 (void)event;;-
939}
never executed: end of block
0
940-
941-
942-
943-
944void QGraphicsProxyWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)-
945{-
946 (void)event;;-
947 QGraphicsProxyWidgetPrivate * const d = d_func();-
948-
949 if (d->lastWidgetUnderMouse
d->lastWidgetUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
950 QApplicationPrivate::dispatchEnterLeave(0, d->lastWidgetUnderMouse, event->screenPos());-
951 d->lastWidgetUnderMouse = 0;-
952 }
never executed: end of block
0
953}
never executed: end of block
0
954-
955-
956-
957-
958void QGraphicsProxyWidget::hoverMoveEvent(QGraphicsSceneHoverEvent *event)-
959{-
960 QGraphicsProxyWidgetPrivate * const d = d_func();-
961-
962-
963-
964-
965 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !rect().contains(event->pos())
!rect().contains(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
966 if (d->lastWidgetUnderMouse
d->lastWidgetUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
967 QApplicationPrivate::dispatchEnterLeave(0, d->lastWidgetUnderMouse, event->screenPos());-
968 d->lastWidgetUnderMouse = 0;-
969 }
never executed: end of block
0
970 return;
never executed: return;
0
971 }-
972-
973 d->embeddedMouseGrabber = 0;-
974 d->sendWidgetMouseEvent(event);-
975}
never executed: end of block
0
976-
977-
978-
979-
980void QGraphicsProxyWidget::grabMouseEvent(QEvent *event)-
981{-
982 (void)event;;-
983}
never executed: end of block
0
984-
985-
986-
987-
988void QGraphicsProxyWidget::ungrabMouseEvent(QEvent *event)-
989{-
990 QGraphicsProxyWidgetPrivate * const d = d_func();-
991 (void)event;;-
992 d->embeddedMouseGrabber = 0;-
993}
never executed: end of block
0
994-
995-
996-
997-
998void QGraphicsProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)-
999{-
1000 QGraphicsProxyWidgetPrivate * const d = d_func();-
1001-
1002-
1003-
1004 d->sendWidgetMouseEvent(event);-
1005}
never executed: end of block
0
1006-
1007-
1008-
1009-
1010void QGraphicsProxyWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)-
1011{-
1012 QGraphicsProxyWidgetPrivate * const d = d_func();-
1013-
1014-
1015-
1016 d->sendWidgetMouseEvent(event);-
1017}
never executed: end of block
0
1018-
1019-
1020-
1021-
1022void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)-
1023{-
1024 QGraphicsProxyWidgetPrivate * const d = d_func();-
1025-
1026-
1027-
1028 d->sendWidgetMouseEvent(event);-
1029}
never executed: end of block
0
1030-
1031-
1032-
1033-
1034-
1035void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)-
1036{-
1037 QGraphicsProxyWidgetPrivate * const d = d_func();-
1038-
1039-
1040-
1041 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1042 return;
never executed: return;
0
1043-
1044 QPointF pos = event->pos();-
1045 QPointer<QWidget> receiver = d->widget->childAt(pos.toPoint());-
1046 if (!receiver
!receiverDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1047 receiver = d->widget;
never executed: receiver = d->widget;
0
1048-
1049-
1050 pos = d->mapToReceiver(pos, receiver);-
1051-
1052-
1053 QWheelEvent wheelEvent(pos.toPoint(), event->screenPos(), event->delta(),-
1054 event->buttons(), event->modifiers(), event->orientation());-
1055 QPointer<QWidget> focusWidget = d->widget->focusWidget();-
1056 extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);-
1057 qt_sendSpontaneousEvent(receiver, &wheelEvent);-
1058 event->setAccepted(wheelEvent.isAccepted());-
1059-
1060-
1061 if (focusWidget
focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& !focusWidget->hasFocus()
!focusWidget->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1062 focusWidget->update();-
1063 focusWidget = d->widget->focusWidget();-
1064 if (focusWidget
focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& focusWidget->hasFocus()
focusWidget->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1065 focusWidget->update();
never executed: focusWidget->update();
0
1066 }
never executed: end of block
0
1067}
never executed: end of block
0
1068-
1069-
1070-
1071-
1072-
1073void QGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)-
1074{-
1075 QGraphicsProxyWidgetPrivate * const d = d_func();-
1076-
1077-
1078-
1079 d->sendWidgetMouseEvent(event);-
1080}
never executed: end of block
0
1081-
1082-
1083-
1084-
1085void QGraphicsProxyWidget::keyPressEvent(QKeyEvent *event)-
1086{-
1087 QGraphicsProxyWidgetPrivate * const d = d_func();-
1088-
1089-
1090-
1091 d->sendWidgetKeyEvent(event);-
1092}
never executed: end of block
0
1093-
1094-
1095-
1096-
1097void QGraphicsProxyWidget::keyReleaseEvent(QKeyEvent *event)-
1098{-
1099 QGraphicsProxyWidgetPrivate * const d = d_func();-
1100-
1101-
1102-
1103 d->sendWidgetKeyEvent(event);-
1104}
never executed: end of block
0
1105-
1106-
1107-
1108-
1109void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)-
1110{-
1111-
1112-
1113-
1114 QGraphicsProxyWidgetPrivate * const d = d_func();-
1115-
1116 if (d->focusFromWidgetToProxy
d->focusFromWidgetToProxyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1117-
1118-
1119-
1120 return;
never executed: return;
0
1121 }-
1122-
1123 d->proxyIsGivingFocus = true;-
1124-
1125 switch (event->reason()) {-
1126 case
never executed: case Qt::TabFocusReason:
Qt::TabFocusReason:
never executed: case Qt::TabFocusReason:
{
0
1127 if (QWidget *focusChild = d->findFocusChild(0, true)
QWidget *focus...Child(0, true)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1128 focusChild->setFocus(event->reason());
never executed: focusChild->setFocus(event->reason());
0
1129 break;
never executed: break;
0
1130 }-
1131 case
never executed: case Qt::BacktabFocusReason:
Qt::BacktabFocusReason:
never executed: case Qt::BacktabFocusReason:
0
1132 if (QWidget *focusChild = d->findFocusChild(0, false)
QWidget *focus...hild(0, false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1133 focusChild->setFocus(event->reason());
never executed: focusChild->setFocus(event->reason());
0
1134 break;
never executed: break;
0
1135 default
never executed: default:
:
never executed: default:
0
1136 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->widget->focusWidget()
d->widget->focusWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1137 d->widget->focusWidget()->setFocus(event->reason());-
1138 }
never executed: end of block
0
1139 break;
never executed: break;
0
1140 }-
1141-
1142 d->proxyIsGivingFocus = false;-
1143}
never executed: end of block
0
1144-
1145-
1146-
1147-
1148void QGraphicsProxyWidget::focusOutEvent(QFocusEvent *event)-
1149{-
1150-
1151-
1152-
1153 QGraphicsProxyWidgetPrivate * const d = d_func();-
1154 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1155-
1156-
1157 if (QWidget *focusWidget = d->widget->focusWidget()
QWidget *focus...>focusWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1158 d->removeSubFocusHelper(focusWidget, event->reason());
never executed: d->removeSubFocusHelper(focusWidget, event->reason());
0
1159 }
never executed: end of block
0
1160}
never executed: end of block
0
1161-
1162-
1163-
1164-
1165bool QGraphicsProxyWidget::focusNextPrevChild(bool next)-
1166{-
1167 QGraphicsProxyWidgetPrivate * const d = d_func();-
1168 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1169 return
never executed: return QGraphicsWidget::focusNextPrevChild(next);
QGraphicsWidget::focusNextPrevChild(next);
never executed: return QGraphicsWidget::focusNextPrevChild(next);
0
1170-
1171 Qt::FocusReason reason = next
nextDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::TabFocusReason : Qt::BacktabFocusReason;
0
1172 QWidget *lastFocusChild = d->widget->focusWidget();-
1173 if (QWidget *newFocusChild = d->findFocusChild(lastFocusChild, next)
QWidget *newFo...usChild, next)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1174 newFocusChild->setFocus(reason);-
1175 return
never executed: return true;
true;
never executed: return true;
0
1176 }-
1177-
1178 return
never executed: return QGraphicsWidget::focusNextPrevChild(next);
QGraphicsWidget::focusNextPrevChild(next);
never executed: return QGraphicsWidget::focusNextPrevChild(next);
0
1179}-
1180-
1181-
1182-
1183-
1184QVariant QGraphicsProxyWidget::inputMethodQuery(Qt::InputMethodQuery query) const-
1185{-
1186 const QGraphicsProxyWidgetPrivate * const d = d_func();-
1187-
1188 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !hasFocus()
!hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1189 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
1190-
1191 QWidget *focusWidget = widget()->focusWidget();-
1192 if (!focusWidget
!focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1193 focusWidget = d->widget;
never executed: focusWidget = d->widget;
0
1194 QVariant v = focusWidget->inputMethodQuery(query);-
1195 QPointF focusWidgetPos = subWidgetRect(focusWidget).topLeft();-
1196 switch (v.type()) {-
1197 case
never executed: case QVariant::RectF:
QVariant::RectF:
never executed: case QVariant::RectF:
0
1198 v = v.toRectF().translated(focusWidgetPos);-
1199 break;
never executed: break;
0
1200 case
never executed: case QVariant::PointF:
QVariant::PointF:
never executed: case QVariant::PointF:
0
1201 v = v.toPointF() + focusWidgetPos;-
1202 break;
never executed: break;
0
1203 case
never executed: case QVariant::Rect:
QVariant::Rect:
never executed: case QVariant::Rect:
0
1204 v = v.toRect().translated(focusWidgetPos.toPoint());-
1205 break;
never executed: break;
0
1206 case
never executed: case QVariant::Point:
QVariant::Point:
never executed: case QVariant::Point:
0
1207 v = v.toPoint() + focusWidgetPos.toPoint();-
1208 break;
never executed: break;
0
1209 default
never executed: default:
:
never executed: default:
0
1210 break;
never executed: break;
0
1211 }-
1212 return
never executed: return v;
v;
never executed: return v;
0
1213}-
1214-
1215-
1216-
1217-
1218void QGraphicsProxyWidget::inputMethodEvent(QInputMethodEvent *event)-
1219{-
1220-
1221 const QGraphicsProxyWidgetPrivate * const d = d_func();-
1222 QWidget *focusWidget = d->widget->focusWidget();-
1223 if (focusWidget
focusWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
focusWidget->t...MethodEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1224 QApplication::sendEvent(focusWidget, event);
never executed: QApplication::sendEvent(focusWidget, event);
0
1225}
never executed: end of block
0
1226-
1227-
1228-
1229-
1230QSizeF QGraphicsProxyWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const-
1231{-
1232 const QGraphicsProxyWidgetPrivate * const d = d_func();-
1233 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1234 return
never executed: return QGraphicsWidget::sizeHint(which, constraint);
QGraphicsWidget::sizeHint(which, constraint);
never executed: return QGraphicsWidget::sizeHint(which, constraint);
0
1235-
1236 QSizeF sh;-
1237 switch (which) {-
1238 case
never executed: case Qt::PreferredSize:
Qt::PreferredSize:
never executed: case Qt::PreferredSize:
0
1239 if (QLayout *l = d->widget->layout()
QLayout *l = d...dget->layout()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1240 sh = l->sizeHint();
never executed: sh = l->sizeHint();
0
1241 else-
1242 sh = d->widget->sizeHint();
never executed: sh = d->widget->sizeHint();
0
1243 break;
never executed: break;
0
1244 case
never executed: case Qt::MinimumSize:
Qt::MinimumSize:
never executed: case Qt::MinimumSize:
0
1245 if (QLayout *l = d->widget->layout()
QLayout *l = d...dget->layout()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1246 sh = l->minimumSize();
never executed: sh = l->minimumSize();
0
1247 else-
1248 sh = d->widget->minimumSizeHint();
never executed: sh = d->widget->minimumSizeHint();
0
1249 break;
never executed: break;
0
1250 case
never executed: case Qt::MaximumSize:
Qt::MaximumSize:
never executed: case Qt::MaximumSize:
0
1251 if (QLayout *l = d->widget->layout()
QLayout *l = d...dget->layout()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1252 sh = l->maximumSize();
never executed: sh = l->maximumSize();
0
1253 else-
1254 sh = QSizeF(((1<<24)-1), ((1<<24)-1));
never executed: sh = QSizeF(((1<<24)-1), ((1<<24)-1));
0
1255 break;
never executed: break;
0
1256 case
never executed: case Qt::MinimumDescent:
Qt::MinimumDescent:
never executed: case Qt::MinimumDescent:
0
1257 sh = constraint;-
1258 break;
never executed: break;
0
1259 default
never executed: default:
:
never executed: default:
0
1260 break;
never executed: break;
0
1261 }-
1262 return
never executed: return sh;
sh;
never executed: return sh;
0
1263}-
1264-
1265-
1266-
1267-
1268void QGraphicsProxyWidget::resizeEvent(QGraphicsSceneResizeEvent *event)-
1269{-
1270 QGraphicsProxyWidgetPrivate * const d = d_func();-
1271 if (d->widget
d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1272 if (d->sizeChangeMode != QGraphicsProxyWidgetPrivate::WidgetToProxyMode
d->sizeChangeM...getToProxyModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1273 d->widget->resize(event->newSize().toSize());
never executed: d->widget->resize(event->newSize().toSize());
0
1274 }
never executed: end of block
0
1275 QGraphicsWidget::resizeEvent(event);-
1276}
never executed: end of block
0
1277-
1278-
1279-
1280-
1281void QGraphicsProxyWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)-
1282{-
1283 QGraphicsProxyWidgetPrivate * const d = d_func();-
1284 (void)widget;;-
1285 if (!d->widget
!d->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->widget->isVisible()
!d->widget->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1286 return;
never executed: return;
0
1287-
1288-
1289 const QRect exposedWidgetRect = (option->exposedRect & rect()).toAlignedRect();-
1290 if (exposedWidgetRect.isEmpty()
exposedWidgetRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1291 return;
never executed: return;
0
1292-
1293 d->widget->render(painter, exposedWidgetRect.topLeft(), exposedWidgetRect);-
1294}
never executed: end of block
0
1295-
1296-
1297-
1298-
1299int QGraphicsProxyWidget::type() const-
1300{-
1301 return
never executed: return Type;
Type;
never executed: return Type;
0
1302}-
1303QGraphicsProxyWidget *QGraphicsProxyWidget::createProxyForChildWidget(QWidget *child)-
1304{-
1305 QGraphicsProxyWidget *proxy = child->graphicsProxyWidget();-
1306 if (proxy
proxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1307 return
never executed: return proxy;
proxy;
never executed: return proxy;
0
1308 if (!child->parentWidget()
!child->parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1309 QMessageLogger(__FILE__, 1566, __PRETTY_FUNCTION__).warning("QGraphicsProxyWidget::createProxyForChildWidget: top-level widget not in a QGraphicsScene");-
1310 return
never executed: return 0;
0;
never executed: return 0;
0
1311 }-
1312-
1313 QGraphicsProxyWidget *parentProxy = createProxyForChildWidget(child->parentWidget());-
1314 if (!parentProxy
!parentProxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1315 return
never executed: return 0;
0;
never executed: return 0;
0
1316-
1317 if (!QMetaObject::invokeMethod(parentProxy, "newProxyWidget", Qt::DirectConnection,
!QMetaObject::...get*", child))Description
TRUEnever evaluated
FALSEnever evaluated
0
1318 QReturnArgument<QGraphicsProxyWidget* >("QGraphicsProxyWidget*", proxy), QArgument<const QWidget* >("const QWidget*", child))
!QMetaObject::...get*", child))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1319 return
never executed: return 0;
0;
never executed: return 0;
0
1320 proxy->setParent(parentProxy);-
1321 proxy->setWidget(child);-
1322 return
never executed: return proxy;
proxy;
never executed: return proxy;
0
1323}-
1324QGraphicsProxyWidget *QGraphicsProxyWidget::newProxyWidget(const QWidget *)-
1325{-
1326 return
never executed: return new QGraphicsProxyWidget(this);
new QGraphicsProxyWidget(this);
never executed: return new QGraphicsProxyWidget(this);
0
1327}-
1328-
1329-
1330-
1331-
1332-
Switch to Source codePreprocessed file

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