widgets/qmdisubwindow.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10using namespace QMdi; -
11 -
12static const QStyle::SubControl SubControls[] = -
13{ -
14 QStyle::SC_TitleBarLabel, -
15 QStyle::SC_TitleBarSysMenu, -
16 QStyle::SC_TitleBarMinButton, -
17 QStyle::SC_TitleBarMaxButton, -
18 QStyle::SC_TitleBarShadeButton, -
19 QStyle::SC_TitleBarCloseButton, -
20 QStyle::SC_TitleBarNormalButton, -
21 QStyle::SC_TitleBarUnshadeButton, -
22 QStyle::SC_TitleBarContextHelpButton -
23}; -
24static const int NumSubControls = sizeof(SubControls) / sizeof(SubControls[0]); -
25 -
26static const QStyle::StandardPixmap ButtonPixmaps[] = -
27{ -
28 QStyle::SP_TitleBarMinButton, -
29 QStyle::SP_TitleBarNormalButton, -
30 QStyle::SP_TitleBarCloseButton -
31}; -
32static const int NumButtonPixmaps = sizeof(ButtonPixmaps) / sizeof(ButtonPixmaps[0]); -
33 -
34static const Qt::WindowFlags CustomizeWindowFlags = -
35 Qt::FramelessWindowHint -
36 | Qt::CustomizeWindowHint -
37 | Qt::WindowTitleHint -
38 | Qt::WindowSystemMenuHint -
39 | Qt::WindowMinimizeButtonHint -
40 | Qt::WindowMaximizeButtonHint -
41 | Qt::WindowMinMaxButtonsHint; -
42 -
43 -
44static const int BoundaryMargin = 5; -
45 -
46static inline int getMoveDeltaComponent(uint cflags, uint moveFlag, uint resizeFlag, -
47 int delta, int maxDelta, int minDelta) -
48{ -
49 if (cflags & moveFlag) {
partially evaluated: cflags & moveFlag
TRUEFALSE
yes
Evaluation Count:80
no
Evaluation Count:0
0-80
50 if (delta > 0)
partially evaluated: delta > 0
TRUEFALSE
yes
Evaluation Count:80
no
Evaluation Count:0
0-80
51 return (cflags & resizeFlag) ? qMin(delta, maxDelta) : delta;
executed: return (cflags & resizeFlag) ? qMin(delta, maxDelta) : delta;
Execution Count:80
80
52 return (cflags & resizeFlag) ? qMax(delta, minDelta) : delta;
never executed: return (cflags & resizeFlag) ? qMax(delta, minDelta) : delta;
0
53 } -
54 return 0;
never executed: return 0;
0
55} -
56 -
57static inline int getResizeDeltaComponent(uint cflags, uint resizeFlag, -
58 uint resizeReverseFlag, int delta) -
59{ -
60 if (cflags & resizeFlag) {
partially evaluated: cflags & resizeFlag
TRUEFALSE
yes
Evaluation Count:622
no
Evaluation Count:0
0-622
61 if (cflags & resizeReverseFlag)
partially evaluated: cflags & resizeReverseFlag
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:622
0-622
62 return -delta;
never executed: return -delta;
0
63 return delta;
executed: return delta;
Execution Count:622
622
64 } -
65 return 0;
never executed: return 0;
0
66} -
67 -
68static inline bool isChildOfQMdiSubWindow(const QWidget *child) -
69{ -
70 qt_noop(); -
71 QWidget *parent = child->parentWidget(); -
72 while (parent) {
evaluated: parent
TRUEFALSE
yes
Evaluation Count:8479
yes
Evaluation Count:1640
1640-8479
73 if (qobject_cast<QMdiSubWindow *>(parent))
evaluated: qobject_cast<QMdiSubWindow *>(parent)
TRUEFALSE
yes
Evaluation Count:865
yes
Evaluation Count:7614
865-7614
74 return true;
executed: return true;
Execution Count:865
865
75 parent = parent->parentWidget(); -
76 }
executed: }
Execution Count:7614
7614
77 return false;
executed: return false;
Execution Count:1640
1640
78} -
79 -
80static inline bool isChildOfTabbedQMdiArea(const QMdiSubWindow *child) -
81{ -
82 qt_noop(); -
83 if (QMdiArea *mdiArea = child->mdiArea()) {
evaluated: QMdiArea *mdiArea = child->mdiArea()
TRUEFALSE
yes
Evaluation Count:5513
yes
Evaluation Count:358
358-5513
84 if (mdiArea->viewMode() == QMdiArea::TabbedView)
partially evaluated: mdiArea->viewMode() == QMdiArea::TabbedView
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5513
0-5513
85 return true;
never executed: return true;
0
86 }
executed: }
Execution Count:5513
5513
87 return false;
executed: return false;
Execution Count:5871
5871
88} -
89 -
90template<typename T> -
91static inline ControlElement<T> *ptr(QWidget *widget) -
92{ -
93 if (widget && widget->qt_metacast("ControlElement")
evaluated: widget
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:52
partially evaluated: widget->qt_metacast("ControlElement")
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-52
94 && strcmp(widget->metaObject()->className(), T::staticMetaObject.className()) == 0) {
partially evaluated: strcmp(widget->metaObject()->className(), T::staticMetaObject.className()) == 0
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
95 return static_cast<ControlElement<T> *>(widget);
executed: return static_cast<ControlElement<T> *>(widget);
Execution Count:2
2
96 } -
97 return 0;
executed: return 0;
Execution Count:52
52
98} -
99 -
100QString QMdiSubWindowPrivate::originalWindowTitle() -
101{ -
102 QMdiSubWindow * const q = q_func(); -
103 if (originalTitle.isNull()) {
evaluated: originalTitle.isNull()
TRUEFALSE
yes
Evaluation Count:169
yes
Evaluation Count:13
13-169
104 originalTitle = q->window()->windowTitle(); -
105 if (originalTitle.isNull())
evaluated: originalTitle.isNull()
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:101
68-101
106 originalTitle = QLatin1String("");
executed: originalTitle = QLatin1String("");
Execution Count:68
68
107 }
executed: }
Execution Count:169
169
108 return originalTitle;
executed: return originalTitle;
Execution Count:182
182
109} -
110 -
111void QMdiSubWindowPrivate::setNewWindowTitle() -
112{ -
113 QMdiSubWindow * const q = q_func(); -
114 QString childTitle = q->windowTitle(); -
115 if (childTitle.isEmpty())
evaluated: childTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:15
15-21
116 return;
executed: return;
Execution Count:21
21
117 QString original = originalWindowTitle(); -
118 if (!original.isEmpty()) {
evaluated: !original.isEmpty()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:1
1-14
119 if (!original.contains(QMdiSubWindow::tr("- [%1]").arg(childTitle)))
evaluated: !original.contains(QMdiSubWindow::tr("- [%1]").arg(childTitle))
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1
1-13
120 q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle));
executed: q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle));
Execution Count:13
13
121 -
122 } else {
executed: }
Execution Count:14
14
123 q->window()->setWindowTitle(childTitle); -
124 }
executed: }
Execution Count:1
1
125} -
126 -
127static inline bool isHoverControl(QStyle::SubControl control) -
128{ -
129 return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel;
executed: return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel;
Execution Count:22
22
130} -
131static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOptionComplex &opt, -
132 QStyle::ComplexControl complexControl, QStyle::SubControl subControl) -
133{ -
134 qt_noop(); -
135 qt_noop(); -
136 qt_noop(); -
137 if (complexControl == QStyle::CC_MdiControls) {
never evaluated: complexControl == QStyle::CC_MdiControls
0
138 if (subControl == QStyle::SC_MdiMinButton)
never evaluated: subControl == QStyle::SC_MdiMinButton
0
139 subControl = QStyle::SC_TitleBarMinButton;
never executed: subControl = QStyle::SC_TitleBarMinButton;
0
140 else if (subControl == QStyle::SC_MdiCloseButton)
never evaluated: subControl == QStyle::SC_MdiCloseButton
0
141 subControl = QStyle::SC_TitleBarCloseButton;
never executed: subControl = QStyle::SC_TitleBarCloseButton;
0
142 else if (subControl == QStyle::SC_MdiNormalButton)
never evaluated: subControl == QStyle::SC_MdiNormalButton
0
143 subControl = QStyle::SC_TitleBarNormalButton;
never executed: subControl = QStyle::SC_TitleBarNormalButton;
0
144 else -
145 subControl = QStyle::SC_None;
never executed: subControl = QStyle::SC_None;
0
146 } -
147 -
148 -
149 if (subControl == QStyle::SC_None)
never evaluated: subControl == QStyle::SC_None
0
150 return;
never executed: return;
0
151 -
152 QString toolTip; -
153 -
154 switch (subControl) { -
155 case QStyle::SC_TitleBarMinButton: -
156 toolTip = QMdiSubWindow::tr("Minimize"); -
157 break;
never executed: break;
0
158 case QStyle::SC_TitleBarMaxButton: -
159 toolTip = QMdiSubWindow::tr("Maximize"); -
160 break;
never executed: break;
0
161 case QStyle::SC_TitleBarUnshadeButton: -
162 toolTip = QMdiSubWindow::tr("Unshade"); -
163 break;
never executed: break;
0
164 case QStyle::SC_TitleBarShadeButton: -
165 toolTip = QMdiSubWindow::tr("Shade"); -
166 break;
never executed: break;
0
167 case QStyle::SC_TitleBarNormalButton: -
168 if (widget->isMaximized() || !qobject_cast<QMdiSubWindow *>(widget))
never evaluated: widget->isMaximized()
never evaluated: !qobject_cast<QMdiSubWindow *>(widget)
0
169 toolTip = QMdiSubWindow::tr("Restore Down");
never executed: toolTip = QMdiSubWindow::tr("Restore Down");
0
170 else -
171 toolTip = QMdiSubWindow::tr("Restore");
never executed: toolTip = QMdiSubWindow::tr("Restore");
0
172 break;
never executed: break;
0
173 case QStyle::SC_TitleBarCloseButton: -
174 toolTip = QMdiSubWindow::tr("Close"); -
175 break;
never executed: break;
0
176 case QStyle::SC_TitleBarContextHelpButton: -
177 toolTip = QMdiSubWindow::tr("Help"); -
178 break;
never executed: break;
0
179 case QStyle::SC_TitleBarSysMenu: -
180 toolTip = QMdiSubWindow::tr("Menu"); -
181 break;
never executed: break;
0
182 default: -
183 break;
never executed: break;
0
184 } -
185 -
186 const QRect rect = widget->style()->subControlRect(complexControl, &opt, subControl, widget); -
187 QToolTip::showText(helpEvent->globalPos(), toolTip, widget, rect); -
188}
never executed: }
0
189 -
190 -
191namespace QMdi { -
192 -
193 -
194 -
195 -
196class ControlLabel : public QWidget -
197{ -
198 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
199public: -
200 ControlLabel(QMdiSubWindow *subWindow, QWidget *parent = 0); -
201 -
202 QSize sizeHint() const; -
203 -
204public: -
205 void _q_clicked(); -
206 void _q_doubleClicked(); -
207 -
208protected: -
209 bool event(QEvent *event); -
210 void paintEvent(QPaintEvent *paintEvent); -
211 void mousePressEvent(QMouseEvent *mouseEvent); -
212 void mouseDoubleClickEvent(QMouseEvent *mouseEvent); -
213 void mouseReleaseEvent(QMouseEvent *mouseEvent); -
214 -
215private: -
216 QPixmap label; -
217 bool isPressed; -
218 void updateWindowIcon(); -
219}; -
220} -
221 -
222ControlLabel::ControlLabel(QMdiSubWindow *subWindow, QWidget *parent) -
223 : QWidget(parent), isPressed(false) -
224{ -
225 (void)subWindow;; -
226 setFocusPolicy(Qt::NoFocus); -
227 updateWindowIcon(); -
228 setFixedSize(label.size()); -
229}
executed: }
Execution Count:102
102
230 -
231 -
232 -
233 -
234QSize ControlLabel::sizeHint() const -
235{ -
236 return label.size();
executed: return label.size();
Execution Count:349
349
237} -
238 -
239 -
240 -
241 -
242bool ControlLabel::event(QEvent *event) -
243{ -
244 if (event->type() == QEvent::WindowIconChange)
evaluated: event->type() == QEvent::WindowIconChange
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:545
102-545
245 updateWindowIcon();
executed: updateWindowIcon();
Execution Count:102
102
246 -
247 else if (event->type() == QEvent::ToolTip) {
partially evaluated: event->type() == QEvent::ToolTip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:545
0-545
248 QStyleOptionTitleBar options; -
249 options.initFrom(this); -
250 showToolTip(static_cast<QHelpEvent *>(event), this, options, -
251 QStyle::CC_TitleBar, QStyle::SC_TitleBarSysMenu); -
252 }
never executed: }
0
253 -
254 return QWidget::event(event);
executed: return QWidget::event(event);
Execution Count:647
647
255} -
256 -
257 -
258 -
259 -
260void ControlLabel::paintEvent(QPaintEvent * ) -
261{ -
262 QPainter painter(this); -
263 painter.drawPixmap(0, 0, label); -
264}
executed: }
Execution Count:24
24
265 -
266 -
267 -
268 -
269void ControlLabel::mousePressEvent(QMouseEvent *mouseEvent) -
270{ -
271 if (mouseEvent->button() != Qt::LeftButton) {
never evaluated: mouseEvent->button() != Qt::LeftButton
0
272 mouseEvent->ignore(); -
273 return;
never executed: return;
0
274 } -
275 isPressed = true; -
276}
never executed: }
0
277 -
278 -
279 -
280 -
281void ControlLabel::mouseDoubleClickEvent(QMouseEvent *mouseEvent) -
282{ -
283 if (mouseEvent->button() != Qt::LeftButton) {
never evaluated: mouseEvent->button() != Qt::LeftButton
0
284 mouseEvent->ignore(); -
285 return;
never executed: return;
0
286 } -
287 isPressed = false; -
288 _q_doubleClicked(); -
289}
never executed: }
0
290 -
291 -
292 -
293 -
294void ControlLabel::mouseReleaseEvent(QMouseEvent *mouseEvent) -
295{ -
296 if (mouseEvent->button() != Qt::LeftButton) {
never evaluated: mouseEvent->button() != Qt::LeftButton
0
297 mouseEvent->ignore(); -
298 return;
never executed: return;
0
299 } -
300 if (isPressed) {
never evaluated: isPressed
0
301 isPressed = false; -
302 _q_clicked(); -
303 }
never executed: }
0
304}
never executed: }
0
305 -
306 -
307 -
308 -
309void ControlLabel::updateWindowIcon() -
310{ -
311 QIcon menuIcon = windowIcon(); -
312 if (menuIcon.isNull())
partially evaluated: menuIcon.isNull()
TRUEFALSE
yes
Evaluation Count:204
no
Evaluation Count:0
0-204
313 menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget());
executed: menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget());
Execution Count:204
204
314 label = menuIcon.pixmap(16, 16); -
315 update(); -
316}
executed: }
Execution Count:204
204
317 -
318namespace QMdi { -
319 -
320 -
321 -
322 -
323class ControllerWidget : public QWidget -
324{ -
325 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
326public: -
327 ControllerWidget(QMdiSubWindow *subWindow, QWidget *parent = 0); -
328 QSize sizeHint() const; -
329 void setControlVisible(QMdiSubWindowPrivate::WindowStateAction action, bool visible); -
330 inline bool hasVisibleControls() const -
331 { -
332 return (visibleControls & QStyle::SC_MdiMinButton) 34
333 || (visibleControls & QStyle::SC_MdiNormalButton) 34
334 || (visibleControls & QStyle::SC_MdiCloseButton);
executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton);
Execution Count:34
34
335 } -
336 -
337public: -
338 void _q_minimize(); -
339 void _q_restore(); -
340 void _q_close(); -
341 -
342protected: -
343 void paintEvent(QPaintEvent *event); -
344 void mousePressEvent(QMouseEvent *event); -
345 void mouseReleaseEvent(QMouseEvent *event); -
346 void mouseMoveEvent(QMouseEvent *event); -
347 void leaveEvent(QEvent *event); -
348 bool event(QEvent *event); -
349 -
350private: -
351 QStyle::SubControl activeControl; -
352 QStyle::SubControl hoverControl; -
353 QStyle::SubControls visibleControls; -
354 void initStyleOption(QStyleOptionComplex *option) const; -
355 QMdiArea *mdiArea; -
356 inline QStyle::SubControl getSubControl(const QPoint &pos) const -
357 { -
358 QStyleOptionComplex opt; -
359 initStyleOption(&opt); -
360 return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea);
never executed: return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea);
0
361 } -
362}; -
363} -
364 -
365 -
366 -
367 -
368ControllerWidget::ControllerWidget(QMdiSubWindow *subWindow, QWidget *parent) -
369 : QWidget(parent), -
370 activeControl(QStyle::SC_None), -
371 hoverControl(QStyle::SC_None), -
372 visibleControls(QStyle::SC_None), -
373 mdiArea(0) -
374{ -
375 if (subWindow->parentWidget())
evaluated: subWindow->parentWidget()
TRUEFALSE
yes
Evaluation Count:82
yes
Evaluation Count:20
20-82
376 mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget());
executed: mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget());
Execution Count:82
82
377 setFocusPolicy(Qt::NoFocus); -
378 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); -
379 setMouseTracking(true); -
380}
executed: }
Execution Count:102
102
381 -
382 -
383 -
384 -
385QSize ControllerWidget::sizeHint() const -
386{ -
387 ensurePolished(); -
388 QStyleOptionComplex opt; -
389 initStyleOption(&opt); -
390 QSize size(48, 16); -
391 return style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea);
executed: return style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea);
Execution Count:200
200
392} -
393 -
394void ControllerWidget::setControlVisible(QMdiSubWindowPrivate::WindowStateAction action, bool visible) -
395{ -
396 QStyle::SubControl subControl = QStyle::SC_None; -
397 -
398 -
399 if (action == QMdiSubWindowPrivate::MaximizeAction)
evaluated: action == QMdiSubWindowPrivate::MaximizeAction
TRUEFALSE
yes
Evaluation Count:573
yes
Evaluation Count:3450
573-3450
400 subControl = QStyle::SC_MdiNormalButton;
executed: subControl = QStyle::SC_MdiNormalButton;
Execution Count:573
573
401 else if (action == QMdiSubWindowPrivate::CloseAction)
evaluated: action == QMdiSubWindowPrivate::CloseAction
TRUEFALSE
yes
Evaluation Count:576
yes
Evaluation Count:2874
576-2874
402 subControl = QStyle::SC_MdiCloseButton;
executed: subControl = QStyle::SC_MdiCloseButton;
Execution Count:576
576
403 else if (action == QMdiSubWindowPrivate::MinimizeAction)
evaluated: action == QMdiSubWindowPrivate::MinimizeAction
TRUEFALSE
yes
Evaluation Count:573
yes
Evaluation Count:2301
573-2301
404 subControl = QStyle::SC_MdiMinButton;
executed: subControl = QStyle::SC_MdiMinButton;
Execution Count:573
573
405 -
406 if (subControl == QStyle::SC_None)
evaluated: subControl == QStyle::SC_None
TRUEFALSE
yes
Evaluation Count:2301
yes
Evaluation Count:1722
1722-2301
407 return;
executed: return;
Execution Count:2301
2301
408 -
409 if (visible && !(visibleControls & subControl))
evaluated: visible
TRUEFALSE
yes
Evaluation Count:858
yes
Evaluation Count:864
partially evaluated: !(visibleControls & subControl)
TRUEFALSE
yes
Evaluation Count:858
no
Evaluation Count:0
0-864
410 visibleControls |= subControl;
executed: visibleControls |= subControl;
Execution Count:858
858
411 else if (!visible && (visibleControls & subControl))
partially evaluated: !visible
TRUEFALSE
yes
Evaluation Count:864
no
Evaluation Count:0
evaluated: (visibleControls & subControl)
TRUEFALSE
yes
Evaluation Count:558
yes
Evaluation Count:306
0-864
412 visibleControls &= ~subControl;
executed: visibleControls &= ~subControl;
Execution Count:558
558
413} -
414 -
415 -
416 -
417 -
418void ControllerWidget::paintEvent(QPaintEvent * ) -
419{ -
420 QStyleOptionComplex opt; -
421 initStyleOption(&opt); -
422 if (activeControl == hoverControl) {
partially evaluated: activeControl == hoverControl
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
0-24
423 opt.activeSubControls = activeControl; -
424 opt.state |= QStyle::State_Sunken; -
425 } else if (hoverControl != QStyle::SC_None && (activeControl == QStyle::SC_None)) {
executed: }
Execution Count:24
never evaluated: hoverControl != QStyle::SC_None
never evaluated: (activeControl == QStyle::SC_None)
0-24
426 opt.activeSubControls = hoverControl; -
427 opt.state |= QStyle::State_MouseOver; -
428 }
never executed: }
0
429 QPainter painter(this); -
430 style()->drawComplexControl(QStyle::CC_MdiControls, &opt, &painter, mdiArea); -
431}
executed: }
Execution Count:24
24
432 -
433 -
434 -
435 -
436void ControllerWidget::mousePressEvent(QMouseEvent *event) -
437{ -
438 if (event->button() != Qt::LeftButton) {
never evaluated: event->button() != Qt::LeftButton
0
439 event->ignore(); -
440 return;
never executed: return;
0
441 } -
442 activeControl = getSubControl(event->pos()); -
443 update(); -
444}
never executed: }
0
445 -
446 -
447 -
448 -
449void ControllerWidget::mouseReleaseEvent(QMouseEvent *event) -
450{ -
451 if (event->button() != Qt::LeftButton) {
never evaluated: event->button() != Qt::LeftButton
0
452 event->ignore(); -
453 return;
never executed: return;
0
454 } -
455 -
456 QStyle::SubControl under_mouse = getSubControl(event->pos()); -
457 if (under_mouse == activeControl) {
never evaluated: under_mouse == activeControl
0
458 switch (activeControl) { -
459 case QStyle::SC_MdiCloseButton: -
460 _q_close(); -
461 break;
never executed: break;
0
462 case QStyle::SC_MdiNormalButton: -
463 _q_restore(); -
464 break;
never executed: break;
0
465 case QStyle::SC_MdiMinButton: -
466 _q_minimize(); -
467 break;
never executed: break;
0
468 default: -
469 break;
never executed: break;
0
470 } -
471 }
never executed: }
0
472 -
473 activeControl = QStyle::SC_None; -
474 update(); -
475}
never executed: }
0
476 -
477 -
478 -
479 -
480void ControllerWidget::mouseMoveEvent(QMouseEvent *event) -
481{ -
482 QStyle::SubControl under_mouse = getSubControl(event->pos()); -
483 -
484 if (hoverControl != under_mouse) {
never evaluated: hoverControl != under_mouse
0
485 hoverControl = under_mouse; -
486 update(); -
487 }
never executed: }
0
488}
never executed: }
0
489 -
490 -
491 -
492 -
493void ControllerWidget::leaveEvent(QEvent * ) -
494{ -
495 hoverControl = QStyle::SC_None; -
496 update(); -
497}
never executed: }
0
498 -
499 -
500 -
501 -
502bool ControllerWidget::event(QEvent *event) -
503{ -
504 -
505 if (event->type() == QEvent::ToolTip) {
partially evaluated: event->type() == QEvent::ToolTip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:639
0-639
506 QStyleOptionComplex opt; -
507 initStyleOption(&opt); -
508 QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event); -
509 showToolTip(helpEvent, this, opt, QStyle::CC_MdiControls, getSubControl(helpEvent->pos())); -
510 }
never executed: }
0
511 -
512 return QWidget::event(event);
executed: return QWidget::event(event);
Execution Count:639
639
513} -
514 -
515 -
516 -
517 -
518void ControllerWidget::initStyleOption(QStyleOptionComplex *option) const -
519{ -
520 option->initFrom(this); -
521 option->subControls = visibleControls; -
522 option->activeSubControls = QStyle::SC_None; -
523}
executed: }
Execution Count:224
224
524 -
525 -
526 -
527 -
528ControlContainer::ControlContainer(QMdiSubWindow *mdiChild) -
529 : QObject(mdiChild), -
530 previousLeft(0), -
531 previousRight(0), -
532 -
533 m_menuBar(0), -
534 -
535 mdiChild(mdiChild) -
536{ -
537 qt_noop(); -
538 -
539 m_controllerWidget = new ControlElement<ControllerWidget>(mdiChild); -
540 connect(m_controllerWidget, "2""_q_close()", mdiChild, "1""close()"); -
541 connect(m_controllerWidget, "2""_q_restore()", mdiChild, "1""showNormal()"); -
542 connect(m_controllerWidget, "2""_q_minimize()", mdiChild, "1""showMinimized()"); -
543 -
544 m_menuLabel = new ControlElement<ControlLabel>(mdiChild); -
545 m_menuLabel->setWindowIcon(mdiChild->windowIcon()); -
546 -
547 connect(m_menuLabel, "2""_q_clicked()", mdiChild, "1""showSystemMenu()"); -
548 -
549 connect(m_menuLabel, "2""_q_doubleClicked()", mdiChild, "1""close()"); -
550}
executed: }
Execution Count:102
102
551 -
552ControlContainer::~ControlContainer() -
553{ -
554 -
555 removeButtonsFromMenuBar(); -
556 -
557 delete m_menuLabel; -
558 m_menuLabel = 0; -
559 delete m_controllerWidget; -
560 m_controllerWidget = 0; -
561}
executed: }
Execution Count:102
102
562 -
563 -
564 -
565 -
566 -
567QMenuBar *QMdiSubWindowPrivate::menuBar() const -
568{ -
569 -
570 -
571 -
572 const QMdiSubWindow * const q = q_func(); -
573 if (!q->isMaximized() || drawTitleBarWhenMaximized() || isChildOfTabbedQMdiArea(q))
evaluated: !q->isMaximized()
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:166
evaluated: drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:98
yes
Evaluation Count:68
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:68
0-285
574 return 0;
executed: return 0;
Execution Count:383
383
575 -
576 if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window()))
partially evaluated: QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())
TRUEFALSE
yes
Evaluation Count:68
no
Evaluation Count:0
0-68
577 return mainWindow->menuBar();
executed: return mainWindow->menuBar();
Execution Count:68
68
578 -
579 return 0;
never executed: return 0;
0
580 -
581} -
582 -
583 -
584 -
585 -
586void ControlContainer::showButtonsInMenuBar(QMenuBar *menuBar) -
587{ -
588 if (!menuBar || !mdiChild || mdiChild->windowFlags() & Qt::FramelessWindowHint)
partially evaluated: !menuBar
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
partially evaluated: !mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
partially evaluated: mdiChild->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
0-35
589 return;
never executed: return;
0
590 m_menuBar = menuBar; -
591 -
592 if (m_menuLabel && mdiChild->windowFlags() & Qt::WindowSystemMenuHint) {
evaluated: m_menuLabel
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:1
partially evaluated: mdiChild->windowFlags() & Qt::WindowSystemMenuHint
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
0-34
593 QWidget *currentLeft = menuBar->cornerWidget(Qt::TopLeftCorner); -
594 if (currentLeft)
evaluated: currentLeft
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:32
2-32
595 currentLeft->hide();
executed: currentLeft->hide();
Execution Count:2
2
596 if (currentLeft != m_menuLabel) {
partially evaluated: currentLeft != m_menuLabel
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
0-34
597 menuBar->setCornerWidget(m_menuLabel, Qt::TopLeftCorner); -
598 previousLeft = currentLeft; -
599 }
executed: }
Execution Count:34
34
600 m_menuLabel->show(); -
601 }
executed: }
Execution Count:34
34
602 ControllerWidget *controllerWidget = qobject_cast<ControllerWidget *>(m_controllerWidget); -
603 if (controllerWidget && controllerWidget->hasVisibleControls()) {
evaluated: controllerWidget
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:1
partially evaluated: controllerWidget->hasVisibleControls()
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
0-34
604 QWidget *currentRight = menuBar->cornerWidget(Qt::TopRightCorner); -
605 if (currentRight)
evaluated: currentRight
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:32
2-32
606 currentRight->hide();
executed: currentRight->hide();
Execution Count:2
2
607 if (currentRight != m_controllerWidget) {
partially evaluated: currentRight != m_controllerWidget
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
0-34
608 menuBar->setCornerWidget(m_controllerWidget, Qt::TopRightCorner); -
609 previousRight = currentRight; -
610 }
executed: }
Execution Count:34
34
611 m_controllerWidget->show(); -
612 }
executed: }
Execution Count:34
34
613 mdiChild->d_func()->setNewWindowTitle(); -
614}
executed: }
Execution Count:35
35
615 -
616 -
617 -
618 -
619void ControlContainer::removeButtonsFromMenuBar(QMenuBar *menuBar) -
620{ -
621 if (menuBar && menuBar != m_menuBar) {
evaluated: menuBar
TRUEFALSE
yes
Evaluation Count:166
yes
Evaluation Count:488
evaluated: menuBar != m_menuBar
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:141
25-488
622 -
623 previousRight = 0; -
624 previousLeft = 0; -
625 m_menuBar = menuBar; -
626 }
executed: }
Execution Count:25
25
627 -
628 if (!m_menuBar || !mdiChild || qt_widget_private(mdiChild->window())->data.in_destructor)
evaluated: !m_menuBar
TRUEFALSE
yes
Evaluation Count:433
yes
Evaluation Count:221
partially evaluated: !mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:221
evaluated: qt_widget_private(mdiChild->window())->data.in_destructor
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:168
0-433
629 return;
executed: return;
Execution Count:486
486
630 -
631 QMdiSubWindow *child = 0; -
632 if (m_controllerWidget) {
evaluated: m_controllerWidget
TRUEFALSE
yes
Evaluation Count:162
yes
Evaluation Count:6
6-162
633 QWidget *currentRight = m_menuBar->cornerWidget(Qt::TopRightCorner); -
634 if (currentRight == m_controllerWidget) {
evaluated: currentRight == m_controllerWidget
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:135
27-135
635 if (ControlElement<ControllerWidget> *ce = ptr<ControllerWidget>(previousRight)) {
evaluated: ControlElement<ControllerWidget> *ce = ptr<ControllerWidget>(previousRight)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:26
1-26
636 if (!ce->mdiChild || !ce->mdiChild->isMaximized())
partially evaluated: !ce->mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !ce->mdiChild->isMaximized()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
637 previousRight = 0;
never executed: previousRight = 0;
0
638 else -
639 child = ce->mdiChild;
executed: child = ce->mdiChild;
Execution Count:1
1
640 } -
641 m_menuBar->setCornerWidget(previousRight, Qt::TopRightCorner); -
642 if (previousRight) {
evaluated: previousRight
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:26
1-26
643 previousRight->show(); -
644 previousRight = 0; -
645 }
executed: }
Execution Count:1
1
646 }
executed: }
Execution Count:27
27
647 m_controllerWidget->hide(); -
648 m_controllerWidget->setParent(0); -
649 }
executed: }
Execution Count:162
162
650 if (m_menuLabel) {
evaluated: m_menuLabel
TRUEFALSE
yes
Evaluation Count:162
yes
Evaluation Count:6
6-162
651 QWidget *currentLeft = m_menuBar->cornerWidget(Qt::TopLeftCorner); -
652 if (currentLeft == m_menuLabel) {
evaluated: currentLeft == m_menuLabel
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:135
27-135
653 if (ControlElement<ControlLabel> *ce = ptr<ControlLabel>(previousLeft)) {
evaluated: ControlElement<ControlLabel> *ce = ptr<ControlLabel>(previousLeft)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:26
1-26
654 if (!ce->mdiChild || !ce->mdiChild->isMaximized())
partially evaluated: !ce->mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !ce->mdiChild->isMaximized()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
655 previousLeft = 0;
never executed: previousLeft = 0;
0
656 else if (!child)
partially evaluated: !child
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
657 child = mdiChild;
never executed: child = mdiChild;
0
658 } -
659 m_menuBar->setCornerWidget(previousLeft, Qt::TopLeftCorner); -
660 if (previousLeft) {
evaluated: previousLeft
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:26
1-26
661 previousLeft->show(); -
662 previousLeft = 0; -
663 }
executed: }
Execution Count:1
1
664 }
executed: }
Execution Count:27
27
665 m_menuLabel->hide(); -
666 m_menuLabel->setParent(0); -
667 }
executed: }
Execution Count:162
162
668 m_menuBar->update(); -
669 if (child)
evaluated: child
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:167
1-167
670 child->d_func()->setNewWindowTitle();
executed: child->d_func()->setNewWindowTitle();
Execution Count:1
1
671 else if (mdiChild)
partially evaluated: mdiChild
TRUEFALSE
yes
Evaluation Count:167
no
Evaluation Count:0
0-167
672 mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle());
executed: mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle());
Execution Count:167
167
673} -
674 -
675 -
676 -
677void ControlContainer::updateWindowIcon(const QIcon &windowIcon) -
678{ -
679 if (m_menuLabel)
never evaluated: m_menuLabel
0
680 m_menuLabel->setWindowIcon(windowIcon);
never executed: m_menuLabel->setWindowIcon(windowIcon);
0
681}
never executed: }
0
682 -
683 -
684 -
685 -
686QMdiSubWindowPrivate::QMdiSubWindowPrivate() -
687 : baseWidget(0), -
688 restoreFocusWidget(0), -
689 controlContainer(0), -
690 -
691 sizeGrip(0), -
692 -
693 -
694 rubberBand(0), -
695 -
696 userMinimumSize(0,0), -
697 resizeEnabled(true), -
698 moveEnabled(true), -
699 isInInteractiveMode(false), -
700 -
701 isInRubberBandMode(false), -
702 -
703 isShadeMode(false), -
704 ignoreWindowTitleChange(false), -
705 ignoreNextActivationEvent(false), -
706 activationEnabled(true), -
707 isShadeRequestFromMinimizeMode(false), -
708 isMaximizeMode(false), -
709 isWidgetHiddenByUs(false), -
710 isActive(false), -
711 isExplicitlyDeactivated(false), -
712 keyboardSingleStep(5), -
713 keyboardPageStep(20), -
714 resizeTimerId(-1), -
715 currentOperation(None), -
716 hoveredSubControl(QStyle::SC_None), -
717 activeSubControl(QStyle::SC_None), -
718 focusInReason(Qt::ActiveWindowFocusReason) -
719{ -
720 initOperationMap(); -
721}
executed: }
Execution Count:102
102
722 -
723 -
724 -
725 -
726void QMdiSubWindowPrivate::_q_updateStaysOnTopHint() -
727{ -
728 -
729 QMdiSubWindow * const q = q_func(); -
730 if (QAction *senderAction = qobject_cast<QAction *>(q->sender())) {
never evaluated: QAction *senderAction = qobject_cast<QAction *>(q->sender())
0
731 if (senderAction->isChecked()) {
never evaluated: senderAction->isChecked()
0
732 q->setWindowFlags(q->windowFlags() | Qt::WindowStaysOnTopHint); -
733 q->raise(); -
734 } else {
never executed: }
0
735 q->setWindowFlags(q->windowFlags() & ~Qt::WindowStaysOnTopHint); -
736 q->lower(); -
737 }
never executed: }
0
738 } -
739 -
740}
never executed: }
0
741 -
742 -
743 -
744 -
745void QMdiSubWindowPrivate::_q_enterInteractiveMode() -
746{ -
747 -
748 QMdiSubWindow * const q = q_func(); -
749 QAction *action = qobject_cast<QAction *>(q->sender()); -
750 if (!action)
never evaluated: !action
0
751 return;
never executed: return;
0
752 -
753 QPoint pressPos; -
754 if (actions[MoveAction] && actions[MoveAction] == action) {
never evaluated: actions[MoveAction]
never evaluated: actions[MoveAction] == action
0
755 currentOperation = Move; -
756 pressPos = QPoint(q->width() / 2, titleBarHeight() - 1); -
757 } else if (actions[ResizeAction] && actions[ResizeAction] == action) {
never executed: }
never evaluated: actions[ResizeAction]
never evaluated: actions[ResizeAction] == action
0
758 currentOperation = q->isLeftToRight() ? BottomRightResize : BottomLeftResize;
never evaluated: q->isLeftToRight()
0
759 int offset = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q) / 2; -
760 int x = q->isLeftToRight() ? q->width() - offset : offset;
never evaluated: q->isLeftToRight()
0
761 pressPos = QPoint(x, q->height() - offset); -
762 } else {
never executed: }
0
763 return;
never executed: return;
0
764 } -
765 -
766 updateCursor(); -
767 -
768 q->cursor().setPos(q->mapToGlobal(pressPos)); -
769 -
770 mousePressPosition = q->mapToParent(pressPos); -
771 oldGeometry = q->geometry(); -
772 isInInteractiveMode = true; -
773 q->setFocus(); -
774 -
775 if ((q->testOption(QMdiSubWindow::RubberBandResize)
never evaluated: q->testOption(QMdiSubWindow::RubberBandResize)
0
776 && (currentOperation == BottomRightResize || currentOperation == BottomLeftResize))
never evaluated: currentOperation == BottomRightResize
never evaluated: currentOperation == BottomLeftResize
0
777 || (q->testOption(QMdiSubWindow::RubberBandMove) && currentOperation == Move)) {
never evaluated: q->testOption(QMdiSubWindow::RubberBandMove)
never evaluated: currentOperation == Move
0
778 enterRubberBandMode(); -
779 } else
never executed: }
0
780 -
781 { -
782 q->grabMouse(); -
783 }
never executed: }
0
784 -
785} -
786 -
787 -
788 -
789 -
790void QMdiSubWindowPrivate::_q_processFocusChanged(QWidget *old, QWidget *now) -
791{ -
792 (void)old;; -
793 QMdiSubWindow * const q = q_func(); -
794 if (now && (now == q || q->isAncestorOf(now))) {
evaluated: now
TRUEFALSE
yes
Evaluation Count:391
yes
Evaluation Count:271
evaluated: now == q
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:289
evaluated: q->isAncestorOf(now)
TRUEFALSE
yes
Evaluation Count:73
yes
Evaluation Count:216
73-391
795 if (now == q && !isInInteractiveMode)
evaluated: now == q
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:73
partially evaluated: !isInInteractiveMode
TRUEFALSE
yes
Evaluation Count:102
no
Evaluation Count:0
0-102
796 setFocusWidget();
executed: setFocusWidget();
Execution Count:102
102
797 setActive(true); -
798 }
executed: }
Execution Count:175
175
799}
executed: }
Execution Count:662
662
800 -
801 -
802 -
803 -
804void QMdiSubWindowPrivate::leaveInteractiveMode() -
805{ -
806 QMdiSubWindow * const q = q_func(); -
807 -
808 if (isInRubberBandMode)
never evaluated: isInRubberBandMode
0
809 leaveRubberBandMode();
never executed: leaveRubberBandMode();
0
810 else -
811 -
812 q->releaseMouse();
never executed: q->releaseMouse();
0
813 isInInteractiveMode = false; -
814 currentOperation = None; -
815 updateDirtyRegions(); -
816 updateCursor(); -
817 if (baseWidget && baseWidget->focusWidget())
never evaluated: baseWidget
never evaluated: baseWidget->focusWidget()
0
818 baseWidget->focusWidget()->setFocus();
never executed: baseWidget->focusWidget()->setFocus();
0
819}
never executed: }
0
820 -
821 -
822 -
823 -
824void QMdiSubWindowPrivate::removeBaseWidget() -
825{ -
826 if (!baseWidget)
evaluated: !baseWidget
TRUEFALSE
yes
Evaluation Count:99
yes
Evaluation Count:3
3-99
827 return;
executed: return;
Execution Count:99
99
828 -
829 QMdiSubWindow * const q = q_func(); -
830 baseWidget->removeEventFilter(q); -
831 if (layout)
partially evaluated: layout
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
832 layout->removeWidget(baseWidget);
executed: layout->removeWidget(baseWidget);
Execution Count:3
3
833 if (baseWidget->windowTitle() == q->windowTitle()) {
partially evaluated: baseWidget->windowTitle() == q->windowTitle()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
834 ignoreWindowTitleChange = true; -
835 q->setWindowTitle(QString()); -
836 ignoreWindowTitleChange = false; -
837 q->setWindowModified(false); -
838 }
executed: }
Execution Count:3
3
839 lastChildWindowTitle.clear(); -
840 baseWidget->setParent(0); -
841 baseWidget = 0; -
842 isWidgetHiddenByUs = false; -
843}
executed: }
Execution Count:3
3
844 -
845 -
846 -
847 -
848void QMdiSubWindowPrivate::initOperationMap() -
849{ -
850 operationMap.insert(Move, OperationInfo(HMove | VMove, Qt::ArrowCursor, false)); -
851 operationMap.insert(TopResize, OperationInfo(VMove | VResize | VResizeReverse, Qt::SizeVerCursor)); -
852 operationMap.insert(BottomResize, OperationInfo(VResize, Qt::SizeVerCursor)); -
853 operationMap.insert(LeftResize, OperationInfo(HMove | HResize | HResizeReverse, Qt::SizeHorCursor)); -
854 operationMap.insert(RightResize, OperationInfo(HResize, Qt::SizeHorCursor)); -
855 operationMap.insert(TopLeftResize, OperationInfo(HMove | VMove | HResize | VResize | VResizeReverse -
856 | HResizeReverse, Qt::SizeFDiagCursor)); -
857 operationMap.insert(TopRightResize, OperationInfo(VMove | HResize | VResize -
858 | VResizeReverse, Qt::SizeBDiagCursor)); -
859 operationMap.insert(BottomLeftResize, OperationInfo(HMove | HResize | VResize | HResizeReverse, -
860 Qt::SizeBDiagCursor)); -
861 operationMap.insert(BottomRightResize, OperationInfo(HResize | VResize, Qt::SizeFDiagCursor)); -
862}
executed: }
Execution Count:102
102
863 -
864 -
865 -
866 -
867 -
868 -
869void QMdiSubWindowPrivate::createSystemMenu() -
870{ -
871 QMdiSubWindow * const q = q_func(); -
872 qt_noop(); -
873 -
874 systemMenu = new QMenu(q); -
875 const QStyle *style = q->style(); -
876 addToSystemMenu(RestoreAction, QMdiSubWindow::tr("&Restore"), "1""showNormal()"); -
877 actions[RestoreAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarNormalButton, 0, q)); -
878 actions[RestoreAction]->setEnabled(false); -
879 addToSystemMenu(MoveAction, QMdiSubWindow::tr("&Move"), "1""_q_enterInteractiveMode()"); -
880 addToSystemMenu(ResizeAction, QMdiSubWindow::tr("&Size"), "1""_q_enterInteractiveMode()"); -
881 addToSystemMenu(MinimizeAction, QMdiSubWindow::tr("Mi&nimize"), "1""showMinimized()"); -
882 actions[MinimizeAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarMinButton, 0, q)); -
883 addToSystemMenu(MaximizeAction, QMdiSubWindow::tr("Ma&ximize"), "1""showMaximized()"); -
884 actions[MaximizeAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarMaxButton, 0, q)); -
885 addToSystemMenu(StayOnTopAction, QMdiSubWindow::tr("Stay on &Top"), "1""_q_updateStaysOnTopHint()"); -
886 actions[StayOnTopAction]->setCheckable(true); -
887 systemMenu->addSeparator(); -
888 addToSystemMenu(CloseAction, QMdiSubWindow::tr("&Close"), "1""close()"); -
889 actions[CloseAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarCloseButton, 0, q)); -
890 -
891 actions[CloseAction]->setShortcuts(QKeySequence::Close); -
892 -
893 updateActions(); -
894}
executed: }
Execution Count:102
102
895 -
896 -
897 -
898 -
899 -
900void QMdiSubWindowPrivate::updateCursor() -
901{ -
902 -
903 QMdiSubWindow * const q = q_func(); -
904 -
905 -
906 -
907 -
908 -
909 if (currentOperation == None) {
evaluated: currentOperation == None
TRUEFALSE
yes
Evaluation Count:95
yes
Evaluation Count:19
19-95
910 q->unsetCursor(); -
911 return;
executed: return;
Execution Count:95
95
912 } -
913 -
914 if (currentOperation == Move || operationMap.find(currentOperation).value().hover) {
evaluated: currentOperation == Move
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:7
partially evaluated: operationMap.find(currentOperation).value().hover
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-12
915 q->setCursor(operationMap.find(currentOperation).value().cursorShape); -
916 return;
executed: return;
Execution Count:19
19
917 } -
918 -
919}
never executed: }
0
920 -
921 -
922 -
923 -
924void QMdiSubWindowPrivate::updateDirtyRegions() -
925{ -
926 -
927 if (!parent)
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:938
28-938
928 return;
executed: return;
Execution Count:28
28
929 -
930 for (QForeachContainer<__typeof__(operationMap.keys())> _container_(operationMap.keys()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (Operation operation = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
931 operationMap.find(operation).value().region = getRegion(operation);
executed: operationMap.find(operation).value().region = getRegion(operation);
Execution Count:8442
8442
932}
executed: }
Execution Count:938
938
933 -
934 -
935 -
936 -
937void QMdiSubWindowPrivate::updateGeometryConstraints() -
938{ -
939 QMdiSubWindow * const q = q_func(); -
940 if (!parent)
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:589
69-589
941 return;
executed: return;
Execution Count:69
69
942 -
943 internalMinimumSize = (!q->isMinimized() && !q->minimumSize().isNull())
evaluated: !q->isMinimized()
TRUEFALSE
yes
Evaluation Count:555
yes
Evaluation Count:34
evaluated: !q->minimumSize().isNull()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:547
8-555
944 ? q->minimumSize() : q->minimumSizeHint(); -
945 int margin, minWidth; -
946 sizeParameters(&margin, &minWidth); -
947 q->setContentsMargins(margin, titleBarHeight(), margin, margin); -
948 if (q->isMaximized() || (q->isMinimized() && !q->isShaded())) {
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:93
yes
Evaluation Count:496
evaluated: q->isMinimized()
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:462
evaluated: !q->isShaded()
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:10
10-496
949 moveEnabled = false; -
950 resizeEnabled = false; -
951 } else {
executed: }
Execution Count:117
117
952 moveEnabled = true; -
953 if ((q->windowFlags() & Qt::MSWindowsFixedSizeDialogHint) || q->isShaded())
partially evaluated: (q->windowFlags() & Qt::MSWindowsFixedSizeDialogHint)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:472
evaluated: q->isShaded()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:462
0-472
954 resizeEnabled = false;
executed: resizeEnabled = false;
Execution Count:10
10
955 else -
956 resizeEnabled = true;
executed: resizeEnabled = true;
Execution Count:462
462
957 } -
958 updateDirtyRegions(); -
959}
executed: }
Execution Count:589
589
960 -
961 -
962 -
963 -
964void QMdiSubWindowPrivate::updateMask() -
965{ -
966 QMdiSubWindow * const q = q_func(); -
967 if (!q->mask().isEmpty())
partially evaluated: !q->mask().isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:767
0-767
968 q->clearMask();
never executed: q->clearMask();
0
969 -
970 if (!parent)
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:739
28-739
971 return;
executed: return;
Execution Count:28
28
972 -
973 if ((q->isMaximized() && !drawTitleBarWhenMaximized())
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:152
yes
Evaluation Count:587
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:92
60-587
974 || q->windowFlags() & Qt::FramelessWindowHint)
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:679
0-679
975 return;
executed: return;
Execution Count:60
60
976 -
977 if (resizeTimerId == -1)
evaluated: resizeTimerId == -1
TRUEFALSE
yes
Evaluation Count:375
yes
Evaluation Count:304
304-375
978 cachedStyleOptions = titleBarOptions();
executed: cachedStyleOptions = titleBarOptions();
Execution Count:375
375
979 cachedStyleOptions.rect = q->rect(); -
980 QStyleHintReturnMask frameMask; -
981 q->style()->styleHint(QStyle::SH_WindowFrame_Mask, &cachedStyleOptions, q, &frameMask); -
982 if (!frameMask.region.isEmpty())
partially evaluated: !frameMask.region.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:679
0-679
983 q->setMask(frameMask.region);
never executed: q->setMask(frameMask.region);
0
984}
executed: }
Execution Count:679
679
985 -
986 -
987 -
988 -
989void QMdiSubWindowPrivate::setNewGeometry(const QPoint &pos) -
990{ -
991 QMdiSubWindow * const q = q_func(); -
992 qt_noop(); -
993 qt_noop(); -
994 -
995 uint cflags = operationMap.find(currentOperation).value().changeFlags; -
996 int posX = pos.x(); -
997 int posY = pos.y(); -
998 -
999 const bool restrictHorizontal = !q->testOption(QMdiSubWindow::AllowOutsideAreaHorizontally); -
1000 const bool restrictVertical = !q->testOption(QMdiSubWindow::AllowOutsideAreaVertically); -
1001 -
1002 if (restrictHorizontal || restrictVertical) {
partially evaluated: restrictHorizontal
TRUEFALSE
yes
Evaluation Count:351
no
Evaluation Count:0
never evaluated: restrictVertical
0-351
1003 QRect parentRect = q->parentWidget()->rect(); -
1004 if (restrictVertical && (cflags & VResizeReverse || currentOperation == Move)) {
partially evaluated: restrictVertical
TRUEFALSE
yes
Evaluation Count:351
no
Evaluation Count:0
partially evaluated: cflags & VResizeReverse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:351
evaluated: currentOperation == Move
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:311
0-351
1005 posY = qMin(qMax(mousePressPosition.y() - oldGeometry.y(), posY), -
1006 parentRect.height() - BoundaryMargin); -
1007 }
executed: }
Execution Count:40
40
1008 if (currentOperation == Move) {
evaluated: currentOperation == Move
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:311
40-311
1009 if (restrictHorizontal)
partially evaluated: restrictHorizontal
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
1010 posX = qMin(qMax(BoundaryMargin, posX), parentRect.width() - BoundaryMargin);
executed: posX = qMin(qMax(BoundaryMargin, posX), parentRect.width() - BoundaryMargin);
Execution Count:40
40
1011 if (restrictVertical)
partially evaluated: restrictVertical
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
1012 posY = qMin(posY, parentRect.height() - BoundaryMargin);
executed: posY = qMin(posY, parentRect.height() - BoundaryMargin);
Execution Count:40
40
1013 } else {
executed: }
Execution Count:40
40
1014 if (restrictHorizontal) {
partially evaluated: restrictHorizontal
TRUEFALSE
yes
Evaluation Count:311
no
Evaluation Count:0
0-311
1015 if (cflags & HResizeReverse)
partially evaluated: cflags & HResizeReverse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:311
0-311
1016 posX = qMax(mousePressPosition.x() - oldGeometry.x(), posX);
never executed: posX = qMax(mousePressPosition.x() - oldGeometry.x(), posX);
0
1017 else -
1018 posX = qMin(parentRect.width() - (oldGeometry.x() + oldGeometry.width() 311
1019 - mousePressPosition.x()), posX);
executed: posX = qMin(parentRect.width() - (oldGeometry.x() + oldGeometry.width() - mousePressPosition.x()), posX);
Execution Count:311
311
1020 } -
1021 if (restrictVertical && !(cflags & VResizeReverse)) {
partially evaluated: restrictVertical
TRUEFALSE
yes
Evaluation Count:311
no
Evaluation Count:0
partially evaluated: !(cflags & VResizeReverse)
TRUEFALSE
yes
Evaluation Count:311
no
Evaluation Count:0
0-311
1022 posY = qMin(parentRect.height() - (oldGeometry.y() + oldGeometry.height() -
1023 - mousePressPosition.y()), posY); -
1024 }
executed: }
Execution Count:311
311
1025 }
executed: }
Execution Count:311
311
1026 } -
1027 -
1028 QRect geometry; -
1029 if (cflags & (HMove | VMove)) {
evaluated: cflags & (HMove | VMove)
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:311
40-311
1030 int dx = getMoveDeltaComponent(cflags, HMove, HResize, posX - mousePressPosition.x(), -
1031 oldGeometry.width() - internalMinimumSize.width(), -
1032 oldGeometry.width() - q->maximumWidth()); -
1033 int dy = getMoveDeltaComponent(cflags, VMove, VResize, posY - mousePressPosition.y(), -
1034 oldGeometry.height() - internalMinimumSize.height(), -
1035 oldGeometry.height() - q->maximumHeight()); -
1036 geometry.setTopLeft(oldGeometry.topLeft() + QPoint(dx, dy)); -
1037 } else {
executed: }
Execution Count:40
40
1038 geometry.setTopLeft(q->geometry().topLeft()); -
1039 }
executed: }
Execution Count:311
311
1040 -
1041 if (cflags & (HResize | VResize)) {
evaluated: cflags & (HResize | VResize)
TRUEFALSE
yes
Evaluation Count:311
yes
Evaluation Count:40
40-311
1042 int dx = getResizeDeltaComponent(cflags, HResize, HResizeReverse, -
1043 posX - mousePressPosition.x()); -
1044 int dy = getResizeDeltaComponent(cflags, VResize, VResizeReverse, -
1045 posY - mousePressPosition.y()); -
1046 geometry.setSize(oldGeometry.size() + QSize(dx, dy)); -
1047 } else {
executed: }
Execution Count:311
311
1048 geometry.setSize(q->geometry().size()); -
1049 }
executed: }
Execution Count:40
40
1050 -
1051 setNewGeometry(&geometry); -
1052}
executed: }
Execution Count:351
351
1053 -
1054 -
1055 -
1056 -
1057void QMdiSubWindowPrivate::setMinimizeMode() -
1058{ -
1059 QMdiSubWindow * const q = q_func(); -
1060 qt_noop(); -
1061 -
1062 ensureWindowState(Qt::WindowMinimized); -
1063 isShadeRequestFromMinimizeMode = true; -
1064 q->showShaded(); -
1065 isShadeRequestFromMinimizeMode = false; -
1066 -
1067 moveEnabled = false; -
1068 -
1069 setEnabled(MoveAction, moveEnabled); -
1070 -
1071 -
1072 qt_noop(); -
1073 qt_noop(); -
1074 -
1075 -
1076 -
1077 -
1078 -
1079 setActive(true); -
1080}
executed: }
Execution Count:16
16
1081 -
1082 -
1083 -
1084 -
1085void QMdiSubWindowPrivate::setNormalMode() -
1086{ -
1087 QMdiSubWindow * const q = q_func(); -
1088 qt_noop(); -
1089 -
1090 isShadeMode = false; -
1091 isMaximizeMode = false; -
1092 -
1093 ensureWindowState(Qt::WindowNoState); -
1094 -
1095 removeButtonsFromMenuBar(); -
1096 -
1097 -
1098 -
1099 -
1100 const bool wasVisible = q->isVisible(); -
1101 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
1102 q->setVisible(false);
executed: q->setVisible(false);
Execution Count:57
57
1103 -
1104 -
1105 if (!userMinimumSize.isNull()) {
evaluated: !userMinimumSize.isNull()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:56
1-56
1106 q->setMinimumSize(userMinimumSize); -
1107 userMinimumSize = QSize(0, 0); -
1108 }
executed: }
Execution Count:1
1
1109 -
1110 -
1111 if (baseWidget && isWidgetHiddenByUs) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:3
evaluated: isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:39
3-54
1112 baseWidget->show(); -
1113 isWidgetHiddenByUs = false; -
1114 }
executed: }
Execution Count:15
15
1115 -
1116 updateGeometryConstraints(); -
1117 QRect newGeometry = oldGeometry; -
1118 newGeometry.setSize(restoreSize.expandedTo(internalMinimumSize)); -
1119 q->setGeometry(newGeometry); -
1120 -
1121 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
1122 q->setVisible(true);
executed: q->setVisible(true);
Execution Count:57
57
1123 -
1124 -
1125 restoreSize.setWidth(-1); -
1126 restoreSize.setHeight(-1); -
1127 -
1128 -
1129 setSizeGripVisible(true); -
1130 -
1131 -
1132 -
1133 setEnabled(MoveAction, true); -
1134 setEnabled(MaximizeAction, true); -
1135 setEnabled(MinimizeAction, true); -
1136 setEnabled(RestoreAction, false); -
1137 setEnabled(ResizeAction, resizeEnabled); -
1138 -
1139 -
1140 qt_noop(); -
1141 -
1142 -
1143 -
1144 qt_noop(); -
1145 -
1146 qt_noop(); -
1147 -
1148 setActive(true); -
1149 restoreFocus(); -
1150 updateMask(); -
1151}
executed: }
Execution Count:57
57
1152 -
1153 -
1154 -
1155 -
1156void QMdiSubWindowPrivate::setMaximizeMode() -
1157{ -
1158 QMdiSubWindow * const q = q_func(); -
1159 qt_noop(); -
1160 -
1161 ensureWindowState(Qt::WindowMaximized); -
1162 isShadeMode = false; -
1163 isMaximizeMode = true; -
1164 -
1165 if (!restoreFocusWidget && q->isAncestorOf(QApplication::focusWidget()))
evaluated: !restoreFocusWidget
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:4
evaluated: q->isAncestorOf(QApplication::focusWidget())
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:21
4-53
1166 restoreFocusWidget = QApplication::focusWidget();
executed: restoreFocusWidget = QApplication::focusWidget();
Execution Count:32
32
1167 -
1168 -
1169 setSizeGripVisible(false); -
1170 -
1171 -
1172 -
1173 if (!restoreSize.isValid()) {
evaluated: !restoreSize.isValid()
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:4
4-53
1174 oldGeometry = q->geometry(); -
1175 restoreSize.setWidth(oldGeometry.width()); -
1176 restoreSize.setHeight(oldGeometry.height()); -
1177 }
executed: }
Execution Count:53
53
1178 -
1179 -
1180 -
1181 const bool wasVisible = q->isVisible(); -
1182 if (wasVisible)
evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:4
4-53
1183 q->setVisible(false);
executed: q->setVisible(false);
Execution Count:53
53
1184 -
1185 -
1186 if (baseWidget && isWidgetHiddenByUs) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:6
evaluated: isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:48
3-51
1187 baseWidget->show(); -
1188 isWidgetHiddenByUs = false; -
1189 }
executed: }
Execution Count:3
3
1190 -
1191 updateGeometryConstraints(); -
1192 -
1193 if (wasVisible) {
evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:4
4-53
1194 -
1195 if (QMenuBar *mBar = menuBar())
evaluated: QMenuBar *mBar = menuBar()
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:27
26-27
1196 showButtonsInMenuBar(mBar);
executed: showButtonsInMenuBar(mBar);
Execution Count:26
26
1197 else -
1198 -
1199 if (!controlContainer)
partially evaluated: !controlContainer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
1200 controlContainer = new ControlContainer(q);
never executed: controlContainer = new ControlContainer(q);
0
1201 } -
1202 -
1203 QWidget *parent = q->parentWidget(); -
1204 QRect availableRect = parent->contentsRect(); -
1205 -
1206 -
1207 QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent->parentWidget()); -
1208 if (scrollArea && scrollArea->viewport() == parent) {
partially evaluated: scrollArea
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
partially evaluated: scrollArea->viewport() == parent
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
1209 QScrollBar *hbar = scrollArea->horizontalScrollBar(); -
1210 QScrollBar *vbar = scrollArea->verticalScrollBar(); -
1211 const int xOffset = hbar ? hbar->value() : 0;
partially evaluated: hbar
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
1212 const int yOffset = vbar ? vbar->value() : 0;
partially evaluated: vbar
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
1213 availableRect.adjust(-xOffset, -yOffset, -xOffset, -yOffset); -
1214 oldGeometry.adjust(xOffset, yOffset, xOffset, yOffset); -
1215 }
executed: }
Execution Count:57
57
1216 -
1217 setNewGeometry(&availableRect); -
1218 -
1219 ensureWindowState(Qt::WindowMaximized); -
1220 -
1221 if (wasVisible)
evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:4
4-53
1222 q->setVisible(true);
executed: q->setVisible(true);
Execution Count:53
53
1223 -
1224 resizeEnabled = false; -
1225 moveEnabled = false; -
1226 -
1227 -
1228 setEnabled(MoveAction, moveEnabled); -
1229 setEnabled(MaximizeAction, false); -
1230 setEnabled(MinimizeAction, true); -
1231 setEnabled(RestoreAction, true); -
1232 setEnabled(ResizeAction, resizeEnabled); -
1233 -
1234 -
1235 qt_noop(); -
1236 qt_noop(); -
1237 -
1238 restoreFocus(); -
1239 updateMask(); -
1240}
executed: }
Execution Count:57
57
1241 -
1242 -
1243 -
1244 -
1245void QMdiSubWindowPrivate::setActive(bool activate, bool changeFocus) -
1246{ -
1247 QMdiSubWindow * const q = q_func(); -
1248 if (!parent || !activationEnabled)
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:1137
evaluated: !activationEnabled
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:1125
12-1137
1249 return;
executed: return;
Execution Count:44
44
1250 -
1251 if (activate && !isActive && q->isEnabled()) {
evaluated: activate
TRUEFALSE
yes
Evaluation Count:798
yes
Evaluation Count:327
evaluated: !isActive
TRUEFALSE
yes
Evaluation Count:138
yes
Evaluation Count:660
partially evaluated: q->isEnabled()
TRUEFALSE
yes
Evaluation Count:138
no
Evaluation Count:0
0-798
1252 isActive = true; -
1253 isExplicitlyDeactivated = false; -
1254 Qt::WindowStates oldWindowState = q->windowState(); -
1255 ensureWindowState(Qt::WindowActive); -
1256 q->aboutToActivate(); -
1257 -
1258 if (QMenuBar *mBar = menuBar())
evaluated: QMenuBar *mBar = menuBar()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:132
6-132
1259 showButtonsInMenuBar(mBar);
executed: showButtonsInMenuBar(mBar);
Execution Count:6
6
1260 -
1261 qt_noop(); -
1262 q->windowStateChanged(oldWindowState, q->windowState()); -
1263 } else if (!activate && isActive) {
executed: }
Execution Count:138
evaluated: !activate
TRUEFALSE
yes
Evaluation Count:327
yes
Evaluation Count:660
evaluated: isActive
TRUEFALSE
yes
Evaluation Count:138
yes
Evaluation Count:189
138-660
1264 isActive = false; -
1265 Qt::WindowStates oldWindowState = q->windowState(); -
1266 q->overrideWindowState(q->windowState() & ~Qt::WindowActive); -
1267 if (changeFocus) {
evaluated: changeFocus
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:36
36-102
1268 QWidget *focusWidget = QApplication::focusWidget(); -
1269 if (focusWidget && (focusWidget == q || q->isAncestorOf(focusWidget)))
evaluated: focusWidget
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:24
evaluated: focusWidget == q
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:33
evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3
3-78
1270 focusWidget->clearFocus();
executed: focusWidget->clearFocus();
Execution Count:75
75
1271 }
executed: }
Execution Count:102
102
1272 if (baseWidget)
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:8
8-130
1273 baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive);
executed: baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive);
Execution Count:130
130
1274 qt_noop(); -
1275 q->windowStateChanged(oldWindowState, q->windowState()); -
1276 }
executed: }
Execution Count:138
138
1277 -
1278 if (activate && isActive && q->isEnabled() && !q->hasFocus()
evaluated: activate
TRUEFALSE
yes
Evaluation Count:798
yes
Evaluation Count:327
partially evaluated: isActive
TRUEFALSE
yes
Evaluation Count:798
no
Evaluation Count:0
partially evaluated: q->isEnabled()
TRUEFALSE
yes
Evaluation Count:798
no
Evaluation Count:0
evaluated: !q->hasFocus()
TRUEFALSE
yes
Evaluation Count:502
yes
Evaluation Count:296
0-798
1279 && !q->isAncestorOf(QApplication::focusWidget())) {
evaluated: !q->isAncestorOf(QApplication::focusWidget())
TRUEFALSE
yes
Evaluation Count:243
yes
Evaluation Count:259
243-259
1280 if (changeFocus)
evaluated: changeFocus
TRUEFALSE
yes
Evaluation Count:192
yes
Evaluation Count:51
51-192
1281 setFocusWidget();
executed: setFocusWidget();
Execution Count:192
192
1282 ensureWindowState(Qt::WindowActive); -
1283 }
executed: }
Execution Count:243
243
1284 -
1285 int frameWidth = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); -
1286 int titleBarHeight = this->titleBarHeight(); -
1287 QRegion windowDecoration = QRegion(0, 0, q->width(), q->height()); -
1288 windowDecoration -= QRegion(frameWidth, titleBarHeight, q->width() - 2 * frameWidth, -
1289 q->height() - titleBarHeight - frameWidth); -
1290 -
1291 -
1292 -
1293 if (resizeTimerId != -1) {
evaluated: resizeTimerId != -1
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:1103
22-1103
1294 q->killTimer(resizeTimerId); -
1295 resizeTimerId = -1; -
1296 updateDirtyRegions(); -
1297 }
executed: }
Execution Count:22
22
1298 -
1299 q->update(windowDecoration); -
1300}
executed: }
Execution Count:1125
1125
1301 -
1302 -
1303 -
1304 -
1305void QMdiSubWindowPrivate::processClickedSubControl() -
1306{ -
1307 QMdiSubWindow * const q = q_func(); -
1308 switch (activeSubControl) { -
1309 case QStyle::SC_TitleBarContextHelpButton: -
1310 -
1311 QWhatsThis::enterWhatsThisMode(); -
1312 -
1313 break;
never executed: break;
0
1314 case QStyle::SC_TitleBarShadeButton: -
1315 q->showShaded(); -
1316 hoveredSubControl = QStyle::SC_TitleBarUnshadeButton; -
1317 break;
never executed: break;
0
1318 case QStyle::SC_TitleBarUnshadeButton: -
1319 if (q->isShaded())
never evaluated: q->isShaded()
0
1320 hoveredSubControl = QStyle::SC_TitleBarShadeButton;
never executed: hoveredSubControl = QStyle::SC_TitleBarShadeButton;
0
1321 q->showNormal(); -
1322 break;
never executed: break;
0
1323 case QStyle::SC_TitleBarMinButton: -
1324 q->showMinimized(); -
1325 break;
never executed: break;
0
1326 case QStyle::SC_TitleBarNormalButton: -
1327 if (q->isShaded())
never evaluated: q->isShaded()
0
1328 hoveredSubControl = QStyle::SC_TitleBarMinButton;
never executed: hoveredSubControl = QStyle::SC_TitleBarMinButton;
0
1329 q->showNormal(); -
1330 break;
never executed: break;
0
1331 case QStyle::SC_TitleBarMaxButton: -
1332 q->showMaximized(); -
1333 break;
never executed: break;
0
1334 case QStyle::SC_TitleBarCloseButton: -
1335 q->close(); -
1336 break;
never executed: break;
0
1337 default: -
1338 break;
never executed: break;
0
1339 } -
1340}
never executed: }
0
1341 -
1342 -
1343 -
1344 -
1345QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const -
1346{ -
1347 const QMdiSubWindow * const q = q_func(); -
1348 int width = q->width(); -
1349 int height = q->height(); -
1350 int titleBarHeight = this->titleBarHeight(); -
1351 int frameWidth = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); -
1352 int cornerConst = titleBarHeight - frameWidth; -
1353 int titleBarConst = 2 * titleBarHeight; -
1354 -
1355 if (operation == Move) {
evaluated: operation == Move
TRUEFALSE
yes
Evaluation Count:938
yes
Evaluation Count:7504
938-7504
1356 QStyleOptionTitleBar titleBarOptions = this->titleBarOptions(); -
1357 QRegion move(frameWidth, frameWidth, width - 2 * frameWidth, cornerConst); -
1358 -
1359 -
1360 for (int i = 0; i < NumSubControls; ++i) {
evaluated: i < NumSubControls
TRUEFALSE
yes
Evaluation Count:8442
yes
Evaluation Count:938
938-8442
1361 if (SubControls[i] == QStyle::SC_TitleBarLabel)
evaluated: SubControls[i] == QStyle::SC_TitleBarLabel
TRUEFALSE
yes
Evaluation Count:938
yes
Evaluation Count:7504
938-7504
1362 continue;
executed: continue;
Execution Count:938
938
1363 move -= QRegion(q->style()->subControlRect(QStyle::CC_TitleBar, &titleBarOptions, -
1364 SubControls[i])); -
1365 }
executed: }
Execution Count:7504
7504
1366 return move;
executed: return move;
Execution Count:938
938
1367 } -
1368 -
1369 QRegion region; -
1370 -
1371 -
1372 -
1373 -
1374 -
1375 switch (operation) { -
1376 case TopResize: -
1377 region = QRegion(titleBarHeight, 0, width - titleBarConst, frameWidth); -
1378 break;
executed: break;
Execution Count:938
938
1379 case BottomResize: -
1380 region = QRegion(titleBarHeight, height - frameWidth, width - titleBarConst, frameWidth); -
1381 break;
executed: break;
Execution Count:938
938
1382 case LeftResize: -
1383 region = QRegion(0, titleBarHeight, frameWidth, height - titleBarConst); -
1384 break;
executed: break;
Execution Count:938
938
1385 case RightResize: -
1386 region = QRegion(width - frameWidth, titleBarHeight, frameWidth, height - titleBarConst); -
1387 break;
executed: break;
Execution Count:938
938
1388 case TopLeftResize: -
1389 region = QRegion(0, 0, titleBarHeight, titleBarHeight) -
1390 - QRegion(frameWidth, frameWidth, cornerConst, cornerConst); -
1391 break;
executed: break;
Execution Count:938
938
1392 case TopRightResize: -
1393 region = QRegion(width - titleBarHeight, 0, titleBarHeight, titleBarHeight) -
1394 - QRegion(width - titleBarHeight, frameWidth, cornerConst, cornerConst); -
1395 break;
executed: break;
Execution Count:938
938
1396 case BottomLeftResize: -
1397 region = QRegion(0, height - titleBarHeight, titleBarHeight, titleBarHeight) -
1398 - QRegion(frameWidth, height - titleBarHeight, cornerConst, cornerConst); -
1399 break;
executed: break;
Execution Count:938
938
1400 case BottomRightResize: -
1401 region = QRegion(width - titleBarHeight, height - titleBarHeight, titleBarHeight, titleBarHeight) -
1402 - QRegion(width - titleBarHeight, height - titleBarHeight, cornerConst, cornerConst); -
1403 break;
executed: break;
Execution Count:938
938
1404 default: -
1405 break;
never executed: break;
0
1406 } -
1407 -
1408 return region;
executed: return region;
Execution Count:7504
7504
1409} -
1410 -
1411 -
1412 -
1413 -
1414QMdiSubWindowPrivate::Operation QMdiSubWindowPrivate::getOperation(const QPoint &pos) const -
1415{ -
1416 OperationInfoMap::const_iterator it; -
1417 for (it = operationMap.constBegin(); it != operationMap.constEnd(); ++it)
evaluated: it != operationMap.constEnd()
TRUEFALSE
yes
Evaluation Count:121
yes
Evaluation Count:9
9-121
1418 if (it.value().region.contains(pos))
evaluated: it.value().region.contains(pos)
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:109
12-109
1419 return it.key();
executed: return it.key();
Execution Count:12
12
1420 return None;
executed: return None;
Execution Count:9
9
1421} -
1422 -
1423extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); -
1424 -
1425 -
1426 -
1427 -
1428QStyleOptionTitleBar QMdiSubWindowPrivate::titleBarOptions() const -
1429{ -
1430 const QMdiSubWindow * const q = q_func(); -
1431 QStyleOptionTitleBar titleBarOptions; -
1432 titleBarOptions.initFrom(q); -
1433 if (activeSubControl != QStyle::SC_None) {
evaluated: activeSubControl != QStyle::SC_None
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:13921
2-13921
1434 if (hoveredSubControl == activeSubControl) {
partially evaluated: hoveredSubControl == activeSubControl
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1435 titleBarOptions.state |= QStyle::State_Sunken; -
1436 titleBarOptions.activeSubControls = activeSubControl; -
1437 }
executed: }
Execution Count:2
2
1438 } else if (autoRaise() && hoveredSubControl != QStyle::SC_None
executed: }
Execution Count:2
partially evaluated: autoRaise()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13921
never evaluated: hoveredSubControl != QStyle::SC_None
0-13921
1439 && hoveredSubControl != QStyle::SC_TitleBarLabel) {
never evaluated: hoveredSubControl != QStyle::SC_TitleBarLabel
0
1440 titleBarOptions.state |= QStyle::State_MouseOver; -
1441 titleBarOptions.activeSubControls = hoveredSubControl; -
1442 } else {
never executed: }
0
1443 titleBarOptions.state &= ~QStyle::State_MouseOver; -
1444 titleBarOptions.activeSubControls = QStyle::SC_None; -
1445 }
executed: }
Execution Count:13921
13921
1446 -
1447 titleBarOptions.subControls = QStyle::SC_All; -
1448 titleBarOptions.titleBarFlags = q->windowFlags(); -
1449 titleBarOptions.titleBarState = q->windowState(); -
1450 titleBarOptions.palette = titleBarPalette; -
1451 titleBarOptions.icon = menuIcon; -
1452 -
1453 if (isActive) {
evaluated: isActive
TRUEFALSE
yes
Evaluation Count:6419
yes
Evaluation Count:7504
6419-7504
1454 titleBarOptions.state |= QStyle::State_Active; -
1455 titleBarOptions.titleBarState |= QStyle::State_Active; -
1456 titleBarOptions.palette.setCurrentColorGroup(QPalette::Active); -
1457 } else {
executed: }
Execution Count:6419
6419
1458 titleBarOptions.state &= ~QStyle::State_Active; -
1459 titleBarOptions.palette.setCurrentColorGroup(QPalette::Inactive); -
1460 }
executed: }
Execution Count:7504
7504
1461 -
1462 int border = hasBorder(titleBarOptions) ? 4 : 0;
partially evaluated: hasBorder(titleBarOptions)
TRUEFALSE
yes
Evaluation Count:13923
no
Evaluation Count:0
0-13923
1463 int paintHeight = titleBarHeight(titleBarOptions); -
1464 paintHeight -= q->isMinimized() ? 2 * border : border;
evaluated: q->isMinimized()
TRUEFALSE
yes
Evaluation Count:1118
yes
Evaluation Count:12805
1118-12805
1465 titleBarOptions.rect = QRect(border, border, q->width() - 2 * border, paintHeight); -
1466 -
1467 if (!windowTitle.isEmpty()) {
evaluated: !windowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:2451
yes
Evaluation Count:11472
2451-11472
1468 -
1469 -
1470 titleBarOptions.text = windowTitle; -
1471 titleBarOptions.fontMetrics = QFontMetrics(font); -
1472 int width = q->style()->subControlRect(QStyle::CC_TitleBar, &titleBarOptions, -
1473 QStyle::SC_TitleBarLabel, q).width(); -
1474 -
1475 titleBarOptions.text = titleBarOptions.fontMetrics.elidedText(windowTitle, Qt::ElideRight, width); -
1476 }
executed: }
Execution Count:2451
2451
1477 return titleBarOptions;
executed: return titleBarOptions;
Execution Count:13923
13923
1478} -
1479 -
1480 -
1481 -
1482 -
1483void QMdiSubWindowPrivate::ensureWindowState(Qt::WindowState state) -
1484{ -
1485 QMdiSubWindow * const q = q_func(); -
1486 Qt::WindowStates windowStates = q->windowState() | state; -
1487 switch (state) { -
1488 case Qt::WindowMinimized: -
1489 windowStates &= ~Qt::WindowMaximized; -
1490 windowStates &= ~Qt::WindowNoState; -
1491 break;
executed: break;
Execution Count:24
24
1492 case Qt::WindowMaximized: -
1493 windowStates &= ~Qt::WindowMinimized; -
1494 windowStates &= ~Qt::WindowNoState; -
1495 break;
executed: break;
Execution Count:229
229
1496 case Qt::WindowNoState: -
1497 windowStates &= ~Qt::WindowMinimized; -
1498 windowStates &= ~Qt::WindowMaximized; -
1499 break;
executed: break;
Execution Count:72
72
1500 default: -
1501 break;
executed: break;
Execution Count:527
527
1502 } -
1503 if (baseWidget) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:798
yes
Evaluation Count:54
54-798
1504 if (!(baseWidget->windowState() & Qt::WindowActive) && windowStates & Qt::WindowActive)
partially evaluated: !(baseWidget->windowState() & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:798
no
Evaluation Count:0
evaluated: windowStates & Qt::WindowActive
TRUEFALSE
yes
Evaluation Count:740
yes
Evaluation Count:58
0-798
1505 baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive);
executed: baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive);
Execution Count:740
740
1506 else -
1507 baseWidget->overrideWindowState(windowStates);
executed: baseWidget->overrideWindowState(windowStates);
Execution Count:58
58
1508 } -
1509 q->overrideWindowState(windowStates); -
1510}
executed: }
Execution Count:852
852
1511 -
1512 -
1513 -
1514 -
1515int QMdiSubWindowPrivate::titleBarHeight(const QStyleOptionTitleBar &options) const -
1516{ -
1517 const QMdiSubWindow * const q = q_func(); -
1518 if (!parent || q->windowFlags() & Qt::FramelessWindowHint
partially evaluated: !parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13954
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13954
0-13954
1519 || (q->isMaximized() && !drawTitleBarWhenMaximized())) {
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:1719
yes
Evaluation Count:12235
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:190
yes
Evaluation Count:1529
190-12235
1520 return 0;
executed: return 0;
Execution Count:190
190
1521 } -
1522 -
1523 int height = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, q); -
1524 -
1525 -
1526 -
1527 -
1528 -
1529 if (hasBorder(options))
partially evaluated: hasBorder(options)
TRUEFALSE
yes
Evaluation Count:13764
no
Evaluation Count:0
0-13764
1530 height += q->isMinimized() ? 8 : 4;
executed: height += q->isMinimized() ? 8 : 4;
Execution Count:13764
evaluated: q->isMinimized()
TRUEFALSE
yes
Evaluation Count:1118
yes
Evaluation Count:12646
1118-13764
1531 return height;
executed: return height;
Execution Count:13764
13764
1532} -
1533 -
1534 -
1535 -
1536 -
1537void QMdiSubWindowPrivate::sizeParameters(int *margin, int *minWidth) const -
1538{ -
1539 const QMdiSubWindow * const q = q_func(); -
1540 Qt::WindowFlags flags = q->windowFlags(); -
1541 if (!parent || flags & Qt::FramelessWindowHint) {
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:1874
partially evaluated: flags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1874
0-1874
1542 *margin = 0; -
1543 *minWidth = 0; -
1544 return;
executed: return;
Execution Count:16
16
1545 } -
1546 -
1547 if (q->isMaximized() && !drawTitleBarWhenMaximized())
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:207
yes
Evaluation Count:1667
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:101
yes
Evaluation Count:106
101-1667
1548 *margin = 0;
executed: *margin = 0;
Execution Count:101
101
1549 else -
1550 *margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q);
executed: *margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q);
Execution Count:1773
1773
1551 -
1552 QStyleOptionTitleBar opt = this->titleBarOptions(); -
1553 int tempWidth = 0; -
1554 for (int i = 0; i < NumSubControls; ++i) {
evaluated: i < NumSubControls
TRUEFALSE
yes
Evaluation Count:16866
yes
Evaluation Count:1874
1874-16866
1555 if (SubControls[i] == QStyle::SC_TitleBarLabel) {
evaluated: SubControls[i] == QStyle::SC_TitleBarLabel
TRUEFALSE
yes
Evaluation Count:1874
yes
Evaluation Count:14992
1874-14992
1556 tempWidth += 30; -
1557 continue;
executed: continue;
Execution Count:1874
1874
1558 } -
1559 QRect rect = q->style()->subControlRect(QStyle::CC_TitleBar, &opt, SubControls[i], q); -
1560 if (!rect.isValid())
evaluated: !rect.isValid()
TRUEFALSE
yes
Evaluation Count:6182
yes
Evaluation Count:8810
6182-8810
1561 continue;
executed: continue;
Execution Count:6182
6182
1562 tempWidth += rect.width(); -
1563 }
executed: }
Execution Count:8810
8810
1564 *minWidth = tempWidth; -
1565}
executed: }
Execution Count:1874
1874
1566 -
1567 -
1568 -
1569 -
1570bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const -
1571{ -
1572 const QMdiSubWindow * const q = q_func(); -
1573 if (q->window()->testAttribute(Qt::WA_CanHostQMdiSubWindowTitleBar))
partially evaluated: q->window()->testAttribute(Qt::WA_CanHostQMdiSubWindowTitleBar)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5092
0-5092
1574 return false;
never executed: return false;
0
1575 -
1576 if (isChildOfTabbedQMdiArea(q))
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5092
0-5092
1577 return false;
never executed: return false;
0
1578 -
1579 -
1580 -
1581 -
1582 if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q))
partially evaluated: q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5092
0-5092
1583 return true;
never executed: return true;
0
1584 -
1585 -
1586 -
1587 QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window()); -
1588 if (!mainWindow || !qobject_cast<QMenuBar *>(mainWindow->menuWidget())
evaluated: !mainWindow
TRUEFALSE
yes
Evaluation Count:1363
yes
Evaluation Count:3729
evaluated: !qobject_cast<QMenuBar *>(mainWindow->menuWidget())
TRUEFALSE
yes
Evaluation Count:274
yes
Evaluation Count:3455
274-3729
1589 || mainWindow->menuWidget()->isHidden())
evaluated: mainWindow->menuWidget()->isHidden()
TRUEFALSE
yes
Evaluation Count:950
yes
Evaluation Count:2505
950-2505
1590 return true;
executed: return true;
Execution Count:2587
2587
1591 -
1592 return isChildOfQMdiSubWindow(q);
executed: return isChildOfQMdiSubWindow(q);
Execution Count:2505
2505
1593 -
1594 -
1595} -
1596 -
1597 -
1598 -
1599 -
1600 -
1601 -
1602void QMdiSubWindowPrivate::showButtonsInMenuBar(QMenuBar *menuBar) -
1603{ -
1604 QMdiSubWindow * const q = q_func(); -
1605 qt_noop(); -
1606 -
1607 if (isChildOfTabbedQMdiArea(q))
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
0-35
1608 return;
never executed: return;
0
1609 -
1610 removeButtonsFromMenuBar(); -
1611 if (!controlContainer)
partially evaluated: !controlContainer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
0-35
1612 controlContainer = new ControlContainer(q);
never executed: controlContainer = new ControlContainer(q);
0
1613 -
1614 ignoreWindowTitleChange = true; -
1615 controlContainer->showButtonsInMenuBar(menuBar); -
1616 ignoreWindowTitleChange = false; -
1617 -
1618 QWidget *topLevelWindow = q->window(); -
1619 topLevelWindow->setWindowModified(q->isWindowModified()); -
1620 topLevelWindow->installEventFilter(q); -
1621 -
1622 int buttonHeight = 0; -
1623 if (controlContainer->controllerWidget())
evaluated: controlContainer->controllerWidget()
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:1
1-34
1624 buttonHeight = controlContainer->controllerWidget()->height();
executed: buttonHeight = controlContainer->controllerWidget()->height();
Execution Count:34
34
1625 else if (controlContainer->systemMenuLabel())
partially evaluated: controlContainer->systemMenuLabel()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1626 buttonHeight = controlContainer->systemMenuLabel()->height();
never executed: buttonHeight = controlContainer->systemMenuLabel()->height();
0
1627 -
1628 -
1629 if (menuBar && menuBar->height() < buttonHeight
partially evaluated: menuBar
TRUEFALSE
yes
Evaluation Count:35
no
Evaluation Count:0
evaluated: menuBar->height() < buttonHeight
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:22
0-35
1630 && topLevelWindow->layout()) {
partially evaluated: topLevelWindow->layout()
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
1631 -
1632 -
1633 QEvent event(QEvent::LayoutRequest); -
1634 QApplication::sendEvent(topLevelWindow, &event); -
1635 }
executed: }
Execution Count:13
13
1636}
executed: }
Execution Count:35
35
1637 -
1638 -
1639 -
1640 -
1641void QMdiSubWindowPrivate::removeButtonsFromMenuBar() -
1642{ -
1643 QMdiSubWindow * const q = q_func(); -
1644 -
1645 if (!controlContainer || isChildOfTabbedQMdiArea(q))
partially evaluated: !controlContainer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:552
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:552
0-552
1646 return;
never executed: return;
0
1647 -
1648 QMenuBar *currentMenuBar = 0; -
1649 -
1650 if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())) {
evaluated: QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())
TRUEFALSE
yes
Evaluation Count:183
yes
Evaluation Count:369
183-369
1651 -
1652 -
1653 currentMenuBar = qobject_cast<QMenuBar *>(mainWindow->menuWidget()); -
1654 }
executed: }
Execution Count:183
183
1655 -
1656 -
1657 ignoreWindowTitleChange = true; -
1658 controlContainer->removeButtonsFromMenuBar(currentMenuBar); -
1659 ignoreWindowTitleChange = false; -
1660 -
1661 QWidget *topLevelWindow = q->window(); -
1662 topLevelWindow->removeEventFilter(q); -
1663 if (baseWidget && !drawTitleBarWhenMaximized())
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:489
yes
Evaluation Count:63
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:100
yes
Evaluation Count:389
63-489
1664 topLevelWindow->setWindowModified(false);
executed: topLevelWindow->setWindowModified(false);
Execution Count:100
100
1665 originalTitle = QString::null; -
1666}
executed: }
Execution Count:552
552
1667 -
1668 -
1669 -
1670void QMdiSubWindowPrivate::updateWindowTitle(bool isRequestFromChild) -
1671{ -
1672 QMdiSubWindow * const q = q_func(); -
1673 if (isRequestFromChild && !q->windowTitle().isEmpty() && !lastChildWindowTitle.isEmpty()
evaluated: isRequestFromChild
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:9
evaluated: !q->windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:116
partially evaluated: !lastChildWindowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-119
1674 && lastChildWindowTitle != q->windowTitle()) {
evaluated: lastChildWindowTitle != q->windowTitle()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
1675 return;
executed: return;
Execution Count:1
1
1676 } -
1677 -
1678 QWidget *titleWidget = 0; -
1679 if (isRequestFromChild)
evaluated: isRequestFromChild
TRUEFALSE
yes
Evaluation Count:118
yes
Evaluation Count:9
9-118
1680 titleWidget = baseWidget;
executed: titleWidget = baseWidget;
Execution Count:118
118
1681 else -
1682 titleWidget = q;
executed: titleWidget = q;
Execution Count:9
9
1683 if (!titleWidget || titleWidget->windowTitle().isEmpty())
partially evaluated: !titleWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:127
evaluated: titleWidget->windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:106
yes
Evaluation Count:21
0-127
1684 return;
executed: return;
Execution Count:106
106
1685 -
1686 ignoreWindowTitleChange = true; -
1687 q->setWindowTitle(titleWidget->windowTitle()); -
1688 if (q->maximizedButtonsWidget())
partially evaluated: q->maximizedButtonsWidget()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:21
0-21
1689 setNewWindowTitle();
never executed: setNewWindowTitle();
0
1690 ignoreWindowTitleChange = false; -
1691}
executed: }
Execution Count:21
21
1692 -
1693 -
1694void QMdiSubWindowPrivate::enterRubberBandMode() -
1695{ -
1696 QMdiSubWindow * const q = q_func(); -
1697 if (q->isMaximized())
partially evaluated: q->isMaximized()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1698 return;
never executed: return;
0
1699 qt_noop(); -
1700 qt_noop(); -
1701 if (!rubberBand) {
evaluated: !rubberBand
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1702 rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget()); -
1703 -
1704 rubberBand->setObjectName(QLatin1String("qt_rubberband")); -
1705 }
executed: }
Execution Count:1
1
1706 QPoint rubberBandPos = q->mapToParent(QPoint(0, 0)); -
1707 rubberBand->setGeometry(rubberBandPos.x(), rubberBandPos.y(), -
1708 oldGeometry.width(), oldGeometry.height()); -
1709 rubberBand->show(); -
1710 isInRubberBandMode = true; -
1711 q->grabMouse(); -
1712}
executed: }
Execution Count:2
2
1713 -
1714void QMdiSubWindowPrivate::leaveRubberBandMode() -
1715{ -
1716 QMdiSubWindow * const q = q_func(); -
1717 qt_noop(); -
1718 qt_noop(); -
1719 q->releaseMouse(); -
1720 isInRubberBandMode = false; -
1721 q->setGeometry(rubberBand->geometry()); -
1722 rubberBand->hide(); -
1723 currentOperation = None; -
1724}
executed: }
Execution Count:2
2
1725 -
1726 -
1727 -
1728QPalette QMdiSubWindowPrivate::desktopPalette() const -
1729{ -
1730 const QMdiSubWindow * const q = q_func(); -
1731 QPalette newPalette = q->palette(); -
1732 -
1733 bool colorsInitialized = false; -
1734 if (!colorsInitialized) {
partially evaluated: !colorsInitialized
TRUEFALSE
yes
Evaluation Count:204
no
Evaluation Count:0
0-204
1735 newPalette.setColor(QPalette::Active, QPalette::Highlight, -
1736 newPalette.color(QPalette::Active, QPalette::Highlight)); -
1737 newPalette.setColor(QPalette::Active, QPalette::Base, -
1738 newPalette.color(QPalette::Active, QPalette::Highlight)); -
1739 newPalette.setColor(QPalette::Inactive, QPalette::Highlight, -
1740 newPalette.color(QPalette::Inactive, QPalette::Dark)); -
1741 newPalette.setColor(QPalette::Inactive, QPalette::Base, -
1742 newPalette.color(QPalette::Inactive, QPalette::Dark)); -
1743 newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText, -
1744 newPalette.color(QPalette::Inactive, QPalette::Window)); -
1745 }
executed: }
Execution Count:204
204
1746 -
1747 return newPalette;
executed: return newPalette;
Execution Count:204
204
1748} -
1749 -
1750void QMdiSubWindowPrivate::updateActions() -
1751{ -
1752 Qt::WindowFlags windowFlags = q_func()->windowFlags(); -
1753 -
1754 for (int i = 0; i < NumWindowStateActions; ++i)
evaluated: i < NumWindowStateActions
TRUEFALSE
yes
Evaluation Count:2016
yes
Evaluation Count:288
288-2016
1755 setVisible(WindowStateAction(i), false);
executed: setVisible(WindowStateAction(i), false);
Execution Count:2016
2016
1756 -
1757 if (windowFlags & Qt::FramelessWindowHint)
partially evaluated: windowFlags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:288
0-288
1758 return;
never executed: return;
0
1759 -
1760 setVisible(StayOnTopAction, true); -
1761 setVisible(MoveAction, moveEnabled); -
1762 setVisible(ResizeAction, resizeEnabled); -
1763 -
1764 -
1765 if (windowFlags & Qt::WindowSystemMenuHint)
partially evaluated: windowFlags & Qt::WindowSystemMenuHint
TRUEFALSE
yes
Evaluation Count:288
no
Evaluation Count:0
0-288
1766 setVisible(CloseAction, true);
executed: setVisible(CloseAction, true);
Execution Count:288
288
1767 -
1768 -
1769 if (windowFlags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint))
evaluated: windowFlags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint)
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:3
3-285
1770 setVisible(RestoreAction, true);
executed: setVisible(RestoreAction, true);
Execution Count:285
285
1771 -
1772 -
1773 if (windowFlags & Qt::WindowMinimizeButtonHint)
evaluated: windowFlags & Qt::WindowMinimizeButtonHint
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:3
3-285
1774 setVisible(MinimizeAction, true);
executed: setVisible(MinimizeAction, true);
Execution Count:285
285
1775 -
1776 -
1777 if (windowFlags & Qt::WindowMaximizeButtonHint)
evaluated: windowFlags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:3
3-285
1778 setVisible(MaximizeAction, true);
executed: setVisible(MaximizeAction, true);
Execution Count:285
285
1779}
executed: }
Execution Count:288
288
1780 -
1781void QMdiSubWindowPrivate::setFocusWidget() -
1782{ -
1783 QMdiSubWindow * const q = q_func(); -
1784 if (!baseWidget) {
evaluated: !baseWidget
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:306
12-306
1785 q->setFocus(); -
1786 return;
executed: return;
Execution Count:12
12
1787 } -
1788 -
1789 -
1790 -
1791 -
1792 if (focusInReason == Qt::TabFocusReason) {
evaluated: focusInReason == Qt::TabFocusReason
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:302
4-302
1793 q->focusNextChild(); -
1794 return;
executed: return;
Execution Count:4
4
1795 } -
1796 -
1797 -
1798 if (focusInReason == Qt::BacktabFocusReason) {
partially evaluated: focusInReason == Qt::BacktabFocusReason
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:302
0-302
1799 q->focusPreviousChild(); -
1800 return;
never executed: return;
0
1801 } -
1802 -
1803 if (QWidget *focusWidget = baseWidget->focusWidget()) {
evaluated: QWidget *focusWidget = baseWidget->focusWidget()
TRUEFALSE
yes
Evaluation Count:65
yes
Evaluation Count:237
65-237
1804 if (!focusWidget->hasFocus() && q->isAncestorOf(focusWidget)
evaluated: !focusWidget->hasFocus()
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:18
partially evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:47
no
Evaluation Count:0
0-47
1805 && focusWidget->isVisible() && !q->isMinimized()
evaluated: focusWidget->isVisible()
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:21
partially evaluated: !q->isMinimized()
TRUEFALSE
yes
Evaluation Count:26
no
Evaluation Count:0
0-26
1806 && focusWidget->focusPolicy() != Qt::NoFocus) {
partially evaluated: focusWidget->focusPolicy() != Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:26
no
Evaluation Count:0
0-26
1807 focusWidget->setFocus(); -
1808 } else {
executed: }
Execution Count:26
26
1809 q->setFocus(); -
1810 }
executed: }
Execution Count:39
39
1811 return;
executed: return;
Execution Count:65
65
1812 } -
1813 -
1814 QWidget *focusWidget = q->nextInFocusChain(); -
1815 while (focusWidget && focusWidget != q && focusWidget->focusPolicy() == Qt::NoFocus)
partially evaluated: focusWidget
TRUEFALSE
yes
Evaluation Count:1711
no
Evaluation Count:0
evaluated: focusWidget != q
TRUEFALSE
yes
Evaluation Count:1547
yes
Evaluation Count:164
evaluated: focusWidget->focusPolicy() == Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:1474
yes
Evaluation Count:73
0-1711
1816 focusWidget = focusWidget->nextInFocusChain();
executed: focusWidget = focusWidget->nextInFocusChain();
Execution Count:1474
1474
1817 if (focusWidget && q->isAncestorOf(focusWidget))
partially evaluated: focusWidget
TRUEFALSE
yes
Evaluation Count:237
no
Evaluation Count:0
evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:201
yes
Evaluation Count:36
0-237
1818 focusWidget->setFocus();
executed: focusWidget->setFocus();
Execution Count:201
201
1819 else if (baseWidget->focusPolicy() != Qt::NoFocus)
partially evaluated: baseWidget->focusPolicy() != Qt::NoFocus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:36
0-36
1820 baseWidget->setFocus();
never executed: baseWidget->setFocus();
0
1821 else if (!q->hasFocus())
evaluated: !q->hasFocus()
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:16
16-20
1822 q->setFocus();
executed: q->setFocus();
Execution Count:20
20
1823} -
1824 -
1825void QMdiSubWindowPrivate::restoreFocus() -
1826{ -
1827 if (!restoreFocusWidget)
evaluated: !restoreFocusWidget
TRUEFALSE
yes
Evaluation Count:64
yes
Evaluation Count:50
50-64
1828 return;
executed: return;
Execution Count:64
64
1829 if (!restoreFocusWidget->hasFocus() && q_func()->isAncestorOf(restoreFocusWidget)
evaluated: !restoreFocusWidget->hasFocus()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:40
partially evaluated: q_func()->isAncestorOf(restoreFocusWidget)
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-40
1830 && restoreFocusWidget->isVisible()
partially evaluated: restoreFocusWidget->isVisible()
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
1831 && restoreFocusWidget->focusPolicy() != Qt::NoFocus) {
partially evaluated: restoreFocusWidget->focusPolicy() != Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
1832 restoreFocusWidget->setFocus(); -
1833 }
executed: }
Execution Count:10
10
1834 restoreFocusWidget = 0; -
1835}
executed: }
Execution Count:50
50
1836 -
1837 -
1838 -
1839 -
1840 -
1841void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags) -
1842{ -
1843 QMdiSubWindow * const q = q_func(); -
1844 if (!parent) {
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:120
20-120
1845 q->setWindowFlags(windowFlags); -
1846 return;
executed: return;
Execution Count:20
20
1847 } -
1848 -
1849 Qt::WindowFlags windowType = windowFlags & Qt::WindowType_Mask; -
1850 if (windowType == Qt::Dialog || windowFlags & Qt::MSWindowsFixedSizeDialogHint)
evaluated: windowType == Qt::Dialog
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:117
partially evaluated: windowFlags & Qt::MSWindowsFixedSizeDialogHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:117
0-117
1851 windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint;
executed: windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint;
Execution Count:3
3
1852 -
1853 -
1854 if (!(windowFlags & CustomizeWindowFlags))
evaluated: !(windowFlags & CustomizeWindowFlags)
TRUEFALSE
yes
Evaluation Count:79
yes
Evaluation Count:41
41-79
1855 windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
executed: windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
Execution Count:79
79
1856 else if (windowFlags & Qt::FramelessWindowHint && windowFlags & Qt::WindowStaysOnTopHint)
partially evaluated: windowFlags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:41
never evaluated: windowFlags & Qt::WindowStaysOnTopHint
0-41
1857 windowFlags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint;
never executed: windowFlags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint;
0
1858 else if (windowFlags & Qt::FramelessWindowHint)
partially evaluated: windowFlags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:41
0-41
1859 windowFlags = Qt::FramelessWindowHint;
never executed: windowFlags = Qt::FramelessWindowHint;
0
1860 -
1861 windowFlags &= ~windowType; -
1862 windowFlags &= ~Qt::WindowFullscreenButtonHint; -
1863 windowFlags |= Qt::SubWindow; -
1864 -
1865 -
1866 if (QAction *stayOnTopAction = actions[QMdiSubWindowPrivate::StayOnTopAction]) {
partially evaluated: QAction *stayOnTopAction = actions[QMdiSubWindowPrivate::StayOnTopAction]
TRUEFALSE
yes
Evaluation Count:120
no
Evaluation Count:0
0-120
1867 if (windowFlags & Qt::WindowStaysOnTopHint)
partially evaluated: windowFlags & Qt::WindowStaysOnTopHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
1868 stayOnTopAction->setChecked(true);
never executed: stayOnTopAction->setChecked(true);
0
1869 else -
1870 stayOnTopAction->setChecked(false);
executed: stayOnTopAction->setChecked(false);
Execution Count:120
120
1871 } -
1872 -
1873 -
1874 -
1875 if ((windowFlags & Qt::FramelessWindowHint) && sizeGrip)
partially evaluated: (windowFlags & Qt::FramelessWindowHint)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
never evaluated: sizeGrip
0-120
1876 delete sizeGrip;
never executed: delete sizeGrip;
0
1877 -
1878 -
1879 q->setWindowFlags(windowFlags); -
1880 updateGeometryConstraints(); -
1881 updateActions(); -
1882 QSize currentSize = q->size(); -
1883 if (q->isVisible() && (currentSize.width() < internalMinimumSize.width()
partially evaluated: q->isVisible()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
never evaluated: currentSize.width() < internalMinimumSize.width()
0-120
1884 || currentSize.height() < internalMinimumSize.height())) {
never evaluated: currentSize.height() < internalMinimumSize.height()
0
1885 q->resize(currentSize.expandedTo(internalMinimumSize)); -
1886 }
never executed: }
0
1887}
executed: }
Execution Count:120
120
1888 -
1889void QMdiSubWindowPrivate::setVisible(WindowStateAction action, bool visible) -
1890{ -
1891 -
1892 if (actions[action])
partially evaluated: actions[action]
TRUEFALSE
yes
Evaluation Count:4023
no
Evaluation Count:0
0-4023
1893 actions[action]->setVisible(visible);
executed: actions[action]->setVisible(visible);
Execution Count:4023
4023
1894 -
1895 -
1896 QMdiSubWindow * const q = q_func(); -
1897 if (!controlContainer)
evaluated: !controlContainer
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:3921
102-3921
1898 controlContainer = new ControlContainer(q);
executed: controlContainer = new ControlContainer(q);
Execution Count:102
102
1899 -
1900 if (ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *> 0-4023
1901 (controlContainer->controllerWidget())) {
partially evaluated: ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *> (controlContainer->controllerWidget())
TRUEFALSE
yes
Evaluation Count:4023
no
Evaluation Count:0
0-4023
1902 ctrlWidget->setControlVisible(action, visible); -
1903 }
executed: }
Execution Count:4023
4023
1904}
executed: }
Execution Count:4023
4023
1905 -
1906 -
1907void QMdiSubWindowPrivate::setEnabled(WindowStateAction action, bool enable) -
1908{ -
1909 if (actions[action])
evaluated: actions[action]
TRUEFALSE
yes
Evaluation Count:691
yes
Evaluation Count:15
15-691
1910 actions[action]->setEnabled(enable);
executed: actions[action]->setEnabled(enable);
Execution Count:691
691
1911}
executed: }
Execution Count:706
706
1912 -
1913 -
1914void QMdiSubWindowPrivate::addToSystemMenu(WindowStateAction action, const QString &text, -
1915 const char *slot) -
1916{ -
1917 if (!systemMenu)
partially evaluated: !systemMenu
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:714
0-714
1918 return;
never executed: return;
0
1919 actions[action] = systemMenu->addAction(text, q_func(), slot); -
1920}
executed: }
Execution Count:714
714
1921 -
1922 -
1923 -
1924 -
1925 -
1926 -
1927QSize QMdiSubWindowPrivate::iconSize() const -
1928{ -
1929 const QMdiSubWindow * const q = q_func(); -
1930 if (!parent || q->windowFlags() & Qt::FramelessWindowHint)
partially evaluated: !parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
0-24
1931 return QSize(-1, -1);
never executed: return QSize(-1, -1);
0
1932 return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight());
executed: return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight());
Execution Count:24
24
1933} -
1934 -
1935 -
1936 -
1937 -
1938 -
1939 -
1940void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip) -
1941{ -
1942 QMdiSubWindow * const q = q_func(); -
1943 if (!newSizeGrip || sizeGrip || q->windowFlags() & Qt::FramelessWindowHint)
never evaluated: !newSizeGrip
never evaluated: sizeGrip
never evaluated: q->windowFlags() & Qt::FramelessWindowHint
0
1944 return;
never executed: return;
0
1945 -
1946 if (layout && layout->indexOf(newSizeGrip) != -1)
never evaluated: layout
never evaluated: layout->indexOf(newSizeGrip) != -1
0
1947 return;
never executed: return;
0
1948 newSizeGrip->setFixedSize(newSizeGrip->sizeHint()); -
1949 bool putSizeGripInLayout = layout ? true : false;
never evaluated: layout
0
1950 -
1951 -
1952 -
1953 -
1954 if (putSizeGripInLayout) {
never evaluated: putSizeGripInLayout
0
1955 layout->addWidget(newSizeGrip); -
1956 layout->setAlignment(newSizeGrip, Qt::AlignBottom | Qt::AlignRight); -
1957 } else {
never executed: }
0
1958 newSizeGrip->setParent(q); -
1959 newSizeGrip->move(q->isLeftToRight() ? q->width() - newSizeGrip->width() : 0, -
1960 q->height() - newSizeGrip->height()); -
1961 sizeGrip = newSizeGrip; -
1962 }
never executed: }
0
1963 newSizeGrip->raise(); -
1964 updateGeometryConstraints(); -
1965 newSizeGrip->installEventFilter(q); -
1966}
never executed: }
0
1967 -
1968 -
1969 -
1970 -
1971void QMdiSubWindowPrivate::setSizeGripVisible(bool visible) const -
1972{ -
1973 -
1974 QList<QSizeGrip *> sizeGrips = q_func()->findChildren<QSizeGrip *>(); -
1975 for (QForeachContainer<__typeof__(sizeGrips)> _container_(sizeGrips); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QSizeGrip *grip = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
1976 grip->setVisible(visible);
never executed: grip->setVisible(visible);
0
1977}
executed: }
Execution Count:138
138
1978 -
1979 -
1980 -
1981 -
1982 -
1983 -
1984void QMdiSubWindowPrivate::updateInternalWindowTitle() -
1985{ -
1986 QMdiSubWindow * const q = q_func(); -
1987 if (q->isWindowModified()) {
evaluated: q->isWindowModified()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:24
5-24
1988 windowTitle = q->windowTitle(); -
1989 windowTitle.replace(QLatin1String("[*]"), QLatin1String("*")); -
1990 } else {
executed: }
Execution Count:5
5
1991 windowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q); -
1992 }
executed: }
Execution Count:24
24
1993 q->update(0, 0, q->width(), titleBarHeight()); -
1994}
executed: }
Execution Count:29
29
1995QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) -
1996 : QWidget(*new QMdiSubWindowPrivate, parent, 0) -
1997{ -
1998 QMdiSubWindowPrivate * const d = d_func(); -
1999 -
2000 d->createSystemMenu(); -
2001 addActions(d->systemMenu->actions()); -
2002 -
2003 d->setWindowFlags(flags); -
2004 setBackgroundRole(QPalette::Window); -
2005 setAutoFillBackground(true); -
2006 setMouseTracking(true); -
2007 setLayout(new QVBoxLayout); -
2008 setFocusPolicy(Qt::StrongFocus); -
2009 layout()->setMargin(0); -
2010 d->updateGeometryConstraints(); -
2011 setAttribute(Qt::WA_Resized, false); -
2012 d->titleBarPalette = d->desktopPalette(); -
2013 d->font = QApplication::font("QMdiSubWindowTitleBar"); -
2014 -
2015 -
2016 if (windowIcon().isNull())
partially evaluated: windowIcon().isNull()
TRUEFALSE
yes
Evaluation Count:102
no
Evaluation Count:0
0-102
2017 d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
Execution Count:102
102
2018 else -
2019 d->menuIcon = windowIcon();
never executed: d->menuIcon = windowIcon();
0
2020 -
2021 connect((static_cast<QApplication *>(QCoreApplication::instance())), "2""focusChanged(QWidget*,QWidget*)", -
2022 this, "1""_q_processFocusChanged(QWidget*,QWidget*)"); -
2023}
executed: }
Execution Count:102
102
2024 -
2025 -
2026 -
2027 -
2028 -
2029 -
2030QMdiSubWindow::~QMdiSubWindow() -
2031{ -
2032 QMdiSubWindowPrivate * const d = d_func(); -
2033 -
2034 d->removeButtonsFromMenuBar(); -
2035 -
2036 d->setActive(false); -
2037}
executed: }
Execution Count:102
102
2038void QMdiSubWindow::setWidget(QWidget *widget) -
2039{ -
2040 QMdiSubWindowPrivate * const d = d_func(); -
2041 if (!widget) {
evaluated: !widget
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:100
3-100
2042 d->removeBaseWidget(); -
2043 return;
executed: return;
Execution Count:3
3
2044 } -
2045 -
2046 if (widget == d->baseWidget) {
evaluated: widget == d->baseWidget
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:99
1-99
2047 QMessageLogger("widgets/qmdisubwindow.cpp", 2311, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setWidget: widget is already set"); -
2048 return;
executed: return;
Execution Count:1
1
2049 } -
2050 -
2051 bool wasResized = testAttribute(Qt::WA_Resized); -
2052 d->removeBaseWidget(); -
2053 -
2054 if (QLayout *layout = this->layout())
evaluated: QLayout *layout = this->layout()
TRUEFALSE
yes
Evaluation Count:98
yes
Evaluation Count:1
1-98
2055 layout->addWidget(widget);
executed: layout->addWidget(widget);
Execution Count:98
98
2056 else -
2057 widget->setParent(this);
executed: widget->setParent(this);
Execution Count:1
1
2058 -
2059 -
2060 QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>(); -
2061 if (sizeGrip)
partially evaluated: sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99
0-99
2062 sizeGrip->installEventFilter(this);
never executed: sizeGrip->installEventFilter(this);
0
2063 if (d->sizeGrip)
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99
0-99
2064 d->sizeGrip->raise();
never executed: d->sizeGrip->raise();
0
2065 -
2066 -
2067 d->baseWidget = widget; -
2068 d->baseWidget->installEventFilter(this); -
2069 -
2070 d->ignoreWindowTitleChange = true; -
2071 bool isWindowModified = this->isWindowModified(); -
2072 if (windowTitle().isEmpty()) {
partially evaluated: windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:99
no
Evaluation Count:0
0-99
2073 d->updateWindowTitle(true); -
2074 isWindowModified = d->baseWidget->isWindowModified(); -
2075 }
executed: }
Execution Count:99
99
2076 if (!this->isWindowModified() && isWindowModified
partially evaluated: !this->isWindowModified()
TRUEFALSE
yes
Evaluation Count:99
no
Evaluation Count:0
evaluated: isWindowModified
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:98
0-99
2077 && windowTitle().contains(QLatin1String("[*]"))) {
partially evaluated: windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2078 setWindowModified(isWindowModified); -
2079 }
executed: }
Execution Count:1
1
2080 d->lastChildWindowTitle = d->baseWidget->windowTitle(); -
2081 d->ignoreWindowTitleChange = false; -
2082 -
2083 if (windowIcon().isNull() && !d->baseWidget->windowIcon().isNull())
partially evaluated: windowIcon().isNull()
TRUEFALSE
yes
Evaluation Count:99
no
Evaluation Count:0
partially evaluated: !d->baseWidget->windowIcon().isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99
0-99
2084 setWindowIcon(d->baseWidget->windowIcon());
never executed: setWindowIcon(d->baseWidget->windowIcon());
0
2085 -
2086 d->updateGeometryConstraints(); -
2087 if (!wasResized && testAttribute(Qt::WA_Resized))
evaluated: !wasResized
TRUEFALSE
yes
Evaluation Count:98
yes
Evaluation Count:1
partially evaluated: testAttribute(Qt::WA_Resized)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:98
0-98
2088 setAttribute(Qt::WA_Resized, false);
never executed: setAttribute(Qt::WA_Resized, false);
0
2089}
executed: }
Execution Count:99
99
2090 -
2091 -
2092 -
2093 -
2094 -
2095 -
2096QWidget *QMdiSubWindow::widget() const -
2097{ -
2098 return d_func()->baseWidget;
executed: return d_func()->baseWidget;
Execution Count:104
104
2099} -
2100 -
2101 -
2102 -
2103 -
2104 -
2105QWidget *QMdiSubWindow::maximizedButtonsWidget() const -
2106{ -
2107 const QMdiSubWindowPrivate * const d = d_func(); -
2108 if (isVisible() && d->controlContainer && isMaximized() && !d->drawTitleBarWhenMaximized()
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:32
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:111
no
Evaluation Count:0
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:9
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:91
yes
Evaluation Count:11
0-111
2109 && !isChildOfTabbedQMdiArea(this)) {
partially evaluated: !isChildOfTabbedQMdiArea(this)
TRUEFALSE
yes
Evaluation Count:91
no
Evaluation Count:0
0-91
2110 return d->controlContainer->controllerWidget();
executed: return d->controlContainer->controllerWidget();
Execution Count:91
91
2111 } -
2112 return 0;
executed: return 0;
Execution Count:52
52
2113} -
2114 -
2115 -
2116 -
2117 -
2118QWidget *QMdiSubWindow::maximizedSystemMenuIconWidget() const -
2119{ -
2120 const QMdiSubWindowPrivate * const d = d_func(); -
2121 if (isVisible() && d->controlContainer && isMaximized() && !d->drawTitleBarWhenMaximized()
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:13
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:51
no
Evaluation Count:0
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:7
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:33
yes
Evaluation Count:11
0-51
2122 && !isChildOfTabbedQMdiArea(this)) {
partially evaluated: !isChildOfTabbedQMdiArea(this)
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
2123 return d->controlContainer->systemMenuLabel();
executed: return d->controlContainer->systemMenuLabel();
Execution Count:33
33
2124 } -
2125 return 0;
executed: return 0;
Execution Count:31
31
2126} -
2127 -
2128 -
2129 -
2130 -
2131 -
2132 -
2133 -
2134bool QMdiSubWindow::isShaded() const -
2135{ -
2136 return d_func()->isShadeMode;
executed: return d_func()->isShadeMode;
Execution Count:1560
1560
2137} -
2138 -
2139 -
2140 -
2141 -
2142 -
2143 -
2144 -
2145void QMdiSubWindow::setOption(SubWindowOption option, bool on) -
2146{ -
2147 QMdiSubWindowPrivate * const d = d_func(); -
2148 if (on && !(d->options & option))
evaluated: on
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:260
partially evaluated: !(d->options & option)
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-260
2149 d->options |= option;
executed: d->options |= option;
Execution Count:10
10
2150 else if (!on && (d->options & option))
partially evaluated: !on
TRUEFALSE
yes
Evaluation Count:260
no
Evaluation Count:0
partially evaluated: (d->options & option)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:260
0-260
2151 d->options &= ~option;
never executed: d->options &= ~option;
0
2152 -
2153 -
2154 if ((option & (RubberBandResize | RubberBandMove)) && !on && d->isInRubberBandMode)
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:58
evaluated: (option & (RubberBandResize | RubberBandMove))
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:210
evaluated: !on
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:2
0-210
2155 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
2156 -
2157}
executed: }
Execution Count:270
270
2158 -
2159 -
2160 -
2161 -
2162 -
2163 -
2164bool QMdiSubWindow::testOption(SubWindowOption option) const -
2165{ -
2166 return d_func()->options & option;
executed: return d_func()->options & option;
Execution Count:719
719
2167} -
2168int QMdiSubWindow::keyboardSingleStep() const -
2169{ -
2170 return d_func()->keyboardSingleStep;
never executed: return d_func()->keyboardSingleStep;
0
2171} -
2172 -
2173void QMdiSubWindow::setKeyboardSingleStep(int step) -
2174{ -
2175 -
2176 -
2177 -
2178 d_func()->keyboardSingleStep = step; -
2179}
never executed: }
0
2180int QMdiSubWindow::keyboardPageStep() const -
2181{ -
2182 return d_func()->keyboardPageStep;
never executed: return d_func()->keyboardPageStep;
0
2183} -
2184 -
2185void QMdiSubWindow::setKeyboardPageStep(int step) -
2186{ -
2187 -
2188 -
2189 -
2190 d_func()->keyboardPageStep = step; -
2191}
never executed: }
0
2192void QMdiSubWindow::setSystemMenu(QMenu *systemMenu) -
2193{ -
2194 QMdiSubWindowPrivate * const d = d_func(); -
2195 if (systemMenu && systemMenu == d->systemMenu) {
evaluated: systemMenu
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
evaluated: systemMenu == d->systemMenu
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-2
2196 QMessageLogger("widgets/qmdisubwindow.cpp", 2509, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setSystemMenu: system menu is already set"); -
2197 return;
executed: return;
Execution Count:1
1
2198 } -
2199 -
2200 if (d->systemMenu) {
evaluated: d->systemMenu
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2201 delete d->systemMenu; -
2202 d->systemMenu = 0; -
2203 }
executed: }
Execution Count:1
1
2204 -
2205 if (!systemMenu)
evaluated: !systemMenu
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2206 return;
executed: return;
Execution Count:1
1
2207 -
2208 if (systemMenu->parent() != this)
partially evaluated: systemMenu->parent() != this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2209 systemMenu->setParent(this);
never executed: systemMenu->setParent(this);
0
2210 d->systemMenu = systemMenu; -
2211}
executed: }
Execution Count:1
1
2212QMenu *QMdiSubWindow::systemMenu() const -
2213{ -
2214 return d_func()->systemMenu;
executed: return d_func()->systemMenu;
Execution Count:6
6
2215} -
2216 -
2217 -
2218 -
2219 -
2220 -
2221 -
2222void QMdiSubWindow::showSystemMenu() -
2223{ -
2224 QMdiSubWindowPrivate * const d = d_func(); -
2225 if (!d->systemMenu)
partially evaluated: !d->systemMenu
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2226 return;
never executed: return;
0
2227 -
2228 QPoint globalPopupPos; -
2229 if (QWidget *icon = maximizedSystemMenuIconWidget()) {
evaluated: QWidget *icon = maximizedSystemMenuIconWidget()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
2230 if (isLeftToRight())
evaluated: isLeftToRight()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2231 globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height()));
executed: globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height()));
Execution Count:1
1
2232 else -
2233 globalPopupPos = icon->mapToGlobal(QPoint(icon->width(), icon->y() + icon->height()));
executed: globalPopupPos = icon->mapToGlobal(QPoint(icon->width(), icon->y() + icon->height()));
Execution Count:1
1
2234 } else { -
2235 if (isLeftToRight())
evaluated: isLeftToRight()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
2236 globalPopupPos = mapToGlobal(contentsRect().topLeft());
executed: globalPopupPos = mapToGlobal(contentsRect().topLeft());
Execution Count:3
3
2237 else -
2238 globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0);
executed: globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0);
Execution Count:1
1
2239 } -
2240 -
2241 -
2242 if (isRightToLeft())
evaluated: isRightToLeft()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
2243 globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0);
executed: globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0);
Execution Count:2
2
2244 d->systemMenu->installEventFilter(this); -
2245 d->systemMenu->popup(globalPopupPos); -
2246}
executed: }
Execution Count:6
6
2247QMdiArea *QMdiSubWindow::mdiArea() const -
2248{ -
2249 QWidget *parent = parentWidget(); -
2250 while (parent) {
evaluated: parent
TRUEFALSE
yes
Evaluation Count:11852
yes
Evaluation Count:360
360-11852
2251 if (QMdiArea *area = qobject_cast<QMdiArea *>(parent)) {
evaluated: QMdiArea *area = qobject_cast<QMdiArea *>(parent)
TRUEFALSE
yes
Evaluation Count:5519
yes
Evaluation Count:6333
5519-6333
2252 if (area->viewport() == parentWidget())
evaluated: area->viewport() == parentWidget()
TRUEFALSE
yes
Evaluation Count:5516
yes
Evaluation Count:3
3-5516
2253 return area;
executed: return area;
Execution Count:5516
5516
2254 }
executed: }
Execution Count:3
3
2255 parent = parent->parentWidget(); -
2256 }
executed: }
Execution Count:6336
6336
2257 return 0;
executed: return 0;
Execution Count:360
360
2258} -
2259void QMdiSubWindow::showShaded() -
2260{ -
2261 if (!parent())
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
0-24
2262 return;
never executed: return;
0
2263 -
2264 QMdiSubWindowPrivate * const d = d_func(); -
2265 -
2266 if (!d->isShadeRequestFromMinimizeMode && isShaded())
evaluated: !d->isShadeRequestFromMinimizeMode
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:16
partially evaluated: isShaded()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-16
2267 return;
never executed: return;
0
2268 -
2269 d->isMaximizeMode = false; -
2270 -
2271 QWidget *currentFocusWidget = QApplication::focusWidget(); -
2272 if (!d->restoreFocusWidget && isAncestorOf(currentFocusWidget))
partially evaluated: !d->restoreFocusWidget
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
evaluated: isAncestorOf(currentFocusWidget)
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:3
0-24
2273 d->restoreFocusWidget = currentFocusWidget;
executed: d->restoreFocusWidget = currentFocusWidget;
Execution Count:21
21
2274 -
2275 if (!d->isShadeRequestFromMinimizeMode) {
evaluated: !d->isShadeRequestFromMinimizeMode
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:16
8-16
2276 d->isShadeMode = true; -
2277 d->ensureWindowState(Qt::WindowMinimized); -
2278 }
executed: }
Execution Count:8
8
2279 -
2280 -
2281 d->removeButtonsFromMenuBar(); -
2282 -
2283 -
2284 -
2285 -
2286 -
2287 if (hasFocus() || isAncestorOf(currentFocusWidget))
evaluated: hasFocus()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:18
evaluated: isAncestorOf(currentFocusWidget)
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:3
3-18
2288 d->ensureWindowState(Qt::WindowActive);
executed: d->ensureWindowState(Qt::WindowActive);
Execution Count:21
21
2289 -
2290 -
2291 d->setSizeGripVisible(false); -
2292 -
2293 -
2294 if (!d->restoreSize.isValid() || d->isShadeMode) {
evaluated: !d->restoreSize.isValid()
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:2
evaluated: d->isShadeMode
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-22
2295 d->oldGeometry = geometry(); -
2296 d->restoreSize.setWidth(d->oldGeometry.width()); -
2297 d->restoreSize.setHeight(d->oldGeometry.height()); -
2298 }
executed: }
Execution Count:23
23
2299 -
2300 -
2301 -
2302 const bool wasVisible = isVisible(); -
2303 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
0-24
2304 setVisible(false);
executed: setVisible(false);
Execution Count:24
24
2305 -
2306 d->updateGeometryConstraints(); -
2307 -
2308 if (!minimumSize().isNull()) {
evaluated: !minimumSize().isNull()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:23
1-23
2309 d->userMinimumSize = minimumSize(); -
2310 setMinimumSize(d->internalMinimumSize); -
2311 }
executed: }
Execution Count:1
1
2312 resize(d->internalMinimumSize); -
2313 -
2314 -
2315 if (d->baseWidget && !d->baseWidget->isHidden()) {
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:1
partially evaluated: !d->baseWidget->isHidden()
TRUEFALSE
yes
Evaluation Count:23
no
Evaluation Count:0
0-23
2316 d->baseWidget->hide(); -
2317 d->isWidgetHiddenByUs = true; -
2318 }
executed: }
Execution Count:23
23
2319 -
2320 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
0-24
2321 setVisible(true);
executed: setVisible(true);
Execution Count:24
24
2322 -
2323 d->setFocusWidget(); -
2324 d->resizeEnabled = false; -
2325 d->moveEnabled = true; -
2326 d->updateDirtyRegions(); -
2327 d->updateMask(); -
2328 -
2329 -
2330 d->setEnabled(QMdiSubWindowPrivate::MinimizeAction, false); -
2331 d->setEnabled(QMdiSubWindowPrivate::ResizeAction, d->resizeEnabled); -
2332 d->setEnabled(QMdiSubWindowPrivate::MaximizeAction, true); -
2333 d->setEnabled(QMdiSubWindowPrivate::RestoreAction, true); -
2334 d->setEnabled(QMdiSubWindowPrivate::MoveAction, d->moveEnabled); -
2335 -
2336}
executed: }
Execution Count:24
24
2337 -
2338 -
2339 -
2340 -
2341bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event) -
2342{ -
2343 QMdiSubWindowPrivate * const d = d_func(); -
2344 if (!object)
partially evaluated: !object
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3295
0-3295
2345 return QWidget::eventFilter(object, event);
never executed: return QWidget::eventFilter(object, event);
0
2346 -
2347 -
2348 -
2349 if (d->systemMenu && d->systemMenu == object) {
evaluated: d->systemMenu
TRUEFALSE
yes
Evaluation Count:3289
yes
Evaluation Count:6
evaluated: d->systemMenu == object
TRUEFALSE
yes
Evaluation Count:74
yes
Evaluation Count:3215
6-3289
2350 if (event->type() == QEvent::MouseButtonDblClick) {
evaluated: event->type() == QEvent::MouseButtonDblClick
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:73
1-73
2351 close(); -
2352 } else if (event->type() == QEvent::MouseMove) {
executed: }
Execution Count:1
partially evaluated: event->type() == QEvent::MouseMove
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:73
0-73
2353 QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); -
2354 d->hoveredSubControl = d->getSubControl(mapFromGlobal(mouseEvent->globalPos())); -
2355 } else if (event->type() == QEvent::Hide) {
never executed: }
evaluated: event->type() == QEvent::Hide
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:67
0-67
2356 d->systemMenu->removeEventFilter(this); -
2357 d->activeSubControl = QStyle::SC_None; -
2358 update(QRegion(0, 0, width(), d->titleBarHeight())); -
2359 }
executed: }
Execution Count:6
6
2360 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:74
74
2361 } -
2362 -
2363 -
2364 -
2365 if (object != d->baseWidget && parent() && qobject_cast<QSizeGrip *>(object)) {
evaluated: object != d->baseWidget
TRUEFALSE
yes
Evaluation Count:199
yes
Evaluation Count:3022
partially evaluated: parent()
TRUEFALSE
yes
Evaluation Count:199
no
Evaluation Count:0
partially evaluated: qobject_cast<QSizeGrip *>(object)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:199
0-3022
2366 if (event->type() != QEvent::MouseButtonPress || !testOption(QMdiSubWindow::RubberBandResize))
never evaluated: event->type() != QEvent::MouseButtonPress
never evaluated: !testOption(QMdiSubWindow::RubberBandResize)
0
2367 return QWidget::eventFilter(object, event);
never executed: return QWidget::eventFilter(object, event);
0
2368 const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); -
2369 d->mousePressPosition = parentWidget()->mapFromGlobal(mouseEvent->globalPos()); -
2370 d->oldGeometry = geometry(); -
2371 d->currentOperation = isLeftToRight() ? QMdiSubWindowPrivate::BottomRightResize
never evaluated: isLeftToRight()
0
2372 : QMdiSubWindowPrivate::BottomLeftResize; -
2373 -
2374 d->enterRubberBandMode(); -
2375 -
2376 return true;
never executed: return true;
0
2377 } -
2378 -
2379 -
2380 if (object != d->baseWidget && event->type() != QEvent::WindowTitleChange)
evaluated: object != d->baseWidget
TRUEFALSE
yes
Evaluation Count:199
yes
Evaluation Count:3022
evaluated: event->type() != QEvent::WindowTitleChange
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:39
39-3022
2381 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:160
160
2382 -
2383 switch (event->type()) { -
2384 case QEvent::Show: -
2385 d->setActive(true); -
2386 break;
executed: break;
Execution Count:230
230
2387 case QEvent::ShowToParent: -
2388 if (!d->isWidgetHiddenByUs)
evaluated: !d->isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:93
yes
Evaluation Count:18
18-93
2389 show();
executed: show();
Execution Count:93
93
2390 break;
executed: break;
Execution Count:111
111
2391 case QEvent::WindowStateChange: { -
2392 QWindowStateChangeEvent *changeEvent = static_cast<QWindowStateChangeEvent*>(event); -
2393 if (changeEvent->isOverride())
partially evaluated: changeEvent->isOverride()
TRUEFALSE
yes
Evaluation Count:928
no
Evaluation Count:0
0-928
2394 break;
executed: break;
Execution Count:928
928
2395 Qt::WindowStates oldState = changeEvent->oldState(); -
2396 Qt::WindowStates newState = d->baseWidget->windowState(); -
2397 if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized))
never evaluated: !(oldState & Qt::WindowMinimized)
never evaluated: (newState & Qt::WindowMinimized)
0
2398 showMinimized();
never executed: showMinimized();
0
2399 else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized))
never evaluated: !(oldState & Qt::WindowMaximized)
never evaluated: (newState & Qt::WindowMaximized)
0
2400 showMaximized();
never executed: showMaximized();
0
2401 else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized)))
never evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))
0
2402 showNormal();
never executed: showNormal();
0
2403 break;
never executed: break;
0
2404 } -
2405 case QEvent::Enter: -
2406 d->currentOperation = QMdiSubWindowPrivate::None; -
2407 d->updateCursor(); -
2408 break;
executed: break;
Execution Count:20
20
2409 case QEvent::LayoutRequest: -
2410 d->updateGeometryConstraints(); -
2411 break;
executed: break;
Execution Count:1
1
2412 case QEvent::WindowTitleChange: -
2413 if (d->ignoreWindowTitleChange)
evaluated: d->ignoreWindowTitleChange
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:25
25-29
2414 break;
executed: break;
Execution Count:29
29
2415 if (object == d->baseWidget) {
evaluated: object == d->baseWidget
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:10
10-15
2416 d->updateWindowTitle(true); -
2417 d->lastChildWindowTitle = d->baseWidget->windowTitle(); -
2418 -
2419 } else if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar()
partially evaluated: maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
partially evaluated: d->controlContainer->menuBar()
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
executed: }
Execution Count:15
0-15
2420 ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) {
evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:1
1-9
2421 d->originalTitle = QString::null; -
2422 if (d->baseWidget && d->baseWidget->windowTitle() == windowTitle())
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:4
partially evaluated: d->baseWidget->windowTitle() == windowTitle()
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
2423 d->updateWindowTitle(true);
executed: d->updateWindowTitle(true);
Execution Count:5
5
2424 else -
2425 d->updateWindowTitle(false);
executed: d->updateWindowTitle(false);
Execution Count:4
4
2426 -
2427 } -
2428 break;
executed: break;
Execution Count:25
25
2429 case QEvent::ModifiedChange: { -
2430 if (object != d->baseWidget)
partially evaluated: object != d->baseWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
2431 break;
never executed: break;
0
2432 bool windowModified = d->baseWidget->isWindowModified(); -
2433 if (!windowModified && d->baseWidget->windowTitle() != windowTitle())
evaluated: !windowModified
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
evaluated: d->baseWidget->windowTitle() != windowTitle()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-2
2434 break;
executed: break;
Execution Count:1
1
2435 if (windowTitle().contains(QLatin1String("[*]")))
partially evaluated: windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
2436 setWindowModified(windowModified);
executed: setWindowModified(windowModified);
Execution Count:3
3
2437 break;
executed: break;
Execution Count:3
3
2438 } -
2439 default: -
2440 break;
executed: break;
Execution Count:1713
1713
2441 } -
2442 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:3061
3061
2443} -
2444 -
2445 -
2446 -
2447 -
2448bool QMdiSubWindow::event(QEvent *event) -
2449{ -
2450 QMdiSubWindowPrivate * const d = d_func(); -
2451 switch (event->type()) { -
2452 case QEvent::StyleChange: { -
2453 bool wasShaded = isShaded(); -
2454 bool wasMinimized = isMinimized(); -
2455 bool wasMaximized = isMaximized(); -
2456 ensurePolished(); -
2457 setContentsMargins(0, 0, 0, 0); -
2458 if (wasMinimized || wasMaximized || wasShaded)
never evaluated: wasMinimized
never evaluated: wasMaximized
never evaluated: wasShaded
0
2459 showNormal();
never executed: showNormal();
0
2460 d->updateGeometryConstraints(); -
2461 resize(d->internalMinimumSize.expandedTo(size())); -
2462 d->updateMask(); -
2463 d->updateDirtyRegions(); -
2464 if (wasShaded)
never evaluated: wasShaded
0
2465 showShaded();
never executed: showShaded();
0
2466 else if (wasMinimized)
never evaluated: wasMinimized
0
2467 showMinimized();
never executed: showMinimized();
0
2468 else if (wasMaximized)
never evaluated: wasMaximized
0
2469 showMaximized();
never executed: showMaximized();
0
2470 break;
never executed: break;
0
2471 } -
2472 case QEvent::ParentAboutToChange: -
2473 d->setActive(false); -
2474 break;
executed: break;
Execution Count:8
8
2475 case QEvent::ParentChange: { -
2476 bool wasResized = testAttribute(Qt::WA_Resized); -
2477 -
2478 d->removeButtonsFromMenuBar(); -
2479 -
2480 d->currentOperation = QMdiSubWindowPrivate::None; -
2481 d->activeSubControl = QStyle::SC_None; -
2482 d->hoveredSubControl = QStyle::SC_None; -
2483 -
2484 if (d->isInRubberBandMode)
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:66
0-66
2485 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
2486 -
2487 d->isShadeMode = false; -
2488 d->isMaximizeMode = false; -
2489 d->isWidgetHiddenByUs = false; -
2490 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:38
28-38
2491 -
2492 -
2493 -
2494 -
2495 setOption(RubberBandResize, false); -
2496 setOption(RubberBandMove, false); -
2497 } else {
executed: }
Execution Count:28
28
2498 d->setWindowFlags(windowFlags()); -
2499 }
executed: }
Execution Count:38
38
2500 setContentsMargins(0, 0, 0, 0); -
2501 d->updateGeometryConstraints(); -
2502 d->updateCursor(); -
2503 d->updateMask(); -
2504 d->updateDirtyRegions(); -
2505 d->updateActions(); -
2506 if (!wasResized && testAttribute(Qt::WA_Resized))
evaluated: !wasResized
TRUEFALSE
yes
Evaluation Count:57
yes
Evaluation Count:9
partially evaluated: testAttribute(Qt::WA_Resized)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:57
0-57
2507 setAttribute(Qt::WA_Resized, false);
never executed: setAttribute(Qt::WA_Resized, false);
0
2508 break;
executed: break;
Execution Count:66
66
2509 } -
2510 case QEvent::WindowActivate: -
2511 if (d->ignoreNextActivationEvent) {
evaluated: d->ignoreNextActivationEvent
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:6
6-54
2512 d->ignoreNextActivationEvent = false; -
2513 break;
executed: break;
Execution Count:54
54
2514 } -
2515 d->isExplicitlyDeactivated = false; -
2516 d->setActive(true); -
2517 break;
executed: break;
Execution Count:6
6
2518 case QEvent::WindowDeactivate: -
2519 if (d->ignoreNextActivationEvent) {
evaluated: d->ignoreNextActivationEvent
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:46
30-46
2520 d->ignoreNextActivationEvent = false; -
2521 break;
executed: break;
Execution Count:30
30
2522 } -
2523 d->isExplicitlyDeactivated = true; -
2524 d->setActive(false); -
2525 break;
executed: break;
Execution Count:46
46
2526 case QEvent::WindowTitleChange: -
2527 if (!d->ignoreWindowTitleChange)
evaluated: !d->ignoreWindowTitleChange
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:20
5-20
2528 d->updateWindowTitle(false);
executed: d->updateWindowTitle(false);
Execution Count:5
5
2529 d->updateInternalWindowTitle(); -
2530 break;
executed: break;
Execution Count:25
25
2531 case QEvent::ModifiedChange: -
2532 if (!windowTitle().contains(QLatin1String("[*]")))
evaluated: !windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
2533 break;
executed: break;
Execution Count:4
4
2534 -
2535 if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar()
partially evaluated: maximizedButtonsWidget()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
never evaluated: d->controlContainer->menuBar()
0-4
2536 ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) {
never evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
0
2537 window()->setWindowModified(isWindowModified()); -
2538 }
never executed: }
0
2539 -
2540 d->updateInternalWindowTitle(); -
2541 break;
executed: break;
Execution Count:4
4
2542 case QEvent::LayoutDirectionChange: -
2543 d->updateDirtyRegions(); -
2544 break;
executed: break;
Execution Count:2
2
2545 case QEvent::LayoutRequest: -
2546 d->updateGeometryConstraints(); -
2547 break;
executed: break;
Execution Count:132
132
2548 case QEvent::WindowIconChange: -
2549 d->menuIcon = windowIcon(); -
2550 if (d->menuIcon.isNull())
never evaluated: d->menuIcon.isNull()
0
2551 d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
never executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
0
2552 if (d->controlContainer)
never evaluated: d->controlContainer
0
2553 d->controlContainer->updateWindowIcon(d->menuIcon);
never executed: d->controlContainer->updateWindowIcon(d->menuIcon);
0
2554 if (!maximizedSystemMenuIconWidget())
never evaluated: !maximizedSystemMenuIconWidget()
0
2555 update(0, 0, width(), d->titleBarHeight());
never executed: update(0, 0, width(), d->titleBarHeight());
0
2556 break;
never executed: break;
0
2557 case QEvent::PaletteChange: -
2558 d->titleBarPalette = d->desktopPalette(); -
2559 break;
executed: break;
Execution Count:102
102
2560 case QEvent::FontChange: -
2561 d->font = font(); -
2562 break;
never executed: break;
0
2563 -
2564 case QEvent::ToolTip: -
2565 showToolTip(static_cast<QHelpEvent *>(event), this, d->titleBarOptions(), -
2566 QStyle::CC_TitleBar, d->hoveredSubControl); -
2567 break;
never executed: break;
0
2568 -
2569 default: -
2570 break;
executed: break;
Execution Count:9510
9510
2571 } -
2572 return QWidget::event(event);
executed: return QWidget::event(event);
Execution Count:9989
9989
2573} -
2574 -
2575 -
2576 -
2577 -
2578void QMdiSubWindow::showEvent(QShowEvent *showEvent) -
2579{ -
2580 QMdiSubWindowPrivate * const d = d_func(); -
2581 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:260
10-260
2582 QWidget::showEvent(showEvent); -
2583 return;
executed: return;
Execution Count:10
10
2584 } -
2585 d->updateDirtyRegions(); -
2586 -
2587 -
2588 -
2589 if (d->controlContainer) {
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:260
no
Evaluation Count:0
0-260
2590 if (QMenuBar *menuBar = d->menuBar()) {
evaluated: QMenuBar *menuBar = d->menuBar()
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:224
36-224
2591 if (menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget())
evaluated: menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:33
3-33
2592 d->showButtonsInMenuBar(menuBar);
executed: d->showButtonsInMenuBar(menuBar);
Execution Count:3
3
2593 }
executed: }
Execution Count:36
36
2594 }
executed: }
Execution Count:260
260
2595 -
2596 d->setActive(true); -
2597}
executed: }
Execution Count:260
260
2598 -
2599 -
2600 -
2601 -
2602void QMdiSubWindow::hideEvent(QHideEvent * ) -
2603{ -
2604 -
2605 d_func()->removeButtonsFromMenuBar(); -
2606 -
2607}
executed: }
Execution Count:265
265
2608 -
2609 -
2610 -
2611 -
2612void QMdiSubWindow::changeEvent(QEvent *changeEvent) -
2613{ -
2614 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:1622
102-1622
2615 QWidget::changeEvent(changeEvent); -
2616 return;
executed: return;
Execution Count:102
102
2617 } -
2618 -
2619 if (changeEvent->type() != QEvent::WindowStateChange) {
evaluated: changeEvent->type() != QEvent::WindowStateChange
TRUEFALSE
yes
Evaluation Count:502
yes
Evaluation Count:1120
502-1120
2620 QWidget::changeEvent(changeEvent); -
2621 return;
executed: return;
Execution Count:502
502
2622 } -
2623 -
2624 QWindowStateChangeEvent *event = static_cast<QWindowStateChangeEvent *>(changeEvent); -
2625 if (event->isOverride()) {
evaluated: event->isOverride()
TRUEFALSE
yes
Evaluation Count:990
yes
Evaluation Count:130
130-990
2626 event->ignore(); -
2627 return;
executed: return;
Execution Count:990
990
2628 } -
2629 -
2630 Qt::WindowStates oldState = event->oldState(); -
2631 Qt::WindowStates newState = windowState(); -
2632 if (oldState == newState) {
partially evaluated: oldState == newState
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
2633 changeEvent->ignore(); -
2634 return;
never executed: return;
0
2635 } -
2636 -
2637 -
2638 -
2639 -
2640 QMdiSubWindowPrivate * const d = d_func(); -
2641 if (!isVisible()) {
evaluated: !isVisible()
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:115
15-115
2642 d->ensureWindowState(Qt::WindowNoState); -
2643 setVisible(true); -
2644 }
executed: }
Execution Count:15
15
2645 -
2646 if (!d->oldGeometry.isValid())
evaluated: !d->oldGeometry.isValid()
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:88
42-88
2647 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:42
42
2648 -
2649 if ((oldState & Qt::WindowActive) && (newState & Qt::WindowActive))
evaluated: (oldState & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:18
evaluated: (newState & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:95
yes
Evaluation Count:17
17-112
2650 d->currentOperation = QMdiSubWindowPrivate::None;
executed: d->currentOperation = QMdiSubWindowPrivate::None;
Execution Count:95
95
2651 -
2652 if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized))
evaluated: !(oldState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:110
yes
Evaluation Count:20
evaluated: (newState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:94
16-110
2653 d->setMinimizeMode();
executed: d->setMinimizeMode();
Execution Count:16
16
2654 else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized))
evaluated: !(oldState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:75
yes
Evaluation Count:39
evaluated: (newState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:57
yes
Evaluation Count:18
18-75
2655 d->setMaximizeMode();
executed: d->setMaximizeMode();
Execution Count:57
57
2656 else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized)))
partially evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
0-57
2657 d->setNormalMode();
executed: d->setNormalMode();
Execution Count:57
57
2658 -
2659 if (d->isActive)
evaluated: d->isActive
TRUEFALSE
yes
Evaluation Count:125
yes
Evaluation Count:5
5-125
2660 d->ensureWindowState(Qt::WindowActive);
executed: d->ensureWindowState(Qt::WindowActive);
Execution Count:125
125
2661 windowStateChanged(oldState, windowState()); -
2662}
executed: }
Execution Count:130
130
2663 -
2664 -
2665 -
2666 -
2667void QMdiSubWindow::closeEvent(QCloseEvent *closeEvent) -
2668{ -
2669 QMdiSubWindowPrivate * const d = d_func(); -
2670 bool acceptClose = true; -
2671 if (d->baseWidget)
partially evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2672 acceptClose = d->baseWidget->close();
executed: acceptClose = d->baseWidget->close();
Execution Count:4
4
2673 if (!acceptClose) {
evaluated: !acceptClose
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
2674 closeEvent->ignore(); -
2675 return;
executed: return;
Execution Count:1
1
2676 } -
2677 -
2678 d->removeButtonsFromMenuBar(); -
2679 -
2680 d->setActive(false); -
2681 if (parentWidget() && testAttribute(Qt::WA_DeleteOnClose)) {
partially evaluated: parentWidget()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: testAttribute(Qt::WA_DeleteOnClose)
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
2682 QChildEvent childRemoved(QEvent::ChildRemoved, this); -
2683 QApplication::sendEvent(parentWidget(), &childRemoved); -
2684 }
executed: }
Execution Count:3
3
2685 closeEvent->accept(); -
2686}
executed: }
Execution Count:3
3
2687 -
2688 -
2689 -
2690 -
2691void QMdiSubWindow::leaveEvent(QEvent * ) -
2692{ -
2693 QMdiSubWindowPrivate * const d = d_func(); -
2694 if (d->hoveredSubControl != QStyle::SC_None) {
partially evaluated: d->hoveredSubControl != QStyle::SC_None
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22
0-22
2695 d->hoveredSubControl = QStyle::SC_None; -
2696 update(QRegion(0, 0, width(), d->titleBarHeight())); -
2697 }
never executed: }
0
2698}
executed: }
Execution Count:22
22
2699 -
2700 -
2701 -
2702 -
2703void QMdiSubWindow::resizeEvent(QResizeEvent *resizeEvent) -
2704{ -
2705 QMdiSubWindowPrivate * const d = d_func(); -
2706 -
2707 if (d->sizeGrip) {
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:579
0-579
2708 d->sizeGrip->move(isLeftToRight() ? width() - d->sizeGrip->width() : 0, -
2709 height() - d->sizeGrip->height()); -
2710 }
never executed: }
0
2711 -
2712 -
2713 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:563
16-563
2714 QWidget::resizeEvent(resizeEvent); -
2715 return;
executed: return;
Execution Count:16
16
2716 } -
2717 -
2718 if (d->isMaximizeMode)
evaluated: d->isMaximizeMode
TRUEFALSE
yes
Evaluation Count:94
yes
Evaluation Count:469
94-469
2719 d->ensureWindowState(Qt::WindowMaximized);
executed: d->ensureWindowState(Qt::WindowMaximized);
Execution Count:94
94
2720 -
2721 d->updateMask(); -
2722 if (!isVisible())
evaluated: !isVisible()
TRUEFALSE
yes
Evaluation Count:245
yes
Evaluation Count:318
245-318
2723 return;
executed: return;
Execution Count:245
245
2724 -
2725 if (d->resizeTimerId <= 0)
evaluated: d->resizeTimerId <= 0
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:293
25-293
2726 d->cachedStyleOptions = d->titleBarOptions();
executed: d->cachedStyleOptions = d->titleBarOptions();
Execution Count:25
25
2727 else -
2728 killTimer(d->resizeTimerId);
executed: killTimer(d->resizeTimerId);
Execution Count:293
293
2729 d->resizeTimerId = startTimer(200); -
2730}
executed: }
Execution Count:318
318
2731 -
2732 -
2733 -
2734 -
2735void QMdiSubWindow::timerEvent(QTimerEvent *timerEvent) -
2736{ -
2737 QMdiSubWindowPrivate * const d = d_func(); -
2738 if (timerEvent->timerId() == d->resizeTimerId) {
partially evaluated: timerEvent->timerId() == d->resizeTimerId
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
2739 killTimer(d->resizeTimerId); -
2740 d->resizeTimerId = -1; -
2741 d->updateDirtyRegions(); -
2742 }
executed: }
Execution Count:3
3
2743}
executed: }
Execution Count:3
3
2744 -
2745 -
2746 -
2747 -
2748void QMdiSubWindow::moveEvent(QMoveEvent *moveEvent) -
2749{ -
2750 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:182
3-182
2751 QWidget::moveEvent(moveEvent); -
2752 return;
executed: return;
Execution Count:3
3
2753 } -
2754 -
2755 QMdiSubWindowPrivate * const d = d_func(); -
2756 if (d->isMaximizeMode)
evaluated: d->isMaximizeMode
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:161
21-161
2757 d->ensureWindowState(Qt::WindowMaximized);
executed: d->ensureWindowState(Qt::WindowMaximized);
Execution Count:21
21
2758}
executed: }
Execution Count:182
182
2759 -
2760 -
2761 -
2762 -
2763void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) -
2764{ -
2765 if (!parent() || (windowFlags() & Qt::FramelessWindowHint)) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:197
partially evaluated: (windowFlags() & Qt::FramelessWindowHint)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
0-197
2766 QWidget::paintEvent(paintEvent); -
2767 return;
executed: return;
Execution Count:6
6
2768 } -
2769 -
2770 QMdiSubWindowPrivate * const d = d_func(); -
2771 if (isMaximized() && !d->drawTitleBarWhenMaximized())
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:152
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:28
17-152
2772 return;
executed: return;
Execution Count:17
17
2773 -
2774 if (d->resizeTimerId != -1) {
evaluated: d->resizeTimerId != -1
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:149
31-149
2775 -
2776 int border = d->hasBorder(d->cachedStyleOptions) ? 4 : 0;
partially evaluated: d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
yes
Evaluation Count:31
no
Evaluation Count:0
0-31
2777 int titleBarHeight = d->titleBarHeight(d->cachedStyleOptions); -
2778 titleBarHeight -= isMinimized() ? 2 * border : border;
partially evaluated: isMinimized()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31
0-31
2779 d->cachedStyleOptions.rect = QRect(border, border, width() - 2 * border, titleBarHeight); -
2780 if (!d->windowTitle.isEmpty()) {
evaluated: !d->windowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:26
5-26
2781 int width = style()->subControlRect(QStyle::CC_TitleBar, &d->cachedStyleOptions, -
2782 QStyle::SC_TitleBarLabel, this).width(); -
2783 d->cachedStyleOptions.text = d->cachedStyleOptions.fontMetrics -
2784 .elidedText(d->windowTitle, Qt::ElideRight, width); -
2785 }
executed: }
Execution Count:5
5
2786 } else {
executed: }
Execution Count:31
31
2787 -
2788 d->cachedStyleOptions = d->titleBarOptions(); -
2789 }
executed: }
Execution Count:149
149
2790 -
2791 QStylePainter painter(this); -
2792 if (!d->windowTitle.isEmpty())
evaluated: !d->windowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:158
22-158
2793 painter.setFont(d->font);
executed: painter.setFont(d->font);
Execution Count:22
22
2794 painter.drawComplexControl(QStyle::CC_TitleBar, d->cachedStyleOptions); -
2795 -
2796 if (isMinimized() && !d->hasBorder(d->cachedStyleOptions))
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:171
partially evaluated: !d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-171
2797 return;
never executed: return;
0
2798 -
2799 QStyleOptionFrame frameOptions; -
2800 frameOptions.initFrom(this); -
2801 frameOptions.lineWidth = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); -
2802 if (d->isActive)
evaluated: d->isActive
TRUEFALSE
yes
Evaluation Count:165
yes
Evaluation Count:15
15-165
2803 frameOptions.state |= QStyle::State_Active;
executed: frameOptions.state |= QStyle::State_Active;
Execution Count:165
165
2804 else -
2805 frameOptions.state &= ~QStyle::State_Active;
executed: frameOptions.state &= ~QStyle::State_Active;
Execution Count:15
15
2806 -
2807 -
2808 if (!isMinimized() && !d->hasBorder(d->cachedStyleOptions))
evaluated: !isMinimized()
TRUEFALSE
yes
Evaluation Count:171
yes
Evaluation Count:9
partially evaluated: !d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:171
0-171
2809 painter.setClipRect(rect().adjusted(0, d->titleBarHeight(d->cachedStyleOptions), 0, 0));
never executed: painter.setClipRect(rect().adjusted(0, d->titleBarHeight(d->cachedStyleOptions), 0, 0));
0
2810 if (!isMinimized() || d->hasBorder(d->cachedStyleOptions))
evaluated: !isMinimized()
TRUEFALSE
yes
Evaluation Count:171
yes
Evaluation Count:9
partially evaluated: d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-171
2811 painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions);
executed: painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions);
Execution Count:180
180
2812}
executed: }
Execution Count:180
180
2813 -
2814 -
2815 -
2816 -
2817void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent) -
2818{ -
2819 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2820 QWidget::mousePressEvent(mouseEvent); -
2821 return;
never executed: return;
0
2822 } -
2823 -
2824 QMdiSubWindowPrivate * const d = d_func(); -
2825 if (d->isInInteractiveMode)
partially evaluated: d->isInInteractiveMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2826 d->leaveInteractiveMode();
never executed: d->leaveInteractiveMode();
0
2827 -
2828 if (d->isInRubberBandMode)
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2829 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
2830 -
2831 -
2832 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2833 mouseEvent->ignore(); -
2834 return;
never executed: return;
0
2835 } -
2836 -
2837 if (d->currentOperation != QMdiSubWindowPrivate::None) {
evaluated: d->currentOperation != QMdiSubWindowPrivate::None
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
2838 d->updateCursor(); -
2839 d->mousePressPosition = mapToParent(mouseEvent->pos()); -
2840 if (d->resizeEnabled || d->moveEnabled)
evaluated: d->resizeEnabled
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
partially evaluated: d->moveEnabled
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-6
2841 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:7
7
2842 -
2843 if ((testOption(QMdiSubWindow::RubberBandResize) && d->isResizeOperation())
evaluated: testOption(QMdiSubWindow::RubberBandResize)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
evaluated: d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-5
2844 || (testOption(QMdiSubWindow::RubberBandMove) && d->isMoveOperation())) {
evaluated: testOption(QMdiSubWindow::RubberBandMove)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5
partially evaluated: d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-5
2845 d->enterRubberBandMode(); -
2846 }
executed: }
Execution Count:2
2
2847 -
2848 return;
executed: return;
Execution Count:7
7
2849 } -
2850 -
2851 d->activeSubControl = d->hoveredSubControl; -
2852 -
2853 if (d->activeSubControl == QStyle::SC_TitleBarSysMenu)
partially evaluated: d->activeSubControl == QStyle::SC_TitleBarSysMenu
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2854 showSystemMenu();
never executed: showSystemMenu();
0
2855 else -
2856 -
2857 update(QRegion(0, 0, width(), d->titleBarHeight()));
executed: update(QRegion(0, 0, width(), d->titleBarHeight()));
Execution Count:3
3
2858} -
2859 -
2860 -
2861 -
2862 -
2863void QMdiSubWindow::mouseDoubleClickEvent(QMouseEvent *mouseEvent) -
2864{ -
2865 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
2866 QWidget::mouseDoubleClickEvent(mouseEvent); -
2867 return;
never executed: return;
0
2868 } -
2869 -
2870 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
2871 mouseEvent->ignore(); -
2872 return;
never executed: return;
0
2873 } -
2874 -
2875 QMdiSubWindowPrivate * const d = d_func(); -
2876 if (!d->isMoveOperation()) {
partially evaluated: !d->isMoveOperation()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
2877 -
2878 if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu)
never evaluated: d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
0
2879 close();
never executed: close();
0
2880 -
2881 return;
never executed: return;
0
2882 } -
2883 -
2884 Qt::WindowFlags flags = windowFlags(); -
2885 if (isMinimized()) {
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
2886 if ((isShaded() && (flags & Qt::WindowShadeButtonHint))
evaluated: isShaded()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
partially evaluated: (flags & Qt::WindowShadeButtonHint)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2887 || (flags & Qt::WindowMinimizeButtonHint)) {
partially evaluated: (flags & Qt::WindowMinimizeButtonHint)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2888 showNormal(); -
2889 }
executed: }
Execution Count:2
2
2890 return;
executed: return;
Execution Count:2
2
2891 } -
2892 -
2893 if (isMaximized()) {
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
2894 if (flags & Qt::WindowMaximizeButtonHint)
partially evaluated: flags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2895 showNormal();
executed: showNormal();
Execution Count:1
1
2896 return;
executed: return;
Execution Count:1
1
2897 } -
2898 -
2899 if (flags & Qt::WindowShadeButtonHint)
evaluated: flags & Qt::WindowShadeButtonHint
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2900 showShaded();
executed: showShaded();
Execution Count:1
1
2901 else if (flags & Qt::WindowMaximizeButtonHint)
partially evaluated: flags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2902 showMaximized();
executed: showMaximized();
Execution Count:1
1
2903} -
2904 -
2905 -
2906 -
2907 -
2908void QMdiSubWindow::mouseReleaseEvent(QMouseEvent *mouseEvent) -
2909{ -
2910 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2911 QWidget::mouseReleaseEvent(mouseEvent); -
2912 return;
never executed: return;
0
2913 } -
2914 -
2915 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
2916 mouseEvent->ignore(); -
2917 return;
never executed: return;
0
2918 } -
2919 -
2920 QMdiSubWindowPrivate * const d = d_func(); -
2921 if (d->currentOperation != QMdiSubWindowPrivate::None) {
evaluated: d->currentOperation != QMdiSubWindowPrivate::None
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
2922 -
2923 if (d->isInRubberBandMode && !d->isInInteractiveMode)
evaluated: d->isInRubberBandMode
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
partially evaluated: !d->isInInteractiveMode
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-5
2924 d->leaveRubberBandMode();
executed: d->leaveRubberBandMode();
Execution Count:2
2
2925 -
2926 if (d->resizeEnabled || d->moveEnabled)
evaluated: d->resizeEnabled
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
partially evaluated: d->moveEnabled
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-6
2927 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:7
7
2928 }
executed: }
Execution Count:7
7
2929 -
2930 d->currentOperation = d->getOperation(mouseEvent->pos()); -
2931 d->updateCursor(); -
2932 -
2933 d->hoveredSubControl = d->getSubControl(mouseEvent->pos()); -
2934 if (d->activeSubControl != QStyle::SC_None
evaluated: d->activeSubControl != QStyle::SC_None
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:9
1-9
2935 && d->activeSubControl == d->hoveredSubControl) {
partially evaluated: d->activeSubControl == d->hoveredSubControl
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2936 d->processClickedSubControl(); -
2937 }
never executed: }
0
2938 d->activeSubControl = QStyle::SC_None; -
2939 update(QRegion(0, 0, width(), d->titleBarHeight())); -
2940}
executed: }
Execution Count:10
10
2941 -
2942 -
2943 -
2944 -
2945void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent) -
2946{ -
2947 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:362
0-362
2948 QWidget::mouseMoveEvent(mouseEvent); -
2949 return;
never executed: return;
0
2950 } -
2951 -
2952 QMdiSubWindowPrivate * const d = d_func(); -
2953 -
2954 if (!d->isMoveOperation() && !d->isResizeOperation()) {
evaluated: !d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:322
yes
Evaluation Count:40
evaluated: !d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:311
11-322
2955 -
2956 const QStyleOptionTitleBar options = d->titleBarOptions(); -
2957 QStyle::SubControl oldHover = d->hoveredSubControl; -
2958 d->hoveredSubControl = d->getSubControl(mouseEvent->pos()); -
2959 QRegion hoverRegion; -
2960 if (isHoverControl(oldHover) && oldHover != d->hoveredSubControl)
partially evaluated: isHoverControl(oldHover)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
never evaluated: oldHover != d->hoveredSubControl
0-11
2961 hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this);
never executed: hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this);
0
2962 if (isHoverControl(d->hoveredSubControl) && d->hoveredSubControl != oldHover) {
partially evaluated: isHoverControl(d->hoveredSubControl)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
never evaluated: d->hoveredSubControl != oldHover
0-11
2963 hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, -
2964 d->hoveredSubControl, this); -
2965 }
never executed: }
0
2966 -
2967 -
2968 -
2969 -
2970 if (!hoverRegion.isEmpty())
partially evaluated: !hoverRegion.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-11
2971 update(hoverRegion);
never executed: update(hoverRegion);
0
2972 }
executed: }
Execution Count:11
11
2973 -
2974 if ((mouseEvent->buttons() & Qt::LeftButton) || d->isInInteractiveMode) {
evaluated: (mouseEvent->buttons() & Qt::LeftButton)
TRUEFALSE
yes
Evaluation Count:351
yes
Evaluation Count:11
partially evaluated: d->isInInteractiveMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-351
2975 if ((d->isResizeOperation() && d->resizeEnabled) || (d->isMoveOperation() && d->moveEnabled))
evaluated: d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:311
yes
Evaluation Count:40
partially evaluated: d->resizeEnabled
TRUEFALSE
yes
Evaluation Count:311
no
Evaluation Count:0
partially evaluated: d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
partially evaluated: d->moveEnabled
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-311
2976 d->setNewGeometry(mapToParent(mouseEvent->pos()));
executed: d->setNewGeometry(mapToParent(mouseEvent->pos()));
Execution Count:351
351
2977 return;
executed: return;
Execution Count:351
351
2978 } -
2979 -
2980 -
2981 d->currentOperation = d->getOperation(mouseEvent->pos()); -
2982 if ((d->isResizeOperation() && !d->resizeEnabled) || (d->isMoveOperation() && !d->moveEnabled))
evaluated: d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:8
partially evaluated: !d->resizeEnabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
evaluated: d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:8
partially evaluated: !d->moveEnabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-8
2983 d->currentOperation = QMdiSubWindowPrivate::None;
never executed: d->currentOperation = QMdiSubWindowPrivate::None;
0
2984 d->updateCursor(); -
2985}
executed: }
Execution Count:11
11
2986 -
2987 -
2988 -
2989 -
2990void QMdiSubWindow::keyPressEvent(QKeyEvent *keyEvent) -
2991{ -
2992 QMdiSubWindowPrivate * const d = d_func(); -
2993 if (!d->isInInteractiveMode || !parent()) {
never evaluated: !d->isInInteractiveMode
never evaluated: !parent()
0
2994 keyEvent->ignore(); -
2995 return;
never executed: return;
0
2996 } -
2997 -
2998 QPoint delta; -
2999 switch (keyEvent->key()) { -
3000 case Qt::Key_Right: -
3001 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3002 delta = QPoint(d->keyboardPageStep, 0);
never executed: delta = QPoint(d->keyboardPageStep, 0);
0
3003 else -
3004 delta = QPoint(d->keyboardSingleStep, 0);
never executed: delta = QPoint(d->keyboardSingleStep, 0);
0
3005 break;
never executed: break;
0
3006 case Qt::Key_Up: -
3007 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3008 delta = QPoint(0, -d->keyboardPageStep);
never executed: delta = QPoint(0, -d->keyboardPageStep);
0
3009 else -
3010 delta = QPoint(0, -d->keyboardSingleStep);
never executed: delta = QPoint(0, -d->keyboardSingleStep);
0
3011 break;
never executed: break;
0
3012 case Qt::Key_Left: -
3013 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3014 delta = QPoint(-d->keyboardPageStep, 0);
never executed: delta = QPoint(-d->keyboardPageStep, 0);
0
3015 else -
3016 delta = QPoint(-d->keyboardSingleStep, 0);
never executed: delta = QPoint(-d->keyboardSingleStep, 0);
0
3017 break;
never executed: break;
0
3018 case Qt::Key_Down: -
3019 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3020 delta = QPoint(0, d->keyboardPageStep);
never executed: delta = QPoint(0, d->keyboardPageStep);
0
3021 else -
3022 delta = QPoint(0, d->keyboardSingleStep);
never executed: delta = QPoint(0, d->keyboardSingleStep);
0
3023 break;
never executed: break;
0
3024 case Qt::Key_Escape: -
3025 case Qt::Key_Return: -
3026 case Qt::Key_Enter: -
3027 d->leaveInteractiveMode(); -
3028 return;
never executed: return;
0
3029 default: -
3030 keyEvent->ignore(); -
3031 return;
never executed: return;
0
3032 } -
3033 -
3034 -
3035 QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta); -
3036 QRect oldGeometry = -
3037 -
3038 d->isInRubberBandMode ? d->rubberBand->geometry() :
never evaluated: d->isInRubberBandMode
0
3039 -
3040 geometry(); -
3041 d->setNewGeometry(newPosition); -
3042 QRect currentGeometry = -
3043 -
3044 d->isInRubberBandMode ? d->rubberBand->geometry() :
never evaluated: d->isInRubberBandMode
0
3045 -
3046 geometry(); -
3047 if (currentGeometry == oldGeometry)
never evaluated: currentGeometry == oldGeometry
0
3048 return;
never executed: return;
0
3049 -
3050 -
3051 -
3052 QPoint actualDelta; -
3053 if (d->isMoveOperation()) {
never evaluated: d->isMoveOperation()
0
3054 actualDelta = QPoint(currentGeometry.x() - oldGeometry.x(), -
3055 currentGeometry.y() - oldGeometry.y()); -
3056 } else {
never executed: }
0
3057 int dx = isLeftToRight() ? currentGeometry.width() - oldGeometry.width()
never evaluated: isLeftToRight()
0
3058 : currentGeometry.x() - oldGeometry.x(); -
3059 actualDelta = QPoint(dx, currentGeometry.height() - oldGeometry.height()); -
3060 }
never executed: }
0
3061 -
3062 -
3063 if (actualDelta != delta)
never evaluated: actualDelta != delta
0
3064 newPosition += (actualDelta - delta);
never executed: newPosition += (actualDelta - delta);
0
3065 cursor().setPos(parentWidget()->mapToGlobal(newPosition)); -
3066 -
3067}
never executed: }
0
3068 -
3069 -
3070 -
3071 -
3072 -
3073void QMdiSubWindow::contextMenuEvent(QContextMenuEvent *contextMenuEvent) -
3074{ -
3075 QMdiSubWindowPrivate * const d = d_func(); -
3076 if (!d->systemMenu) {
never evaluated: !d->systemMenu
0
3077 contextMenuEvent->ignore(); -
3078 return;
never executed: return;
0
3079 } -
3080 -
3081 if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
never evaluated: d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
0
3082 || d->getRegion(QMdiSubWindowPrivate::Move).contains(contextMenuEvent->pos())) {
never evaluated: d->getRegion(QMdiSubWindowPrivate::Move).contains(contextMenuEvent->pos())
0
3083 d->systemMenu->exec(contextMenuEvent->globalPos()); -
3084 } else {
never executed: }
0
3085 contextMenuEvent->ignore(); -
3086 }
never executed: }
0
3087} -
3088 -
3089 -
3090 -
3091 -
3092 -
3093void QMdiSubWindow::focusInEvent(QFocusEvent *focusInEvent) -
3094{ -
3095 d_func()->focusInReason = focusInEvent->reason(); -
3096}
executed: }
Execution Count:107
107
3097 -
3098 -
3099 -
3100 -
3101void QMdiSubWindow::focusOutEvent(QFocusEvent * ) -
3102{ -
3103 -
3104} -
3105 -
3106 -
3107 -
3108 -
3109void QMdiSubWindow::childEvent(QChildEvent *childEvent) -
3110{ -
3111 if (childEvent->type() != QEvent::ChildPolished)
evaluated: childEvent->type() != QEvent::ChildPolished
TRUEFALSE
yes
Evaluation Count:417
yes
Evaluation Count:190
190-417
3112 return;
executed: return;
Execution Count:417
417
3113 -
3114 if (QSizeGrip *sizeGrip = qobject_cast<QSizeGrip *>(childEvent->child()))
partially evaluated: QSizeGrip *sizeGrip = qobject_cast<QSizeGrip *>(childEvent->child())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:190
0-190
3115 d_func()->setSizeGrip(sizeGrip);
never executed: d_func()->setSizeGrip(sizeGrip);
0
3116 -
3117}
executed: }
Execution Count:190
190
3118 -
3119 -
3120 -
3121 -
3122QSize QMdiSubWindow::sizeHint() const -
3123{ -
3124 const QMdiSubWindowPrivate * const d = d_func(); -
3125 int margin, minWidth; -
3126 d->sizeParameters(&margin, &minWidth); -
3127 QSize size(2 * margin, d->titleBarHeight() + margin); -
3128 if (d->baseWidget && d->baseWidget->sizeHint().isValid())
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:301
yes
Evaluation Count:15
evaluated: d->baseWidget->sizeHint().isValid()
TRUEFALSE
yes
Evaluation Count:122
yes
Evaluation Count:179
15-301
3129 size += d->baseWidget->sizeHint();
executed: size += d->baseWidget->sizeHint();
Execution Count:122
122
3130 return size.expandedTo(minimumSizeHint());
executed: return size.expandedTo(minimumSizeHint());
Execution Count:316
316
3131} -
3132 -
3133 -
3134 -
3135 -
3136QSize QMdiSubWindow::minimumSizeHint() const -
3137{ -
3138 const QMdiSubWindowPrivate * const d = d_func(); -
3139 if (isVisible())
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:276
yes
Evaluation Count:733
276-733
3140 ensurePolished();
executed: ensurePolished();
Execution Count:276
276
3141 -
3142 -
3143 if (parent() && isMinimized() && !isShaded())
evaluated: parent()
TRUEFALSE
yes
Evaluation Count:998
yes
Evaluation Count:11
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:964
evaluated: !isShaded()
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:10
10-998
3144 return d->iconSize();
executed: return d->iconSize();
Execution Count:24
24
3145 -
3146 -
3147 int margin, minWidth; -
3148 d->sizeParameters(&margin, &minWidth); -
3149 int decorationHeight = margin + d->titleBarHeight(); -
3150 int minHeight = decorationHeight; -
3151 -
3152 -
3153 if (parent() && isShaded())
evaluated: parent()
TRUEFALSE
yes
Evaluation Count:974
yes
Evaluation Count:11
evaluated: isShaded()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:964
10-974
3154 return QSize(qMax(minWidth, width()), d->titleBarHeight());
executed: return QSize(qMax(minWidth, width()), d->titleBarHeight());
Execution Count:10
10
3155 -
3156 -
3157 if (layout()) {
evaluated: layout()
TRUEFALSE
yes
Evaluation Count:891
yes
Evaluation Count:84
84-891
3158 QSize minLayoutSize = layout()->minimumSize(); -
3159 if (minLayoutSize.isValid()) {
partially evaluated: minLayoutSize.isValid()
TRUEFALSE
yes
Evaluation Count:891
no
Evaluation Count:0
0-891
3160 minWidth = qMax(minWidth, minLayoutSize.width() + 2 * margin); -
3161 minHeight += minLayoutSize.height(); -
3162 }
executed: }
Execution Count:891
891
3163 } else if (d->baseWidget && d->baseWidget->isVisible()) {
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:82
evaluated: d->baseWidget->isVisible()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
executed: }
Execution Count:891
1-891
3164 QSize minBaseWidgetSize = d->baseWidget->minimumSizeHint(); -
3165 if (minBaseWidgetSize.isValid()) {
partially evaluated: minBaseWidgetSize.isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
3166 minWidth = qMax(minWidth, minBaseWidgetSize.width() + 2 * margin); -
3167 minHeight += minBaseWidgetSize.height(); -
3168 }
never executed: }
0
3169 }
executed: }
Execution Count:1
1
3170 -
3171 -
3172 -
3173 int sizeGripHeight = 0; -
3174 if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:975
never evaluated: d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this))
0-975
3175 sizeGripHeight = d->sizeGrip->height();
never executed: sizeGripHeight = d->sizeGrip->height();
0
3176 -
3177 -
3178 -
3179 -
3180 minHeight = qMax(minHeight, decorationHeight + sizeGripHeight); -
3181 -
3182 -
3183 return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut());
executed: return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut());
Execution Count:975
975
3184} -
3185 -
3186 -
3187 -
3188 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial