widgets/qmdisubwindow.cpp

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

Generated by Squish Coco Non-Commercial