widgets/qmdisubwindow.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 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_WS_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:8523
yes
Evaluation Count:1754
1754-8523
233 if (qobject_cast<QMdiSubWindow *>(parent))
evaluated: qobject_cast<QMdiSubWindow *>(parent)
TRUEFALSE
yes
Evaluation Count:865
yes
Evaluation Count:7658
865-7658
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:7658
7658
237 return false;
executed: return false;
Execution Count:1754
1754
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:4733
yes
Evaluation Count:386
386-4733
244 if (mdiArea->viewMode() == QMdiArea::TabbedView)
partially evaluated: mdiArea->viewMode() == QMdiArea::TabbedView
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4733
0-4733
245 return true;
never executed: return true;
0
246 }
executed: }
Execution Count:4733
4733
247 return false;
executed: return false;
Execution Count:5119
5119
248} -
249 -
250template<typename T> -
251static inline ControlElement<T> *ptr(QWidget *widget) -
252{ -
253 if (widget && widget->qt_metacast("ControlElement")
partially evaluated: widget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
never evaluated: widget->qt_metacast("ControlElement")
0-60
254 && strcmp(widget->metaObject()->className(), T::staticMetaObject.className()) == 0) {
never evaluated: strcmp(widget->metaObject()->className(), T::staticMetaObject.className()) == 0
0
255 return static_cast<ControlElement<T> *>(widget);
never executed: return static_cast<ControlElement<T> *>(widget);
0
256 } -
257 return 0;
executed: return 0;
Execution Count:60
60
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:208
yes
Evaluation Count:19
19-208
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:92
yes
Evaluation Count:116
92-116
266 originalTitle = QLatin1String("");
executed: originalTitle = QLatin1String("");
Execution Count:92
92
267 }
executed: }
Execution Count:208
208
268 return originalTitle;
executed: return originalTitle;
Execution Count:227
227
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:14
yes
Evaluation Count:21
14-21
276 return;
executed: return;
Execution Count:14
14
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:20
yes
Evaluation Count:1
1-20
279 if (!original.contains(QMdiSubWindow::tr("- [%1]").arg(childTitle)))
partially evaluated: !original.contains(QMdiSubWindow::tr("- [%1]").arg(childTitle))
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
0-20
280 q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle));
executed: q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle));
Execution Count:20
20
281 -
282 } else {
executed: }
Execution Count:20
20
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:14
14
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_WS_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:124
124
408 -
409/* -
410 \internal -
411*/ -
412QSize ControlLabel::sizeHint() const -
413{ -
414 return label.size();
executed: return label.size();
Execution Count:348
348
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:124
yes
Evaluation Count:602
124-602
423 updateWindowIcon();
executed: updateWindowIcon();
Execution Count:124
124
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:602
0-602
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:726
726
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:21
21
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:248
no
Evaluation Count:0
0-248
491 menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget());
executed: menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget());
Execution Count:248
248
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:248
248
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:33
33
511 || (visibleControls & QStyle::SC_MdiNormalButton)
executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton);
Execution Count:33
33
512 || (visibleControls & QStyle::SC_MdiCloseButton);
executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton);
Execution Count:33
33
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;
executed (the execution status of this line is deduced): QStyleOptionComplex opt;
-
537 initStyleOption(&opt);
executed (the execution status of this line is deduced): initStyleOption(&opt);
-
538 return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea);
executed: return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea);
Execution Count:5
5
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:108
yes
Evaluation Count:16
16-108
554 mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget());
executed: mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget());
Execution Count:108
108
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:124
124
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:186
186
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:607
yes
Evaluation Count:3654
607-3654
578 subControl = QStyle::SC_MdiNormalButton;
executed: subControl = QStyle::SC_MdiNormalButton;
Execution Count:607
607
579 else if (action == QMdiSubWindowPrivate::CloseAction)
evaluated: action == QMdiSubWindowPrivate::CloseAction
TRUEFALSE
yes
Evaluation Count:610
yes
Evaluation Count:3044
610-3044
580 subControl = QStyle::SC_MdiCloseButton;
executed: subControl = QStyle::SC_MdiCloseButton;
Execution Count:610
610
581 else if (action == QMdiSubWindowPrivate::MinimizeAction)
evaluated: action == QMdiSubWindowPrivate::MinimizeAction
TRUEFALSE
yes
Evaluation Count:607
yes
Evaluation Count:2437
607-2437
582 subControl = QStyle::SC_MdiMinButton;
executed: subControl = QStyle::SC_MdiMinButton;
Execution Count:607
607
583 -
584 if (subControl == QStyle::SC_None)
evaluated: subControl == QStyle::SC_None
TRUEFALSE
yes
Evaluation Count:2437
yes
Evaluation Count:1824
1824-2437
585 return;
executed: return;
Execution Count:2437
2437
586 -
587 if (visible && !(visibleControls & subControl))
evaluated: visible
TRUEFALSE
yes
Evaluation Count:909
yes
Evaluation Count:915
partially evaluated: !(visibleControls & subControl)
TRUEFALSE
yes
Evaluation Count:909
no
Evaluation Count:0
0-915
588 visibleControls |= subControl;
executed: visibleControls |= subControl;
Execution Count:909
909
589 else if (!visible && (visibleControls & subControl))
partially evaluated: !visible
TRUEFALSE
yes
Evaluation Count:915
no
Evaluation Count:0
evaluated: (visibleControls & subControl)
TRUEFALSE
yes
Evaluation Count:543
yes
Evaluation Count:372
0-915
590 visibleControls &= ~subControl;
executed: visibleControls &= ~subControl;
Execution Count:543
543
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:21
no
Evaluation Count:0
0-21
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:21
never evaluated: hoverControl != QStyle::SC_None
never evaluated: (activeControl == QStyle::SC_None)
0-21
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:21
21
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());
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) {
partially evaluated: hoverControl != under_mouse
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
663 hoverControl = under_mouse;
executed (the execution status of this line is deduced): hoverControl = under_mouse;
-
664 update();
executed (the execution status of this line is deduced): update();
-
665 }
executed: }
Execution Count:5
5
666}
executed: }
Execution Count:5
5
667 -
668/* -
669 \internal -
670*/ -
671void ControllerWidget::leaveEvent(QEvent * /*event*/) -
672{ -
673 hoverControl = QStyle::SC_None;
executed (the execution status of this line is deduced): hoverControl = QStyle::SC_None;
-
674 update();
executed (the execution status of this line is deduced): update();
-
675}
executed: }
Execution Count:4
4
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:702
0-702
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:702
702
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:212
212
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:124
124
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:117
117
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:335
yes
Evaluation Count:147
evaluated: drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:79
yes
Evaluation Count:68
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:68
0-335
752 return 0;
executed: return 0;
Execution Count:414
414
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:33
partially evaluated: !mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:33
partially evaluated: mdiChild->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:33
0-33
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) {
partially evaluated: m_menuLabel
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
partially evaluated: mdiChild->windowFlags() & Qt::WindowSystemMenuHint
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
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)
partially evaluated: currentLeft
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:33
0-33
773 currentLeft->hide();
never executed: currentLeft->hide();
0
774 if (currentLeft != m_menuLabel) {
partially evaluated: currentLeft != m_menuLabel
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
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:33
33
778 m_menuLabel->show();
executed (the execution status of this line is deduced): m_menuLabel->show();
-
779 }
executed: }
Execution Count:33
33
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()) {
partially evaluated: controllerWidget
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
partially evaluated: controllerWidget->hasVisibleControls()
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
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)
partially evaluated: currentRight
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:33
0-33
784 currentRight->hide();
never executed: currentRight->hide();
0
785 if (currentRight != m_controllerWidget) {
partially evaluated: currentRight != m_controllerWidget
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
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:33
33
789 m_controllerWidget->show();
executed (the execution status of this line is deduced): m_controllerWidget->show();
-
790 }
executed: }
Execution Count:33
33
791 mdiChild->d_func()->setNewWindowTitle();
executed (the execution status of this line is deduced): mdiChild->d_func()->setNewWindowTitle();
-
792}
executed: }
Execution Count:33
33
793 -
794/* -
795 \internal -
796*/ -
797void ControlContainer::removeButtonsFromMenuBar(QMenuBar *menuBar) -
798{ -
799 if (menuBar && menuBar != m_menuBar) {
evaluated: menuBar
TRUEFALSE
yes
Evaluation Count:206
yes
Evaluation Count:475
evaluated: menuBar != m_menuBar
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:172
34-475
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:34
34
805 -
806 if (!m_menuBar || !mdiChild || qt_widget_private(mdiChild->window())->data.in_destructor)
evaluated: !m_menuBar
TRUEFALSE
yes
Evaluation Count:434
yes
Evaluation Count:247
partially evaluated: !mdiChild
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:247
evaluated: qt_widget_private(mdiChild->window())->data.in_destructor
TRUEFALSE
yes
Evaluation Count:41
yes
Evaluation Count:206
0-434
807 return;
executed: return;
Execution Count:475
475
808 -
809 QMdiSubWindow *child = 0;
executed (the execution status of this line is deduced): QMdiSubWindow *child = 0;
-
810 if (m_controllerWidget) {
partially evaluated: m_controllerWidget
TRUEFALSE
yes
Evaluation Count:206
no
Evaluation Count:0
0-206
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:30
yes
Evaluation Count:176
30-176
813 if (ControlElement<ControllerWidget> *ce = ptr<ControllerWidget>(previousRight)) {
partially evaluated: ControlElement<ControllerWidget> *ce = ptr<ControllerWidget>(previousRight)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
814 if (!ce->mdiChild || !ce->mdiChild->isMaximized())
never evaluated: !ce->mdiChild
never evaluated: !ce->mdiChild->isMaximized()
0
815 previousRight = 0;
never executed: previousRight = 0;
0
816 else -
817 child = ce->mdiChild;
never executed: child = ce->mdiChild;
0
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) {
partially evaluated: previousRight
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
821 previousRight->show();
never executed (the execution status of this line is deduced): previousRight->show();
-
822 previousRight = 0;
never executed (the execution status of this line is deduced): previousRight = 0;
-
823 }
never executed: }
0
824 }
executed: }
Execution Count:30
30
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:206
206
828 if (m_menuLabel) {
partially evaluated: m_menuLabel
TRUEFALSE
yes
Evaluation Count:206
no
Evaluation Count:0
0-206
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:30
yes
Evaluation Count:176
30-176
831 if (ControlElement<ControlLabel> *ce = ptr<ControlLabel>(previousLeft)) {
partially evaluated: ControlElement<ControlLabel> *ce = ptr<ControlLabel>(previousLeft)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
832 if (!ce->mdiChild || !ce->mdiChild->isMaximized())
never evaluated: !ce->mdiChild
never evaluated: !ce->mdiChild->isMaximized()
0
833 previousLeft = 0;
never executed: previousLeft = 0;
0
834 else if (!child)
never evaluated: !child
0
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) {
partially evaluated: previousLeft
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
839 previousLeft->show();
never executed (the execution status of this line is deduced): previousLeft->show();
-
840 previousLeft = 0;
never executed (the execution status of this line is deduced): previousLeft = 0;
-
841 }
never executed: }
0
842 }
executed: }
Execution Count:30
30
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:206
206
846 m_menuBar->update();
executed (the execution status of this line is deduced): m_menuBar->update();
-
847 if (child)
partially evaluated: child
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:206
0-206
848 child->d_func()->setNewWindowTitle();
never executed: child->d_func()->setNewWindowTitle();
0
849 else if (mdiChild)
partially evaluated: mdiChild
TRUEFALSE
yes
Evaluation Count:206
no
Evaluation Count:0
0-206
850 mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle());
executed: mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle());
Execution Count:206
206
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:124
124
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:536
yes
Evaluation Count:422
evaluated: now == q
TRUEFALSE
yes
Evaluation Count:125
yes
Evaluation Count:411
evaluated: q->isAncestorOf(now)
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:344
67-536
973 if (now == q && !isInInteractiveMode)
evaluated: now == q
TRUEFALSE
yes
Evaluation Count:125
yes
Evaluation Count:67
partially evaluated: !isInInteractiveMode
TRUEFALSE
yes
Evaluation Count:125
no
Evaluation Count:0
0-125
974 setFocusWidget();
executed: setFocusWidget();
Execution Count:125
125
975 setActive(true);
executed (the execution status of this line is deduced): setActive(true);
-
976 }
executed: }
Execution Count:192
192
977}
executed: }
Execution Count:958
958
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:123
yes
Evaluation Count:2
2-123
1005 return;
executed: return;
Execution Count:123
123
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:2
no
Evaluation Count:0
0-2
1010 layout->removeWidget(baseWidget);
executed: layout->removeWidget(baseWidget);
Execution Count:2
2
1011 if (baseWidget->windowTitle() == q->windowTitle()) {
partially evaluated: baseWidget->windowTitle() == q->windowTitle()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
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:2
2
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:2
2
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:124
124
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:124
124
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_WS_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:56
yes
Evaluation Count:19
19-56
1088 q->unsetCursor();
executed (the execution status of this line is deduced): q->unsetCursor();
-
1089 return;
executed: return;
Execution Count:56
56
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:23
yes
Evaluation Count:1003
23-1003
1106 return;
executed: return;
Execution Count:23
23
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:9027
9027
1110}
executed: }
Execution Count:1003
1003
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:59
yes
Evaluation Count:657
59-657
1119 return;
executed: return;
Execution Count:59
59
1120 -
1121 internalMinimumSize = (!q->isMinimized() && !q->minimumSize().isNull())
evaluated: !q->isMinimized()
TRUEFALSE
yes
Evaluation Count:613
yes
Evaluation Count:44
evaluated: !q->minimumSize().isNull()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:612
1-613
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:83
yes
Evaluation Count:574
evaluated: q->isMinimized()
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:530
evaluated: !q->isShaded()
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:10
10-574
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:540
evaluated: q->isShaded()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:530
0-540
1132 resizeEnabled = false;
executed: resizeEnabled = false;
Execution Count:10
10
1133 else -
1134 resizeEnabled = true;
executed: resizeEnabled = true;
Execution Count:530
530
1135 } -
1136 updateDirtyRegions();
executed (the execution status of this line is deduced): updateDirtyRegions();
-
1137}
executed: }
Execution Count:657
657
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:725
0-725
1146 q->clearMask();
never executed: q->clearMask();
0
1147 -
1148 if (!parent)
evaluated: !parent
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:702
23-702
1149 return;
executed: return;
Execution Count:23
23
1150 -
1151 if ((q->isMaximized() && !drawTitleBarWhenMaximized())
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:129
yes
Evaluation Count:573
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:66
63-573
1152 || q->windowFlags() & Qt::FramelessWindowHint)
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:639
0-639
1153 return;
executed: return;
Execution Count:63
63
1154 -
1155 if (resizeTimerId == -1)
evaluated: resizeTimerId == -1
TRUEFALSE
yes
Evaluation Count:360
yes
Evaluation Count:279
279-360
1156 cachedStyleOptions = titleBarOptions();
executed: cachedStyleOptions = titleBarOptions();
Execution Count:360
360
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:639
0-639
1161 q->setMask(frameMask.region);
never executed: q->setMask(frameMask.region);
0
1162}
executed: }
Execution Count:639
639
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:19
19
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:52
no
Evaluation Count:0
0-52
1280 q->setVisible(false);
executed: q->setVisible(false);
Execution Count:52
52
1281 -
1282 // Restore minimum size if set by user. -
1283 if (!userMinimumSize.isNull()) {
partially evaluated: !userMinimumSize.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
0-52
1284 q->setMinimumSize(userMinimumSize);
never executed (the execution status of this line is deduced): q->setMinimumSize(userMinimumSize);
-
1285 userMinimumSize = QSize(0, 0);
never executed (the execution status of this line is deduced): userMinimumSize = QSize(0, 0);
-
1286 }
never executed: }
0
1287 -
1288 // Show the internal widget if it was hidden by us, -
1289 if (baseWidget && isWidgetHiddenByUs) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:1
evaluated: isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:35
1-51
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:16
16
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:52
no
Evaluation Count:0
0-52
1300 q->setVisible(true);
executed: q->setVisible(true);
Execution Count:52
52
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:52
52
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:48
yes
Evaluation Count:2
evaluated: q->isAncestorOf(QApplication::focusWidget())
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:23
2-48
1344 restoreFocusWidget = QApplication::focusWidget();
executed: restoreFocusWidget = QApplication::focusWidget();
Execution Count:25
25
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:48
yes
Evaluation Count:2
2-48
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:48
48
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:47
yes
Evaluation Count:3
3-47
1361 q->setVisible(false);
executed: q->setVisible(false);
Execution Count:47
47
1362 -
1363 // Show the internal widget if it was hidden by us. -
1364 if (baseWidget && isWidgetHiddenByUs) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:2
evaluated: isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:46
2-48
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:2
2
1368 -
1369 updateGeometryConstraints();
executed (the execution status of this line is deduced): updateGeometryConstraints();
-
1370 -
1371 if (wasVisible) {
evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:3
3-47
1372#ifndef QT_NO_MENUBAR -
1373 if (QMenuBar *mBar = menuBar())
evaluated: QMenuBar *mBar = menuBar()
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:21
21-26
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:21
0-21
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:50
no
Evaluation Count:0
partially evaluated: scrollArea->viewport() == parent
TRUEFALSE
yes
Evaluation Count:50
no
Evaluation Count:0
0-50
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:50
no
Evaluation Count:0
0-50
1390 const int yOffset = vbar ? vbar->value() : 0;
partially evaluated: vbar
TRUEFALSE
yes
Evaluation Count:50
no
Evaluation Count:0
0-50
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:50
50
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:47
yes
Evaluation Count:3
3-47
1400 q->setVisible(true);
executed: q->setVisible(true);
Execution Count:47
47
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:50
50
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:1323
evaluated: !activationEnabled
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:1301
22-1323
1427 return;
executed: return;
Execution Count:54
54
1428 -
1429 if (activate && !isActive && q->isEnabled()) {
evaluated: activate
TRUEFALSE
yes
Evaluation Count:847
yes
Evaluation Count:454
evaluated: !isActive
TRUEFALSE
yes
Evaluation Count:162
yes
Evaluation Count:685
partially evaluated: q->isEnabled()
TRUEFALSE
yes
Evaluation Count:162
no
Evaluation Count:0
0-847
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:5
yes
Evaluation Count:157
5-157
1437 showButtonsInMenuBar(mBar);
executed: showButtonsInMenuBar(mBar);
Execution Count:5
5
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:162
evaluated: !activate
TRUEFALSE
yes
Evaluation Count:454
yes
Evaluation Count:685
evaluated: isActive
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:294
160-685
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:125
yes
Evaluation Count:35
35-125
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:101
yes
Evaluation Count:24
evaluated: focusWidget == q
TRUEFALSE
yes
Evaluation Count:73
yes
Evaluation Count:28
evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:1
1-101
1448 focusWidget->clearFocus();
executed: focusWidget->clearFocus();
Execution Count:100
100
1449 }
executed: }
Execution Count:125
125
1450 if (baseWidget)
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:159
yes
Evaluation Count:1
1-159
1451 baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive);
executed: baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive);
Execution Count:159
159
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:160
160
1455 -
1456 if (activate && isActive && q->isEnabled() && !q->hasFocus()
evaluated: activate
TRUEFALSE
yes
Evaluation Count:847
yes
Evaluation Count:454
partially evaluated: isActive
TRUEFALSE
yes
Evaluation Count:847
no
Evaluation Count:0
partially evaluated: q->isEnabled()
TRUEFALSE
yes
Evaluation Count:847
no
Evaluation Count:0
evaluated: !q->hasFocus()
TRUEFALSE
yes
Evaluation Count:493
yes
Evaluation Count:354
0-847
1457 && !q->isAncestorOf(QApplication::focusWidget())) {
evaluated: !q->isAncestorOf(QApplication::focusWidget())
TRUEFALSE
yes
Evaluation Count:280
yes
Evaluation Count:213
213-280
1458 if (changeFocus)
evaluated: changeFocus
TRUEFALSE
yes
Evaluation Count:232
yes
Evaluation Count:48
48-232
1459 setFocusWidget();
executed: setFocusWidget();
Execution Count:232
232
1460 ensureWindowState(Qt::WindowActive);
executed (the execution status of this line is deduced): ensureWindowState(Qt::WindowActive);
-
1461 }
executed: }
Execution Count:280
280
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:17
yes
Evaluation Count:1284
17-1284
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:17
17
1476 -
1477 q->update(windowDecoration);
executed (the execution status of this line is deduced): q->update(windowDecoration);
-
1478}
executed: }
Execution Count:1301
1301
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_WS_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_WS_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:1003
yes
Evaluation Count:8024
1003-8024
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:9027
yes
Evaluation Count:1003
1003-9027
1557 if (SubControls[i] == QStyle::SC_TitleBarLabel)
evaluated: SubControls[i] == QStyle::SC_TitleBarLabel
TRUEFALSE
yes
Evaluation Count:1003
yes
Evaluation Count:8024
1003-8024
1558 continue;
executed: continue;
Execution Count:1003
1003
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:8024
8024
1562 return move;
executed: return move;
Execution Count:1003
1003
1563 } -
1564 -
1565 QRegion region;
executed (the execution status of this line is deduced): QRegion region;
-
1566#if defined(Q_WS_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:1003
1003
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:1003
1003
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:1003
1003
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:1003
1003
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:1003
1003
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:1003
1003
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:1003
1003
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:1003
1003
1600 default: -
1601 break;
never executed: break;
0
1602 } -
1603 -
1604 return region;
executed: return region;
Execution Count:8024
8024
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:85
yes
Evaluation Count:5
5-85
1614 if (it.value().region.contains(pos))
evaluated: it.value().region.contains(pos)
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:73
12-73
1615 return it.key();
executed: return it.key();
Execution Count:12
12
1616 return None;
executed: return None;
Execution Count:5
5
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:15114
2-15114
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:15114
never evaluated: hoveredSubControl != QStyle::SC_None
0-15114
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:15114
15114
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:6412
yes
Evaluation Count:8704
6412-8704
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:6412
6412
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:8704
8704
1657 -
1658 int border = hasBorder(titleBarOptions) ? 4 : 0;
partially evaluated: hasBorder(titleBarOptions)
TRUEFALSE
yes
Evaluation Count:15116
no
Evaluation Count:0
0-15116
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:1336
yes
Evaluation Count:13780
1336-13780
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:2595
yes
Evaluation Count:12521
2595-12521
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:2595
2595
1673 return titleBarOptions;
executed: return titleBarOptions;
Execution Count:15116
15116
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:27
27
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:196
196
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:70
70
1696 default: -
1697 break;
executed: break;
Execution Count:581
581
1698 } -
1699 if (baseWidget) {
evaluated: baseWidget
TRUEFALSE
yes
Evaluation Count:861
yes
Evaluation Count:13
13-861
1700 if (!(baseWidget->windowState() & Qt::WindowActive) && windowStates & Qt::WindowActive)
partially evaluated: !(baseWidget->windowState() & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:861
no
Evaluation Count:0
evaluated: windowStates & Qt::WindowActive
TRUEFALSE
yes
Evaluation Count:787
yes
Evaluation Count:74
0-861
1701 baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive);
executed: baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive);
Execution Count:787
787
1702 else -
1703 baseWidget->overrideWindowState(windowStates);
executed: baseWidget->overrideWindowState(windowStates);
Execution Count:74
74
1704 } -
1705 q->overrideWindowState(windowStates);
executed (the execution status of this line is deduced): q->overrideWindowState(windowStates);
-
1706}
executed: }
Execution Count:874
874
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:15126
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15126
0-15126
1715 || (q->isMaximized() && !drawTitleBarWhenMaximized())) {
evaluated: q->isMaximized()
TRUEFALSE
yes
Evaluation Count:1319
yes
Evaluation Count:13807
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:208
yes
Evaluation Count:1111
208-13807
1716 return 0;
executed: return 0;
Execution Count:208
208
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_WS_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:14918
no
Evaluation Count:0
0-14918
1726 height += q->isMinimized() ? 8 : 4;
executed: height += q->isMinimized() ? 8 : 4;
Execution Count:14918
evaluated: q->isMinimized()
TRUEFALSE
yes
Evaluation Count:1336
yes
Evaluation Count:13582
1336-14918
1727 return height;
executed: return height;
Execution Count:14918
14918
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:2088
partially evaluated: flags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2088
0-2088
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:175
yes
Evaluation Count:1913
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:64
64-1913
1744 *margin = 0;
executed: *margin = 0;
Execution Count:111
111
1745 else -
1746 *margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q);
executed: *margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q);
Execution Count:1977
1977
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:18792
yes
Evaluation Count:2088
2088-18792
1751 if (SubControls[i] == QStyle::SC_TitleBarLabel) {
evaluated: SubControls[i] == QStyle::SC_TitleBarLabel
TRUEFALSE
yes
Evaluation Count:2088
yes
Evaluation Count:16704
2088-16704
1752 tempWidth += 30;
executed (the execution status of this line is deduced): tempWidth += 30;
-
1753 continue;
executed: continue;
Execution Count:2088
2088
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:6882
yes
Evaluation Count:9822
6882-9822
1757 continue;
executed: continue;
Execution Count:6882
6882
1758 tempWidth += rect.width();
executed (the execution status of this line is deduced): tempWidth += rect.width();
-
1759 }
executed: }
Execution Count:9822
9822
1760 *minWidth = tempWidth;
executed (the execution status of this line is deduced): *minWidth = tempWidth;
-
1761}
executed: }
Execution Count:2088
2088
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:4361
0-4361
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:4361
0-4361
1773 return false;
never executed: return false;
0
1774 -
1775#if defined(Q_WS_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:4361
0-4361
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:965
yes
Evaluation Count:3396
evaluated: !qobject_cast<QMenuBar *>(mainWindow->menuWidget())
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:3329
67-3396
1785 || mainWindow->menuWidget()->isHidden())
evaluated: mainWindow->menuWidget()->isHidden()
TRUEFALSE
yes
Evaluation Count:710
yes
Evaluation Count:2619
710-2619
1786 return true;
executed: return true;
Execution Count:1742
1742
1787 -
1788 return isChildOfQMdiSubWindow(q);
executed: return isChildOfQMdiSubWindow(q);
Execution Count:2619
2619
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:33
0-33
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:33
0-33
1808 controlContainer = new ControlContainer(q);
never executed: controlContainer = new ControlContainer(q);
0
1809 -
1810 ignoreWindowTitleChange = true;
never executed (the execution status of this line is deduced): ignoreWindowTitleChange = true;
-
1811 controlContainer->showButtonsInMenuBar(menuBar);
never executed (the execution status of this line is deduced): controlContainer->showButtonsInMenuBar(menuBar);
-
1812 ignoreWindowTitleChange = false;
never executed (the execution status of this line is deduced): ignoreWindowTitleChange = false;
-
1813 -
1814 QWidget *topLevelWindow = q->window();
never executed (the execution status of this line is deduced): QWidget *topLevelWindow = q->window();
-
1815 topLevelWindow->setWindowModified(q->isWindowModified());
never executed (the execution status of this line is deduced): topLevelWindow->setWindowModified(q->isWindowModified());
-
1816 topLevelWindow->installEventFilter(q);
never executed (the execution status of this line is deduced): topLevelWindow->installEventFilter(q);
-
1817 -
1818 int buttonHeight = 0;
never executed (the execution status of this line is deduced): int buttonHeight = 0;
-
1819 if (controlContainer->controllerWidget())
partially evaluated: controlContainer->controllerWidget()
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
1820 buttonHeight = controlContainer->controllerWidget()->height();
executed: buttonHeight = controlContainer->controllerWidget()->height();
Execution Count:33
33
1821 else if (controlContainer->systemMenuLabel())
never evaluated: controlContainer->systemMenuLabel()
0
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:33
no
Evaluation Count:0
evaluated: menuBar->height() < buttonHeight
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:16
0-33
1826 && topLevelWindow->layout()) {
partially evaluated: topLevelWindow->layout()
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
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:17
17
1832}
executed: }
Execution Count:33
33
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:564
partially evaluated: isChildOfTabbedQMdiArea(q)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:564
0-564
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:217
yes
Evaluation Count:347
217-347
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:217
217
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:516
yes
Evaluation Count:48
evaluated: !drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:146
yes
Evaluation Count:370
48-516
1860 topLevelWindow->setWindowModified(false);
executed: topLevelWindow->setWindowModified(false);
Execution Count:146
146
1861 originalTitle = QString::null;
executed (the execution status of this line is deduced): originalTitle = QString::null;
-
1862}
executed: }
Execution Count:564
564
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:137
yes
Evaluation Count:5
evaluated: !q->windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:134
partially evaluated: !lastChildWindowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-137
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:136
yes
Evaluation Count:5
5-136
1876 titleWidget = baseWidget;
executed: titleWidget = baseWidget;
Execution Count:136
136
1877 else -
1878 titleWidget = q;
executed: titleWidget = q;
Execution Count:5
5
1879 if (!titleWidget || titleWidget->windowTitle().isEmpty())
partially evaluated: !titleWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:141
evaluated: titleWidget->windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:22
0-141
1880 return;
executed: return;
Execution Count:119
119
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())
evaluated: q->maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:20
2-20
1885 setNewWindowTitle();
executed: setNewWindowTitle();
Execution Count:2
2
1886 ignoreWindowTitleChange = false;
executed (the execution status of this line is deduced): ignoreWindowTitleChange = false;
-
1887}
executed: }
Execution Count:22
22
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:248
no
Evaluation Count:0
0-248
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:248
248
1979 -
1980 return newPalette;
executed: return newPalette;
Execution Count:248
248
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:2135
yes
Evaluation Count:305
305-2135
1988 setVisible(WindowStateAction(i), false);
executed: setVisible(WindowStateAction(i), false);
Execution Count:2135
2135
1989 -
1990 if (windowFlags & Qt::FramelessWindowHint)
partially evaluated: windowFlags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:305
0-305
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:305
no
Evaluation Count:0
0-305
1999 setVisible(CloseAction, true);
executed: setVisible(CloseAction, true);
Execution Count:305
305
2000 -
2001 // RestoreAction -
2002 if (windowFlags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint))
evaluated: windowFlags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint)
TRUEFALSE
yes
Evaluation Count:302
yes
Evaluation Count:3
3-302
2003 setVisible(RestoreAction, true);
executed: setVisible(RestoreAction, true);
Execution Count:302
302
2004 -
2005 // MinimizeAction -
2006 if (windowFlags & Qt::WindowMinimizeButtonHint)
evaluated: windowFlags & Qt::WindowMinimizeButtonHint
TRUEFALSE
yes
Evaluation Count:302
yes
Evaluation Count:3
3-302
2007 setVisible(MinimizeAction, true);
executed: setVisible(MinimizeAction, true);
Execution Count:302
302
2008 -
2009 // MaximizeAction -
2010 if (windowFlags & Qt::WindowMaximizeButtonHint)
evaluated: windowFlags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:302
yes
Evaluation Count:3
3-302
2011 setVisible(MaximizeAction, true);
executed: setVisible(MaximizeAction, true);
Execution Count:302
302
2012}
executed: }
Execution Count:305
305
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:2
yes
Evaluation Count:382
2-382
2018 q->setFocus();
executed (the execution status of this line is deduced): q->setFocus();
-
2019 return;
executed: return;
Execution Count:2
2
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:378
4-378
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:378
0-378
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:47
yes
Evaluation Count:331
47-331
2037 if (!focusWidget->hasFocus() && q->isAncestorOf(focusWidget)
evaluated: !focusWidget->hasFocus()
TRUEFALSE
yes
Evaluation Count:33
yes
Evaluation Count:14
partially evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
0-33
2038 && focusWidget->isVisible() && !q->isMinimized()
evaluated: focusWidget->isVisible()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:16
partially evaluated: !q->isMinimized()
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
2039 && focusWidget->focusPolicy() != Qt::NoFocus) {
partially evaluated: focusWidget->focusPolicy() != Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
2040 focusWidget->setFocus();
executed (the execution status of this line is deduced): focusWidget->setFocus();
-
2041 } else {
executed: }
Execution Count:17
17
2042 q->setFocus();
executed (the execution status of this line is deduced): q->setFocus();
-
2043 }
executed: }
Execution Count:30
30
2044 return;
executed: return;
Execution Count:47
47
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:2471
no
Evaluation Count:0
evaluated: focusWidget != q
TRUEFALSE
yes
Evaluation Count:2285
yes
Evaluation Count:186
evaluated: focusWidget->focusPolicy() == Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:2140
yes
Evaluation Count:145
0-2471
2049 focusWidget = focusWidget->nextInFocusChain();
executed: focusWidget = focusWidget->nextInFocusChain();
Execution Count:2140
2140
2050 if (focusWidget && q->isAncestorOf(focusWidget))
partially evaluated: focusWidget
TRUEFALSE
yes
Evaluation Count:331
no
Evaluation Count:0
evaluated: q->isAncestorOf(focusWidget)
TRUEFALSE
yes
Evaluation Count:215
yes
Evaluation Count:116
0-331
2051 focusWidget->setFocus();
executed: focusWidget->setFocus();
Execution Count:215
215
2052 else if (baseWidget->focusPolicy() != Qt::NoFocus)
partially evaluated: baseWidget->focusPolicy() != Qt::NoFocus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116
0-116
2053 baseWidget->setFocus();
never executed: baseWidget->setFocus();
0
2054 else if (!q->hasFocus())
evaluated: !q->hasFocus()
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:55
55-61
2055 q->setFocus();
executed: q->setFocus();
Execution Count:61
61
2056} -
2057 -
2058void QMdiSubWindowPrivate::restoreFocus() -
2059{ -
2060 if (!restoreFocusWidget)
evaluated: !restoreFocusWidget
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:39
39-63
2061 return;
executed: return;
Execution Count:63
63
2062 if (!restoreFocusWidget->hasFocus() && q_func()->isAncestorOf(restoreFocusWidget)
evaluated: !restoreFocusWidget->hasFocus()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:29
partially evaluated: q_func()->isAncestorOf(restoreFocusWidget)
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-29
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:39
39
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:16
yes
Evaluation Count:133
16-133
2078 q->setWindowFlags(windowFlags);
executed (the execution status of this line is deduced): q->setWindowFlags(windowFlags);
-
2079 return;
executed: return;
Execution Count:16
16
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:130
partially evaluated: windowFlags & Qt::MSWindowsFixedSizeDialogHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
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:105
yes
Evaluation Count:28
28-105
2088 windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
executed: windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
Execution Count:105
105
2089 else if (windowFlags & Qt::FramelessWindowHint && windowFlags & Qt::WindowStaysOnTopHint)
partially evaluated: windowFlags & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
never evaluated: windowFlags & Qt::WindowStaysOnTopHint
0-28
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:28
0-28
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:133
no
Evaluation Count:0
0-133
2100 if (windowFlags & Qt::WindowStaysOnTopHint)
partially evaluated: windowFlags & Qt::WindowStaysOnTopHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:133
0-133
2101 stayOnTopAction->setChecked(true);
never executed: stayOnTopAction->setChecked(true);
0
2102 else -
2103 stayOnTopAction->setChecked(false);
executed: stayOnTopAction->setChecked(false);
Execution Count:133
133
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:133
never evaluated: sizeGrip
0-133
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:133
never evaluated: currentSize.width() < internalMinimumSize.width()
0-133
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:133
133
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:4261
no
Evaluation Count:0
0-4261
2126 actions[action]->setVisible(visible);
executed: actions[action]->setVisible(visible);
Execution Count:4261
4261
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:124
yes
Evaluation Count:4137
124-4137
2131 controlContainer = new ControlContainer(q);
executed: controlContainer = new ControlContainer(q);
Execution Count:124
124
2132 -
2133 if (ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *>
partially evaluated: ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *> (controlContainer->controllerWidget())
TRUEFALSE
yes
Evaluation Count:4261
no
Evaluation Count:0
0-4261
2134 (controlContainer->controllerWidget())) {
partially evaluated: ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *> (controlContainer->controllerWidget())
TRUEFALSE
yes
Evaluation Count:4261
no
Evaluation Count:0
0-4261
2135 ctrlWidget->setControlVisible(action, visible);
executed (the execution status of this line is deduced): ctrlWidget->setControlVisible(action, visible);
-
2136 }
executed: }
Execution Count:4261
4261
2137}
executed: }
Execution Count:4261
4261
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:649
yes
Evaluation Count:15
15-649
2143 actions[action]->setEnabled(enable);
executed: actions[action]->setEnabled(enable);
Execution Count:649
649
2144}
executed: }
Execution Count:664
664
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:868
0-868
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:868
868
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:34
partially evaluated: q->windowFlags() & Qt::FramelessWindowHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34
0-34
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:34
34
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_WS_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:129
129
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:7
yes
Evaluation Count:24
7-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:7
7
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:31
31
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 \badcode -
2240 QMdiArea mdiArea; -
2241 QTextEdit editor(&mdiArea); // invalid child widget -
2242 \endcode -
2243 -
2244 \sa QMdiArea::addSubWindow() -
2245*/ -
2246QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) -
2247 : QWidget(*new QMdiSubWindowPrivate, parent, 0) -
2248{ -
2249 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2250#ifndef QT_NO_MENU -
2251 d->createSystemMenu();
executed (the execution status of this line is deduced): d->createSystemMenu();
-
2252 addActions(d->systemMenu->actions());
executed (the execution status of this line is deduced): addActions(d->systemMenu->actions());
-
2253#endif -
2254 d->setWindowFlags(flags);
executed (the execution status of this line is deduced): d->setWindowFlags(flags);
-
2255 setBackgroundRole(QPalette::Window);
executed (the execution status of this line is deduced): setBackgroundRole(QPalette::Window);
-
2256 setAutoFillBackground(true);
executed (the execution status of this line is deduced): setAutoFillBackground(true);
-
2257 setMouseTracking(true);
executed (the execution status of this line is deduced): setMouseTracking(true);
-
2258 setLayout(new QVBoxLayout);
executed (the execution status of this line is deduced): setLayout(new QVBoxLayout);
-
2259 setFocusPolicy(Qt::StrongFocus);
executed (the execution status of this line is deduced): setFocusPolicy(Qt::StrongFocus);
-
2260 layout()->setMargin(0);
executed (the execution status of this line is deduced): layout()->setMargin(0);
-
2261 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2262 setAttribute(Qt::WA_Resized, false);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_Resized, false);
-
2263 d->titleBarPalette = d->desktopPalette();
executed (the execution status of this line is deduced): d->titleBarPalette = d->desktopPalette();
-
2264 d->font = QApplication::font("QMdiSubWindowTitleBar");
executed (the execution status of this line is deduced): d->font = QApplication::font("QMdiSubWindowTitleBar");
-
2265 // We don't want the menu icon by default on mac. -
2266#ifndef Q_WS_MAC -
2267 if (windowIcon().isNull())
partially evaluated: windowIcon().isNull()
TRUEFALSE
yes
Evaluation Count:124
no
Evaluation Count:0
0-124
2268 d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
Execution Count:124
124
2269 else -
2270 d->menuIcon = windowIcon();
never executed: d->menuIcon = windowIcon();
0
2271#endif -
2272 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*)",
-
2273 this, SLOT(_q_processFocusChanged(QWidget*,QWidget*)));
executed (the execution status of this line is deduced): this, "1""_q_processFocusChanged(QWidget*,QWidget*)");
-
2274}
executed: }
Execution Count:124
124
2275 -
2276/*! -
2277 Destroys the subwindow. -
2278 -
2279 \sa QMdiArea::removeSubWindow() -
2280*/ -
2281QMdiSubWindow::~QMdiSubWindow() -
2282{ -
2283 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2284#ifndef QT_NO_MENUBAR -
2285 d->removeButtonsFromMenuBar();
executed (the execution status of this line is deduced): d->removeButtonsFromMenuBar();
-
2286#endif -
2287 d->setActive(false);
executed (the execution status of this line is deduced): d->setActive(false);
-
2288}
executed: }
Execution Count:117
117
2289 -
2290/*! -
2291 Sets \a widget as the internal widget of this subwindow. The -
2292 internal widget is displayed in the center of the subwindow -
2293 beneath the title bar. -
2294 -
2295 QMdiSubWindow takes temporary ownership of \a widget; you do -
2296 not have to delete it. Any existing internal widget will be -
2297 removed and reparented to the root window. -
2298 -
2299 \sa widget() -
2300*/ -
2301void QMdiSubWindow::setWidget(QWidget *widget) -
2302{ -
2303 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2304 if (!widget) {
evaluated: !widget
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:124
2-124
2305 d->removeBaseWidget();
executed (the execution status of this line is deduced): d->removeBaseWidget();
-
2306 return;
executed: return;
Execution Count:2
2
2307 } -
2308 -
2309 if (widget == d->baseWidget) {
evaluated: widget == d->baseWidget
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:123
1-123
2310 qWarning("QMdiSubWindow::setWidget: widget is already set");
executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdisubwindow.cpp", 2310, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setWidget: widget is already set");
-
2311 return;
executed: return;
Execution Count:1
1
2312 } -
2313 -
2314 bool wasResized = testAttribute(Qt::WA_Resized);
executed (the execution status of this line is deduced): bool wasResized = testAttribute(Qt::WA_Resized);
-
2315 d->removeBaseWidget();
executed (the execution status of this line is deduced): d->removeBaseWidget();
-
2316 -
2317 if (QLayout *layout = this->layout())
evaluated: QLayout *layout = this->layout()
TRUEFALSE
yes
Evaluation Count:122
yes
Evaluation Count:1
1-122
2318 layout->addWidget(widget);
executed: layout->addWidget(widget);
Execution Count:122
122
2319 else -
2320 widget->setParent(this);
executed: widget->setParent(this);
Execution Count:1
1
2321 -
2322#ifndef QT_NO_SIZEGRIP -
2323 QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>();
executed (the execution status of this line is deduced): QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>();
-
2324 if (sizeGrip)
partially evaluated: sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
2325 sizeGrip->installEventFilter(this);
never executed: sizeGrip->installEventFilter(this);
0
2326 if (d->sizeGrip)
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
2327 d->sizeGrip->raise();
never executed: d->sizeGrip->raise();
0
2328#endif -
2329 -
2330 d->baseWidget = widget;
executed (the execution status of this line is deduced): d->baseWidget = widget;
-
2331 d->baseWidget->installEventFilter(this);
executed (the execution status of this line is deduced): d->baseWidget->installEventFilter(this);
-
2332 -
2333 d->ignoreWindowTitleChange = true;
executed (the execution status of this line is deduced): d->ignoreWindowTitleChange = true;
-
2334 bool isWindowModified = this->isWindowModified();
executed (the execution status of this line is deduced): bool isWindowModified = this->isWindowModified();
-
2335 if (windowTitle().isEmpty()) {
partially evaluated: windowTitle().isEmpty()
TRUEFALSE
yes
Evaluation Count:123
no
Evaluation Count:0
0-123
2336 d->updateWindowTitle(true);
executed (the execution status of this line is deduced): d->updateWindowTitle(true);
-
2337 isWindowModified = d->baseWidget->isWindowModified();
executed (the execution status of this line is deduced): isWindowModified = d->baseWidget->isWindowModified();
-
2338 }
executed: }
Execution Count:123
123
2339 if (!this->isWindowModified() && isWindowModified
partially evaluated: !this->isWindowModified()
TRUEFALSE
yes
Evaluation Count:123
no
Evaluation Count:0
evaluated: isWindowModified
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:122
0-123
2340 && windowTitle().contains(QLatin1String("[*]"))) {
partially evaluated: windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2341 setWindowModified(isWindowModified);
executed (the execution status of this line is deduced): setWindowModified(isWindowModified);
-
2342 }
executed: }
Execution Count:1
1
2343 d->lastChildWindowTitle = d->baseWidget->windowTitle();
executed (the execution status of this line is deduced): d->lastChildWindowTitle = d->baseWidget->windowTitle();
-
2344 d->ignoreWindowTitleChange = false;
executed (the execution status of this line is deduced): d->ignoreWindowTitleChange = false;
-
2345 -
2346 if (windowIcon().isNull() && !d->baseWidget->windowIcon().isNull())
partially evaluated: windowIcon().isNull()
TRUEFALSE
yes
Evaluation Count:123
no
Evaluation Count:0
partially evaluated: !d->baseWidget->windowIcon().isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
2347 setWindowIcon(d->baseWidget->windowIcon());
never executed: setWindowIcon(d->baseWidget->windowIcon());
0
2348 -
2349 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2350 if (!wasResized && testAttribute(Qt::WA_Resized))
partially evaluated: !wasResized
TRUEFALSE
yes
Evaluation Count:123
no
Evaluation Count:0
partially evaluated: testAttribute(Qt::WA_Resized)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
2351 setAttribute(Qt::WA_Resized, false);
never executed: setAttribute(Qt::WA_Resized, false);
0
2352}
executed: }
Execution Count:123
123
2353 -
2354/*! -
2355 Returns the current internal widget. -
2356 -
2357 \sa setWidget() -
2358*/ -
2359QWidget *QMdiSubWindow::widget() const -
2360{ -
2361 return d_func()->baseWidget;
executed: return d_func()->baseWidget;
Execution Count:100
100
2362} -
2363 -
2364 -
2365/*! -
2366 \internal -
2367*/ -
2368QWidget *QMdiSubWindow::maximizedButtonsWidget() const -
2369{ -
2370 Q_D(const QMdiSubWindow);
executed (the execution status of this line is deduced): const QMdiSubWindowPrivate * const d = d_func();
-
2371 if (isVisible() && d->controlContainer && isMaximized() && !d->drawTitleBarWhenMaximized()
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:31
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:83
no
Evaluation Count:0
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:5
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:10
0-83
2372 && !isChildOfTabbedQMdiArea(this)) {
partially evaluated: !isChildOfTabbedQMdiArea(this)
TRUEFALSE
yes
Evaluation Count:68
no
Evaluation Count:0
0-68
2373 return d->controlContainer->controllerWidget();
executed: return d->controlContainer->controllerWidget();
Execution Count:68
68
2374 } -
2375 return 0;
executed: return 0;
Execution Count:46
46
2376} -
2377 -
2378/*! -
2379 \internal -
2380*/ -
2381QWidget *QMdiSubWindow::maximizedSystemMenuIconWidget() const -
2382{ -
2383 Q_D(const QMdiSubWindow);
executed (the execution status of this line is deduced): const QMdiSubWindowPrivate * const d = d_func();
-
2384 if (isVisible() && d->controlContainer && isMaximized() && !d->drawTitleBarWhenMaximized()
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:11
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:38
no
Evaluation Count:0
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:3
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:10
0-38
2385 && !isChildOfTabbedQMdiArea(this)) {
partially evaluated: !isChildOfTabbedQMdiArea(this)
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-25
2386 return d->controlContainer->systemMenuLabel();
executed: return d->controlContainer->systemMenuLabel();
Execution Count:25
25
2387 } -
2388 return 0;
executed: return 0;
Execution Count:24
24
2389} -
2390 -
2391/*! -
2392 Returns true if this window is shaded; otherwise returns false. -
2393 -
2394 A window is shaded if it is collapsed so that only the title bar is -
2395 visible. -
2396*/ -
2397bool QMdiSubWindow::isShaded() const -
2398{ -
2399 return d_func()->isShadeMode;
executed: return d_func()->isShadeMode;
Execution Count:1772
1772
2400} -
2401 -
2402/*! -
2403 If \a on is true, \a option is enabled on the subwindow; otherwise it is -
2404 disabled. See SubWindowOption for the effect of each option. -
2405 -
2406 \sa SubWindowOption, testOption() -
2407*/ -
2408void QMdiSubWindow::setOption(SubWindowOption option, bool on) -
2409{ -
2410 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2411 if (on && !(d->options & option))
evaluated: on
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:290
partially evaluated: !(d->options & option)
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-290
2412 d->options |= option;
executed: d->options |= option;
Execution Count:14
14
2413 else if (!on && (d->options & option))
partially evaluated: !on
TRUEFALSE
yes
Evaluation Count:290
no
Evaluation Count:0
partially evaluated: (d->options & option)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:290
0-290
2414 d->options &= ~option;
never executed: d->options &= ~option;
0
2415 -
2416#ifndef QT_NO_RUBBERBAND -
2417 if ((option & (RubberBandResize | RubberBandMove)) && !on && d->isInRubberBandMode)
evaluated: (option & (RubberBandResize | RubberBandMove))
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:254
evaluated: !on
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:2
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
0-254
2418 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
2419#endif -
2420}
executed: }
Execution Count:304
304
2421 -
2422/*! -
2423 Returns true if \a option is enabled; otherwise returns false. -
2424 -
2425 \sa SubWindowOption, setOption() -
2426*/ -
2427bool QMdiSubWindow::testOption(SubWindowOption option) const -
2428{ -
2429 return d_func()->options & option;
executed: return d_func()->options & option;
Execution Count:719
719
2430} -
2431 -
2432/*! -
2433 \property QMdiSubWindow::keyboardSingleStep -
2434 \brief sets how far a widget should move or resize when using the -
2435 keyboard arrow keys. -
2436 -
2437 When in keyboard-interactive mode, you can use the arrow and page keys to -
2438 either move or resize the window. This property controls the arrow keys. -
2439 The common way to enter keyboard interactive mode is to enter the -
2440 subwindow menu, and select either "resize" or "move". -
2441 -
2442 The default keyboard single step value is 5 pixels. -
2443 -
2444 \sa keyboardPageStep -
2445*/ -
2446int QMdiSubWindow::keyboardSingleStep() const -
2447{ -
2448 return d_func()->keyboardSingleStep;
never executed: return d_func()->keyboardSingleStep;
0
2449} -
2450 -
2451void QMdiSubWindow::setKeyboardSingleStep(int step) -
2452{ -
2453 // Haven't done any boundary check here since negative step only -
2454 // means inverted behavior, which is OK if the user want it. -
2455 // A step equal to zero means "do nothing". -
2456 d_func()->keyboardSingleStep = step;
never executed (the execution status of this line is deduced): d_func()->keyboardSingleStep = step;
-
2457}
never executed: }
0
2458 -
2459/*! -
2460 \property QMdiSubWindow::keyboardPageStep -
2461 \brief sets how far a widget should move or resize when using the -
2462 keyboard page keys. -
2463 -
2464 When in keyboard-interactive mode, you can use the arrow and page keys to -
2465 either move or resize the window. This property controls the page -
2466 keys. The common way to enter keyboard interactive mode is to enter the -
2467 subwindow menu, and select either "resize" or "move". -
2468 -
2469 The default keyboard page step value is 20 pixels. -
2470 -
2471 \sa keyboardSingleStep -
2472*/ -
2473int QMdiSubWindow::keyboardPageStep() const -
2474{ -
2475 return d_func()->keyboardPageStep;
never executed: return d_func()->keyboardPageStep;
0
2476} -
2477 -
2478void QMdiSubWindow::setKeyboardPageStep(int step) -
2479{ -
2480 // Haven't done any boundary check here since negative step only -
2481 // means inverted behavior, which is OK if the user want it. -
2482 // A step equal to zero means "do nothing". -
2483 d_func()->keyboardPageStep = step;
never executed (the execution status of this line is deduced): d_func()->keyboardPageStep = step;
-
2484}
never executed: }
0
2485 -
2486#ifndef QT_NO_MENU -
2487/*! -
2488 Sets \a systemMenu as the current system menu for this subwindow. -
2489 -
2490 By default, each QMdiSubWindow has a standard system menu. -
2491 -
2492 QActions for the system menu created by QMdiSubWindow will -
2493 automatically be updated depending on the current window state; -
2494 e.g., the minimize action will be disabled after the window is -
2495 minimized. -
2496 -
2497 QActions added by the user are not updated by QMdiSubWindow. -
2498 -
2499 QMdiSubWindow takes ownership of \a systemMenu; you do not have to -
2500 delete it. Any existing menus will be deleted. -
2501 -
2502 \sa systemMenu(), showSystemMenu() -
2503*/ -
2504void QMdiSubWindow::setSystemMenu(QMenu *systemMenu) -
2505{ -
2506 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2507 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
2508 qWarning("QMdiSubWindow::setSystemMenu: system menu is already set");
executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdisubwindow.cpp", 2508, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setSystemMenu: system menu is already set");
-
2509 return;
executed: return;
Execution Count:1
1
2510 } -
2511 -
2512 if (d->systemMenu) {
evaluated: d->systemMenu
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2513 delete d->systemMenu;
executed (the execution status of this line is deduced): delete d->systemMenu;
-
2514 d->systemMenu = 0;
executed (the execution status of this line is deduced): d->systemMenu = 0;
-
2515 }
executed: }
Execution Count:1
1
2516 -
2517 if (!systemMenu)
evaluated: !systemMenu
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2518 return;
executed: return;
Execution Count:1
1
2519 -
2520 if (systemMenu->parent() != this)
partially evaluated: systemMenu->parent() != this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2521 systemMenu->setParent(this);
never executed: systemMenu->setParent(this);
0
2522 d->systemMenu = systemMenu;
executed (the execution status of this line is deduced): d->systemMenu = systemMenu;
-
2523}
executed: }
Execution Count:1
1
2524 -
2525/*! -
2526 Returns a pointer to the current system menu, or zero if no system -
2527 menu is set. QMdiSubWindow provides a default system menu, but you can -
2528 also set the menu with setSystemMenu(). -
2529 -
2530 \sa setSystemMenu(), showSystemMenu() -
2531*/ -
2532QMenu *QMdiSubWindow::systemMenu() const -
2533{ -
2534 return d_func()->systemMenu;
executed: return d_func()->systemMenu;
Execution Count:5
5
2535} -
2536 -
2537/*! -
2538 Shows the system menu below the system menu icon in the title bar. -
2539 -
2540 \sa setSystemMenu(), systemMenu() -
2541*/ -
2542void QMdiSubWindow::showSystemMenu() -
2543{ -
2544 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2545 if (!d->systemMenu)
partially evaluated: !d->systemMenu
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
2546 return;
never executed: return;
0
2547 -
2548 QPoint globalPopupPos;
executed (the execution status of this line is deduced): QPoint globalPopupPos;
-
2549 if (QWidget *icon = maximizedSystemMenuIconWidget()) {
evaluated: QWidget *icon = maximizedSystemMenuIconWidget()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
2550 if (isLeftToRight())
evaluated: isLeftToRight()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
2551 globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height()));
executed: globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height()));
Execution Count:1
1
2552 else -
2553 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
2554 } else { -
2555 if (isLeftToRight())
evaluated: isLeftToRight()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
2556 globalPopupPos = mapToGlobal(contentsRect().topLeft());
executed: globalPopupPos = mapToGlobal(contentsRect().topLeft());
Execution Count:2
2
2557 else // + QPoint(1, 0) because topRight() == QPoint(left() + width() -1, top()) -
2558 globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0);
executed: globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0);
Execution Count:1
1
2559 } -
2560 -
2561 // Adjust x() with -menuwidth in reverse mode. -
2562 if (isRightToLeft())
evaluated: isRightToLeft()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
2563 globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0);
executed: globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0);
Execution Count:2
2
2564 d->systemMenu->installEventFilter(this);
executed (the execution status of this line is deduced): d->systemMenu->installEventFilter(this);
-
2565 d->systemMenu->popup(globalPopupPos);
executed (the execution status of this line is deduced): d->systemMenu->popup(globalPopupPos);
-
2566}
executed: }
Execution Count:5
5
2567#endif // QT_NO_MENU -
2568 -
2569/*! -
2570 \since 4.4 -
2571 -
2572 Returns the area containing this sub-window, or 0 if there is none. -
2573 -
2574 \sa QMdiArea::addSubWindow() -
2575*/ -
2576QMdiArea *QMdiSubWindow::mdiArea() const -
2577{ -
2578 QWidget *parent = parentWidget();
executed (the execution status of this line is deduced): QWidget *parent = parentWidget();
-
2579 while (parent) {
evaluated: parent
TRUEFALSE
yes
Evaluation Count:10307
yes
Evaluation Count:386
386-10307
2580 if (QMdiArea *area = qobject_cast<QMdiArea *>(parent)) {
evaluated: QMdiArea *area = qobject_cast<QMdiArea *>(parent)
TRUEFALSE
yes
Evaluation Count:4733
yes
Evaluation Count:5574
4733-5574
2581 if (area->viewport() == parentWidget())
partially evaluated: area->viewport() == parentWidget()
TRUEFALSE
yes
Evaluation Count:4733
no
Evaluation Count:0
0-4733
2582 return area;
executed: return area;
Execution Count:4733
4733
2583 }
never executed: }
0
2584 parent = parent->parentWidget();
executed (the execution status of this line is deduced): parent = parent->parentWidget();
-
2585 }
executed: }
Execution Count:5574
5574
2586 return 0;
executed: return 0;
Execution Count:386
386
2587} -
2588 -
2589/*! -
2590 Calling this function makes the subwindow enter the shaded mode. -
2591 When the subwindow is shaded, only the title bar is visible. -
2592 -
2593 Although shading is not supported by all styles, this function will -
2594 still show the subwindow as shaded, regardless of whether support -
2595 for shading is available. However, when used with styles without -
2596 shading support, the user will be unable to return from shaded mode -
2597 through the user interface (e.g., through a shade button in the title -
2598 bar). -
2599 -
2600 \sa isShaded() -
2601*/ -
2602void QMdiSubWindow::showShaded() -
2603{ -
2604 if (!parent())
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
2605 return;
never executed: return;
0
2606 -
2607 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2608 // setMinimizeMode uses this function. -
2609 if (!d->isShadeRequestFromMinimizeMode && isShaded())
evaluated: !d->isShadeRequestFromMinimizeMode
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:19
partially evaluated: isShaded()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-19
2610 return;
never executed: return;
0
2611 -
2612 d->isMaximizeMode = false;
executed (the execution status of this line is deduced): d->isMaximizeMode = false;
-
2613 -
2614 QWidget *currentFocusWidget = QApplication::focusWidget();
executed (the execution status of this line is deduced): QWidget *currentFocusWidget = QApplication::focusWidget();
-
2615 if (!d->restoreFocusWidget && isAncestorOf(currentFocusWidget))
partially evaluated: !d->restoreFocusWidget
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
evaluated: isAncestorOf(currentFocusWidget)
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:5
0-27
2616 d->restoreFocusWidget = currentFocusWidget;
executed: d->restoreFocusWidget = currentFocusWidget;
Execution Count:22
22
2617 -
2618 if (!d->isShadeRequestFromMinimizeMode) {
evaluated: !d->isShadeRequestFromMinimizeMode
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:19
8-19
2619 d->isShadeMode = true;
executed (the execution status of this line is deduced): d->isShadeMode = true;
-
2620 d->ensureWindowState(Qt::WindowMinimized);
executed (the execution status of this line is deduced): d->ensureWindowState(Qt::WindowMinimized);
-
2621 }
executed: }
Execution Count:8
8
2622 -
2623#ifndef QT_NO_MENUBAR -
2624 d->removeButtonsFromMenuBar();
executed (the execution status of this line is deduced): d->removeButtonsFromMenuBar();
-
2625#endif -
2626 -
2627 // showMinimized() will reset Qt::WindowActive, which makes sense -
2628 // for top level widgets, but in MDI it makes sense to have an -
2629 // active window which is minimized. -
2630 if (hasFocus() || isAncestorOf(currentFocusWidget))
evaluated: hasFocus()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:19
evaluated: isAncestorOf(currentFocusWidget)
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:5
5-19
2631 d->ensureWindowState(Qt::WindowActive);
executed: d->ensureWindowState(Qt::WindowActive);
Execution Count:22
22
2632 -
2633#ifndef QT_NO_SIZEGRIP -
2634 d->setSizeGripVisible(false);
executed (the execution status of this line is deduced): d->setSizeGripVisible(false);
-
2635#endif -
2636 -
2637 if (!d->restoreSize.isValid() || d->isShadeMode) {
evaluated: !d->restoreSize.isValid()
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:2
evaluated: d->isShadeMode
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-25
2638 d->oldGeometry = geometry();
executed (the execution status of this line is deduced): d->oldGeometry = geometry();
-
2639 d->restoreSize.setWidth(d->oldGeometry.width());
executed (the execution status of this line is deduced): d->restoreSize.setWidth(d->oldGeometry.width());
-
2640 d->restoreSize.setHeight(d->oldGeometry.height());
executed (the execution status of this line is deduced): d->restoreSize.setHeight(d->oldGeometry.height());
-
2641 }
executed: }
Execution Count:26
26
2642 -
2643 // Hide the window before we change the geometry to avoid multiple resize -
2644 // events and wrong window state. -
2645 const bool wasVisible = isVisible();
executed (the execution status of this line is deduced): const bool wasVisible = isVisible();
-
2646 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-27
2647 setVisible(false);
executed: setVisible(false);
Execution Count:27
27
2648 -
2649 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2650 // Update minimum size to internalMinimumSize if set by user. -
2651 if (!minimumSize().isNull()) {
partially evaluated: !minimumSize().isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
2652 d->userMinimumSize = minimumSize();
never executed (the execution status of this line is deduced): d->userMinimumSize = minimumSize();
-
2653 setMinimumSize(d->internalMinimumSize);
never executed (the execution status of this line is deduced): setMinimumSize(d->internalMinimumSize);
-
2654 }
never executed: }
0
2655 resize(d->internalMinimumSize);
executed (the execution status of this line is deduced): resize(d->internalMinimumSize);
-
2656 -
2657 // Hide the internal widget if not already hidden by the user. -
2658 if (d->baseWidget && !d->baseWidget->isHidden()) {
partially evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
partially evaluated: !d->baseWidget->isHidden()
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-27
2659 d->baseWidget->hide();
executed (the execution status of this line is deduced): d->baseWidget->hide();
-
2660 d->isWidgetHiddenByUs = true;
executed (the execution status of this line is deduced): d->isWidgetHiddenByUs = true;
-
2661 }
executed: }
Execution Count:27
27
2662 -
2663 if (wasVisible)
partially evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-27
2664 setVisible(true);
executed: setVisible(true);
Execution Count:27
27
2665 -
2666 d->setFocusWidget();
executed (the execution status of this line is deduced): d->setFocusWidget();
-
2667 d->resizeEnabled = false;
executed (the execution status of this line is deduced): d->resizeEnabled = false;
-
2668 d->moveEnabled = true;
executed (the execution status of this line is deduced): d->moveEnabled = true;
-
2669 d->updateDirtyRegions();
executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
2670 d->updateMask();
executed (the execution status of this line is deduced): d->updateMask();
-
2671 -
2672#ifndef QT_NO_ACTION -
2673 d->setEnabled(QMdiSubWindowPrivate::MinimizeAction, false);
executed (the execution status of this line is deduced): d->setEnabled(QMdiSubWindowPrivate::MinimizeAction, false);
-
2674 d->setEnabled(QMdiSubWindowPrivate::ResizeAction, d->resizeEnabled);
executed (the execution status of this line is deduced): d->setEnabled(QMdiSubWindowPrivate::ResizeAction, d->resizeEnabled);
-
2675 d->setEnabled(QMdiSubWindowPrivate::MaximizeAction, true);
executed (the execution status of this line is deduced): d->setEnabled(QMdiSubWindowPrivate::MaximizeAction, true);
-
2676 d->setEnabled(QMdiSubWindowPrivate::RestoreAction, true);
executed (the execution status of this line is deduced): d->setEnabled(QMdiSubWindowPrivate::RestoreAction, true);
-
2677 d->setEnabled(QMdiSubWindowPrivate::MoveAction, d->moveEnabled);
executed (the execution status of this line is deduced): d->setEnabled(QMdiSubWindowPrivate::MoveAction, d->moveEnabled);
-
2678#endif -
2679}
executed: }
Execution Count:27
27
2680 -
2681/*! -
2682 \reimp -
2683*/ -
2684bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event) -
2685{ -
2686 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2687 if (!object)
partially evaluated: !object
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3460
0-3460
2688 return QWidget::eventFilter(object, event);
never executed: return QWidget::eventFilter(object, event);
0
2689 -
2690#ifndef QT_NO_MENU -
2691 // System menu events. -
2692 if (d->systemMenu && d->systemMenu == object) {
evaluated: d->systemMenu
TRUEFALSE
yes
Evaluation Count:3454
yes
Evaluation Count:6
evaluated: d->systemMenu == object
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:3396
6-3454
2693 if (event->type() == QEvent::MouseButtonDblClick) {
partially evaluated: event->type() == QEvent::MouseButtonDblClick
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:58
0-58
2694 close();
never executed (the execution status of this line is deduced): close();
-
2695 } else if (event->type() == QEvent::MouseMove) {
never executed: }
partially evaluated: event->type() == QEvent::MouseMove
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:58
0-58
2696 QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
never executed (the execution status of this line is deduced): QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
-
2697 d->hoveredSubControl = d->getSubControl(mapFromGlobal(mouseEvent->globalPos()));
never executed (the execution status of this line is deduced): d->hoveredSubControl = d->getSubControl(mapFromGlobal(mouseEvent->globalPos()));
-
2698 } else if (event->type() == QEvent::Hide) {
never executed: }
evaluated: event->type() == QEvent::Hide
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:53
0-53
2699 d->systemMenu->removeEventFilter(this);
executed (the execution status of this line is deduced): d->systemMenu->removeEventFilter(this);
-
2700 d->activeSubControl = QStyle::SC_None;
executed (the execution status of this line is deduced): d->activeSubControl = QStyle::SC_None;
-
2701 update(QRegion(0, 0, width(), d->titleBarHeight()));
executed (the execution status of this line is deduced): update(QRegion(0, 0, width(), d->titleBarHeight()));
-
2702 }
executed: }
Execution Count:5
5
2703 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:58
58
2704 } -
2705#endif -
2706 -
2707#ifndef QT_NO_SIZEGRIP -
2708 if (object != d->baseWidget && parent() && qobject_cast<QSizeGrip *>(object)) {
evaluated: object != d->baseWidget
TRUEFALSE
yes
Evaluation Count:145
yes
Evaluation Count:3257
partially evaluated: parent()
TRUEFALSE
yes
Evaluation Count:145
no
Evaluation Count:0
partially evaluated: qobject_cast<QSizeGrip *>(object)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:145
0-3257
2709 if (event->type() != QEvent::MouseButtonPress || !testOption(QMdiSubWindow::RubberBandResize))
never evaluated: event->type() != QEvent::MouseButtonPress
never evaluated: !testOption(QMdiSubWindow::RubberBandResize)
0
2710 return QWidget::eventFilter(object, event);
never executed: return QWidget::eventFilter(object, event);
0
2711 const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
never executed (the execution status of this line is deduced): const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
-
2712 d->mousePressPosition = parentWidget()->mapFromGlobal(mouseEvent->globalPos());
never executed (the execution status of this line is deduced): d->mousePressPosition = parentWidget()->mapFromGlobal(mouseEvent->globalPos());
-
2713 d->oldGeometry = geometry();
never executed (the execution status of this line is deduced): d->oldGeometry = geometry();
-
2714 d->currentOperation = isLeftToRight() ? QMdiSubWindowPrivate::BottomRightResize
never evaluated: isLeftToRight()
0
2715 : QMdiSubWindowPrivate::BottomLeftResize;
never executed (the execution status of this line is deduced): : QMdiSubWindowPrivate::BottomLeftResize;
-
2716#ifndef QT_NO_RUBBERBAND -
2717 d->enterRubberBandMode();
never executed (the execution status of this line is deduced): d->enterRubberBandMode();
-
2718#endif -
2719 return true;
never executed: return true;
0
2720 } -
2721#endif -
2722 -
2723 if (object != d->baseWidget && event->type() != QEvent::WindowTitleChange)
evaluated: object != d->baseWidget
TRUEFALSE
yes
Evaluation Count:145
yes
Evaluation Count:3257
evaluated: event->type() != QEvent::WindowTitleChange
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:33
33-3257
2724 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:112
112
2725 -
2726 switch (event->type()) { -
2727 case QEvent::Show: -
2728 d->setActive(true);
executed (the execution status of this line is deduced): d->setActive(true);
-
2729 break;
executed: break;
Execution Count:253
253
2730 case QEvent::ShowToParent: -
2731 if (!d->isWidgetHiddenByUs)
evaluated: !d->isWidgetHiddenByUs
TRUEFALSE
yes
Evaluation Count:118
yes
Evaluation Count:23
23-118
2732 show();
executed: show();
Execution Count:118
118
2733 break;
executed: break;
Execution Count:141
141
2734 case QEvent::WindowStateChange: { -
2735 QWindowStateChangeEvent *changeEvent = static_cast<QWindowStateChangeEvent*>(event);
executed (the execution status of this line is deduced): QWindowStateChangeEvent *changeEvent = static_cast<QWindowStateChangeEvent*>(event);
-
2736 if (changeEvent->isOverride())
evaluated: changeEvent->isOverride()
TRUEFALSE
yes
Evaluation Count:1020
yes
Evaluation Count:20
20-1020
2737 break;
executed: break;
Execution Count:1020
1020
2738 Qt::WindowStates oldState = changeEvent->oldState();
executed (the execution status of this line is deduced): Qt::WindowStates oldState = changeEvent->oldState();
-
2739 Qt::WindowStates newState = d->baseWidget->windowState();
executed (the execution status of this line is deduced): Qt::WindowStates newState = d->baseWidget->windowState();
-
2740 if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized))
partially evaluated: !(oldState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
evaluated: (newState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:15
0-20
2741 showMinimized();
executed: showMinimized();
Execution Count:5
5
2742 else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized))
evaluated: !(oldState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:6
partially evaluated: (newState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
2743 showMaximized();
executed: showMaximized();
Execution Count:9
9
2744 else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized)))
partially evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
2745 showNormal();
executed: showNormal();
Execution Count:6
6
2746 break;
executed: break;
Execution Count:20
20
2747 } -
2748 case QEvent::Enter: -
2749 d->currentOperation = QMdiSubWindowPrivate::None;
executed (the execution status of this line is deduced): d->currentOperation = QMdiSubWindowPrivate::None;
-
2750 d->updateCursor();
executed (the execution status of this line is deduced): d->updateCursor();
-
2751 break;
executed: break;
Execution Count:3
3
2752 case QEvent::LayoutRequest: -
2753 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2754 break;
executed: break;
Execution Count:1
1
2755 case QEvent::WindowTitleChange: -
2756 if (d->ignoreWindowTitleChange)
evaluated: d->ignoreWindowTitleChange
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:14
14-32
2757 break;
executed: break;
Execution Count:32
32
2758 if (object == d->baseWidget) {
evaluated: object == d->baseWidget
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1
1-13
2759 d->updateWindowTitle(true);
executed (the execution status of this line is deduced): d->updateWindowTitle(true);
-
2760 d->lastChildWindowTitle = d->baseWidget->windowTitle();
executed (the execution status of this line is deduced): d->lastChildWindowTitle = d->baseWidget->windowTitle();
-
2761#ifndef QT_NO_MENUBAR -
2762 } else if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar()
executed: }
Execution Count:13
partially evaluated: maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: d->controlContainer->menuBar()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-13
2763 ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) {
partially evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2764 d->originalTitle = QString::null;
executed (the execution status of this line is deduced): d->originalTitle = QString::null;
-
2765 if (d->baseWidget && d->baseWidget->windowTitle() == windowTitle())
partially evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: d->baseWidget->windowTitle() == windowTitle()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2766 d->updateWindowTitle(true);
executed: d->updateWindowTitle(true);
Execution Count:1
1
2767 else -
2768 d->updateWindowTitle(false);
never executed: d->updateWindowTitle(false);
0
2769#endif -
2770 } -
2771 break;
executed: break;
Execution Count:14
14
2772 case QEvent::ModifiedChange: { -
2773 if (object != d->baseWidget)
partially evaluated: object != d->baseWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
2774 break;
never executed: break;
0
2775 bool windowModified = d->baseWidget->isWindowModified();
executed (the execution status of this line is deduced): bool windowModified = d->baseWidget->isWindowModified();
-
2776 if (!windowModified && d->baseWidget->windowTitle() != windowTitle())
evaluated: !windowModified
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:4
evaluated: d->baseWidget->windowTitle() != windowTitle()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-4
2777 break;
executed: break;
Execution Count:1
1
2778 if (windowTitle().contains(QLatin1String("[*]")))
partially evaluated: windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
2779 setWindowModified(windowModified);
executed: setWindowModified(windowModified);
Execution Count:6
6
2780 break;
executed: break;
Execution Count:6
6
2781 } -
2782 default: -
2783 break;
executed: break;
Execution Count:1799
1799
2784 } -
2785 return QWidget::eventFilter(object, event);
executed: return QWidget::eventFilter(object, event);
Execution Count:3290
3290
2786} -
2787 -
2788/*! -
2789 \reimp -
2790*/ -
2791bool QMdiSubWindow::event(QEvent *event) -
2792{ -
2793 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2794 switch (event->type()) { -
2795 case QEvent::StyleChange: { -
2796 bool wasShaded = isShaded();
never executed (the execution status of this line is deduced): bool wasShaded = isShaded();
-
2797 bool wasMinimized = isMinimized();
never executed (the execution status of this line is deduced): bool wasMinimized = isMinimized();
-
2798 bool wasMaximized = isMaximized();
never executed (the execution status of this line is deduced): bool wasMaximized = isMaximized();
-
2799 ensurePolished();
never executed (the execution status of this line is deduced): ensurePolished();
-
2800 setContentsMargins(0, 0, 0, 0);
never executed (the execution status of this line is deduced): setContentsMargins(0, 0, 0, 0);
-
2801 if (wasMinimized || wasMaximized || wasShaded)
never evaluated: wasMinimized
never evaluated: wasMaximized
never evaluated: wasShaded
0
2802 showNormal();
never executed: showNormal();
0
2803 d->updateGeometryConstraints();
never executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2804 resize(d->internalMinimumSize.expandedTo(size()));
never executed (the execution status of this line is deduced): resize(d->internalMinimumSize.expandedTo(size()));
-
2805 d->updateMask();
never executed (the execution status of this line is deduced): d->updateMask();
-
2806 d->updateDirtyRegions();
never executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
2807 if (wasShaded)
never evaluated: wasShaded
0
2808 showShaded();
never executed: showShaded();
0
2809 else if (wasMinimized)
never evaluated: wasMinimized
0
2810 showMinimized();
never executed: showMinimized();
0
2811 else if (wasMaximized)
never evaluated: wasMaximized
0
2812 showMaximized();
never executed: showMaximized();
0
2813 break;
never executed: break;
0
2814 } -
2815 case QEvent::ParentAboutToChange: -
2816 d->setActive(false);
executed (the execution status of this line is deduced): d->setActive(false);
-
2817 break;
executed: break;
Execution Count:8
8
2818 case QEvent::ParentChange: { -
2819 bool wasResized = testAttribute(Qt::WA_Resized);
executed (the execution status of this line is deduced): bool wasResized = testAttribute(Qt::WA_Resized);
-
2820#ifndef QT_NO_MENUBAR -
2821 d->removeButtonsFromMenuBar();
executed (the execution status of this line is deduced): d->removeButtonsFromMenuBar();
-
2822#endif -
2823 d->currentOperation = QMdiSubWindowPrivate::None;
executed (the execution status of this line is deduced): d->currentOperation = QMdiSubWindowPrivate::None;
-
2824 d->activeSubControl = QStyle::SC_None;
executed (the execution status of this line is deduced): d->activeSubControl = QStyle::SC_None;
-
2825 d->hoveredSubControl = QStyle::SC_None;
executed (the execution status of this line is deduced): d->hoveredSubControl = QStyle::SC_None;
-
2826#ifndef QT_NO_RUBBERBAND -
2827 if (d->isInRubberBandMode)
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
0-48
2828 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
2829#endif -
2830 d->isShadeMode = false;
executed (the execution status of this line is deduced): d->isShadeMode = false;
-
2831 d->isMaximizeMode = false;
executed (the execution status of this line is deduced): d->isMaximizeMode = false;
-
2832 d->isWidgetHiddenByUs = false;
executed (the execution status of this line is deduced): d->isWidgetHiddenByUs = false;
-
2833 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:25
23-25
2834#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) -
2835 if (qobject_cast<QMacStyle *>(style())) -
2836 delete d->sizeGrip; -
2837#endif -
2838 setOption(RubberBandResize, false);
executed (the execution status of this line is deduced): setOption(RubberBandResize, false);
-
2839 setOption(RubberBandMove, false);
executed (the execution status of this line is deduced): setOption(RubberBandMove, false);
-
2840 } else {
executed: }
Execution Count:23
23
2841 d->setWindowFlags(windowFlags());
executed (the execution status of this line is deduced): d->setWindowFlags(windowFlags());
-
2842 }
executed: }
Execution Count:25
25
2843 setContentsMargins(0, 0, 0, 0);
executed (the execution status of this line is deduced): setContentsMargins(0, 0, 0, 0);
-
2844 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2845 d->updateCursor();
executed (the execution status of this line is deduced): d->updateCursor();
-
2846 d->updateMask();
executed (the execution status of this line is deduced): d->updateMask();
-
2847 d->updateDirtyRegions();
executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
2848 d->updateActions();
executed (the execution status of this line is deduced): d->updateActions();
-
2849 if (!wasResized && testAttribute(Qt::WA_Resized))
evaluated: !wasResized
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:9
partially evaluated: testAttribute(Qt::WA_Resized)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:39
0-39
2850 setAttribute(Qt::WA_Resized, false);
never executed: setAttribute(Qt::WA_Resized, false);
0
2851 break;
executed: break;
Execution Count:48
48
2852 } -
2853 case QEvent::WindowActivate: -
2854 if (d->ignoreNextActivationEvent) {
evaluated: d->ignoreNextActivationEvent
TRUEFALSE
yes
Evaluation Count:62
yes
Evaluation Count:7
7-62
2855 d->ignoreNextActivationEvent = false;
executed (the execution status of this line is deduced): d->ignoreNextActivationEvent = false;
-
2856 break;
executed: break;
Execution Count:62
62
2857 } -
2858 d->isExplicitlyDeactivated = false;
executed (the execution status of this line is deduced): d->isExplicitlyDeactivated = false;
-
2859 d->setActive(true);
executed (the execution status of this line is deduced): d->setActive(true);
-
2860 break;
executed: break;
Execution Count:7
7
2861 case QEvent::WindowDeactivate: -
2862 if (d->ignoreNextActivationEvent) {
evaluated: d->ignoreNextActivationEvent
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:55
30-55
2863 d->ignoreNextActivationEvent = false;
executed (the execution status of this line is deduced): d->ignoreNextActivationEvent = false;
-
2864 break;
executed: break;
Execution Count:30
30
2865 } -
2866 d->isExplicitlyDeactivated = true;
executed (the execution status of this line is deduced): d->isExplicitlyDeactivated = true;
-
2867 d->setActive(false);
executed (the execution status of this line is deduced): d->setActive(false);
-
2868 break;
executed: break;
Execution Count:55
55
2869 case QEvent::WindowTitleChange: -
2870 if (!d->ignoreWindowTitleChange)
evaluated: !d->ignoreWindowTitleChange
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:19
5-19
2871 d->updateWindowTitle(false);
executed: d->updateWindowTitle(false);
Execution Count:5
5
2872 d->updateInternalWindowTitle();
executed (the execution status of this line is deduced): d->updateInternalWindowTitle();
-
2873 break;
executed: break;
Execution Count:24
24
2874 case QEvent::ModifiedChange: -
2875 if (!windowTitle().contains(QLatin1String("[*]")))
evaluated: !windowTitle().contains(QLatin1String("[*]"))
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:7
3-7
2876 break;
executed: break;
Execution Count:3
3
2877#ifndef QT_NO_MENUBAR -
2878 if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar()
evaluated: maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
partially evaluated: d->controlContainer->menuBar()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-5
2879 ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) {
partially evaluated: d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
2880 window()->setWindowModified(isWindowModified());
executed (the execution status of this line is deduced): window()->setWindowModified(isWindowModified());
-
2881 }
executed: }
Execution Count:2
2
2882#endif // QT_NO_MENUBAR -
2883 d->updateInternalWindowTitle();
executed (the execution status of this line is deduced): d->updateInternalWindowTitle();
-
2884 break;
executed: break;
Execution Count:7
7
2885 case QEvent::LayoutDirectionChange: -
2886 d->updateDirtyRegions();
executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
2887 break;
executed: break;
Execution Count:2
2
2888 case QEvent::LayoutRequest: -
2889 d->updateGeometryConstraints();
executed (the execution status of this line is deduced): d->updateGeometryConstraints();
-
2890 break;
executed: break;
Execution Count:158
158
2891 case QEvent::WindowIconChange: -
2892 d->menuIcon = windowIcon();
never executed (the execution status of this line is deduced): d->menuIcon = windowIcon();
-
2893 if (d->menuIcon.isNull())
never evaluated: d->menuIcon.isNull()
0
2894 d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
never executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
0
2895 if (d->controlContainer)
never evaluated: d->controlContainer
0
2896 d->controlContainer->updateWindowIcon(d->menuIcon);
never executed: d->controlContainer->updateWindowIcon(d->menuIcon);
0
2897 if (!maximizedSystemMenuIconWidget())
never evaluated: !maximizedSystemMenuIconWidget()
0
2898 update(0, 0, width(), d->titleBarHeight());
never executed: update(0, 0, width(), d->titleBarHeight());
0
2899 break;
never executed: break;
0
2900 case QEvent::PaletteChange: -
2901 d->titleBarPalette = d->desktopPalette();
executed (the execution status of this line is deduced): d->titleBarPalette = d->desktopPalette();
-
2902 break;
executed: break;
Execution Count:124
124
2903 case QEvent::FontChange: -
2904 d->font = font();
never executed (the execution status of this line is deduced): d->font = font();
-
2905 break;
never executed: break;
0
2906#ifndef QT_NO_TOOLTIP -
2907 case QEvent::ToolTip: -
2908 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(),
-
2909 QStyle::CC_TitleBar, d->hoveredSubControl);
never executed (the execution status of this line is deduced): QStyle::CC_TitleBar, d->hoveredSubControl);
-
2910 break;
never executed: break;
0
2911#endif -
2912 default: -
2913 break;
executed: break;
Execution Count:9920
9920
2914 } -
2915 return QWidget::event(event);
executed: return QWidget::event(event);
Execution Count:10448
10448
2916} -
2917 -
2918/*! -
2919 \reimp -
2920*/ -
2921void QMdiSubWindow::showEvent(QShowEvent *showEvent) -
2922{ -
2923 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2924 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:273
10-273
2925 QWidget::showEvent(showEvent);
executed (the execution status of this line is deduced): QWidget::showEvent(showEvent);
-
2926 return;
executed: return;
Execution Count:10
10
2927 } -
2928 -
2929#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) -
2930 if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip -
2931 && !(windowFlags() & Qt::FramelessWindowHint)) { -
2932 d->setSizeGrip(new QSizeGrip(0)); -
2933 Q_ASSERT(d->sizeGrip); -
2934 if (isMinimized()) -
2935 d->setSizeGripVisible(false); -
2936 else -
2937 d->setSizeGripVisible(true); -
2938 resize(size().expandedTo(d->internalMinimumSize)); -
2939 } -
2940#endif -
2941 -
2942 d->updateDirtyRegions();
executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
2943 // Show buttons in the menu bar if they're already not there. -
2944 // We want to do this when QMdiSubWindow becomes visible after being hidden. -
2945#ifndef QT_NO_MENUBAR -
2946 if (d->controlContainer) {
partially evaluated: d->controlContainer
TRUEFALSE
yes
Evaluation Count:273
no
Evaluation Count:0
0-273
2947 if (QMenuBar *menuBar = d->menuBar()) {
evaluated: QMenuBar *menuBar = d->menuBar()
TRUEFALSE
yes
Evaluation Count:37
yes
Evaluation Count:236
37-236
2948 if (menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget())
evaluated: menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:35
2-35
2949 d->showButtonsInMenuBar(menuBar);
executed: d->showButtonsInMenuBar(menuBar);
Execution Count:2
2
2950 }
executed: }
Execution Count:37
37
2951 }
executed: }
Execution Count:273
273
2952#endif -
2953 d->setActive(true);
executed (the execution status of this line is deduced): d->setActive(true);
-
2954}
executed: }
Execution Count:273
273
2955 -
2956/*! -
2957 \reimp -
2958*/ -
2959void QMdiSubWindow::hideEvent(QHideEvent * /*hideEvent*/) -
2960{ -
2961#ifndef QT_NO_MENUBAR -
2962 d_func()->removeButtonsFromMenuBar();
executed (the execution status of this line is deduced): d_func()->removeButtonsFromMenuBar();
-
2963#endif -
2964}
executed: }
Execution Count:271
271
2965 -
2966/*! -
2967 \reimp -
2968*/ -
2969void QMdiSubWindow::changeEvent(QEvent *changeEvent) -
2970{ -
2971 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:86
yes
Evaluation Count:1693
86-1693
2972 QWidget::changeEvent(changeEvent);
executed (the execution status of this line is deduced): QWidget::changeEvent(changeEvent);
-
2973 return;
executed: return;
Execution Count:86
86
2974 } -
2975 -
2976 if (changeEvent->type() != QEvent::WindowStateChange) {
evaluated: changeEvent->type() != QEvent::WindowStateChange
TRUEFALSE
yes
Evaluation Count:538
yes
Evaluation Count:1155
538-1155
2977 QWidget::changeEvent(changeEvent);
executed (the execution status of this line is deduced): QWidget::changeEvent(changeEvent);
-
2978 return;
executed: return;
Execution Count:538
538
2979 } -
2980 -
2981 QWindowStateChangeEvent *event = static_cast<QWindowStateChangeEvent *>(changeEvent);
executed (the execution status of this line is deduced): QWindowStateChangeEvent *event = static_cast<QWindowStateChangeEvent *>(changeEvent);
-
2982 if (event->isOverride()) {
evaluated: event->isOverride()
TRUEFALSE
yes
Evaluation Count:1034
yes
Evaluation Count:121
121-1034
2983 event->ignore();
executed (the execution status of this line is deduced): event->ignore();
-
2984 return;
executed: return;
Execution Count:1034
1034
2985 } -
2986 -
2987 Qt::WindowStates oldState = event->oldState();
executed (the execution status of this line is deduced): Qt::WindowStates oldState = event->oldState();
-
2988 Qt::WindowStates newState = windowState();
executed (the execution status of this line is deduced): Qt::WindowStates newState = windowState();
-
2989 if (oldState == newState) {
partially evaluated: oldState == newState
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:121
0-121
2990 changeEvent->ignore();
never executed (the execution status of this line is deduced): changeEvent->ignore();
-
2991 return;
never executed: return;
0
2992 } -
2993 -
2994 // QWidget ensures that the widget is visible _after_ setWindowState(), -
2995 // but we need to ensure that the widget is visible _before_ -
2996 // setWindowState() returns. -
2997 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
2998 if (!isVisible()) {
evaluated: !isVisible()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:103
18-103
2999 d->ensureWindowState(Qt::WindowNoState);
executed (the execution status of this line is deduced): d->ensureWindowState(Qt::WindowNoState);
-
3000 setVisible(true);
executed (the execution status of this line is deduced): setVisible(true);
-
3001 }
executed: }
Execution Count:18
18
3002 -
3003 if (!d->oldGeometry.isValid())
evaluated: !d->oldGeometry.isValid()
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:77
44-77
3004 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:44
44
3005 -
3006 if ((oldState & Qt::WindowActive) && (newState & Qt::WindowActive))
evaluated: (oldState & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:97
yes
Evaluation Count:24
evaluated: (newState & Qt::WindowActive)
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:14
14-97
3007 d->currentOperation = QMdiSubWindowPrivate::None;
executed: d->currentOperation = QMdiSubWindowPrivate::None;
Execution Count:83
83
3008 -
3009 if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized))
evaluated: !(oldState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:103
yes
Evaluation Count:18
evaluated: (newState & Qt::WindowMinimized)
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:84
18-103
3010 d->setMinimizeMode();
executed: d->setMinimizeMode();
Execution Count:19
19
3011 else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized))
evaluated: !(oldState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:35
evaluated: (newState & Qt::WindowMaximized)
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:17
17-67
3012 d->setMaximizeMode();
executed: d->setMaximizeMode();
Execution Count:50
50
3013 else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized)))
partially evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))
TRUEFALSE
yes
Evaluation Count:52
no
Evaluation Count:0
0-52
3014 d->setNormalMode();
executed: d->setNormalMode();
Execution Count:52
52
3015 -
3016 if (d->isActive)
evaluated: d->isActive
TRUEFALSE
yes
Evaluation Count:117
yes
Evaluation Count:4
4-117
3017 d->ensureWindowState(Qt::WindowActive);
executed: d->ensureWindowState(Qt::WindowActive);
Execution Count:117
117
3018 emit windowStateChanged(oldState, windowState());
executed (the execution status of this line is deduced): windowStateChanged(oldState, windowState());
-
3019}
executed: }
Execution Count:121
121
3020 -
3021/*! -
3022 \reimp -
3023*/ -
3024void QMdiSubWindow::closeEvent(QCloseEvent *closeEvent) -
3025{ -
3026 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3027 bool acceptClose = true;
executed (the execution status of this line is deduced): bool acceptClose = true;
-
3028 if (d->baseWidget)
partially evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
3029 acceptClose = d->baseWidget->close();
executed: acceptClose = d->baseWidget->close();
Execution Count:17
17
3030 if (!acceptClose) {
evaluated: !acceptClose
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:16
1-16
3031 closeEvent->ignore();
executed (the execution status of this line is deduced): closeEvent->ignore();
-
3032 return;
executed: return;
Execution Count:1
1
3033 } -
3034#ifndef QT_NO_MENUBAR -
3035 d->removeButtonsFromMenuBar();
executed (the execution status of this line is deduced): d->removeButtonsFromMenuBar();
-
3036#endif -
3037 d->setActive(false);
executed (the execution status of this line is deduced): d->setActive(false);
-
3038 if (parentWidget() && testAttribute(Qt::WA_DeleteOnClose)) {
partially evaluated: parentWidget()
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
partially evaluated: testAttribute(Qt::WA_DeleteOnClose)
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
3039 QChildEvent childRemoved(QEvent::ChildRemoved, this);
executed (the execution status of this line is deduced): QChildEvent childRemoved(QEvent::ChildRemoved, this);
-
3040 QApplication::sendEvent(parentWidget(), &childRemoved);
executed (the execution status of this line is deduced): QApplication::sendEvent(parentWidget(), &childRemoved);
-
3041 }
executed: }
Execution Count:16
16
3042 closeEvent->accept();
executed (the execution status of this line is deduced): closeEvent->accept();
-
3043}
executed: }
Execution Count:16
16
3044 -
3045/*! -
3046 \reimp -
3047*/ -
3048void QMdiSubWindow::leaveEvent(QEvent * /*leaveEvent*/) -
3049{ -
3050 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3051 if (d->hoveredSubControl != QStyle::SC_None) {
partially evaluated: d->hoveredSubControl != QStyle::SC_None
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
3052 d->hoveredSubControl = QStyle::SC_None;
never executed (the execution status of this line is deduced): d->hoveredSubControl = QStyle::SC_None;
-
3053 update(QRegion(0, 0, width(), d->titleBarHeight()));
never executed (the execution status of this line is deduced): update(QRegion(0, 0, width(), d->titleBarHeight()));
-
3054 }
never executed: }
0
3055}
executed: }
Execution Count:3
3
3056 -
3057/*! -
3058 \reimp -
3059*/ -
3060void QMdiSubWindow::resizeEvent(QResizeEvent *resizeEvent) -
3061{ -
3062 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3063#ifndef QT_NO_SIZEGRIP -
3064 if (d->sizeGrip) {
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:564
0-564
3065 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,
-
3066 height() - d->sizeGrip->height());
never executed (the execution status of this line is deduced): height() - d->sizeGrip->height());
-
3067 }
never executed: }
0
3068#endif -
3069 -
3070 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:548
16-548
3071 QWidget::resizeEvent(resizeEvent);
executed (the execution status of this line is deduced): QWidget::resizeEvent(resizeEvent);
-
3072 return;
executed: return;
Execution Count:16
16
3073 } -
3074 -
3075 if (d->isMaximizeMode)
evaluated: d->isMaximizeMode
TRUEFALSE
yes
Evaluation Count:79
yes
Evaluation Count:469
79-469
3076 d->ensureWindowState(Qt::WindowMaximized);
executed: d->ensureWindowState(Qt::WindowMaximized);
Execution Count:79
79
3077 -
3078 d->updateMask();
executed (the execution status of this line is deduced): d->updateMask();
-
3079 if (!isVisible())
evaluated: !isVisible()
TRUEFALSE
yes
Evaluation Count:260
yes
Evaluation Count:288
260-288
3080 return;
executed: return;
Execution Count:260
260
3081 -
3082 if (d->resizeTimerId <= 0)
evaluated: d->resizeTimerId <= 0
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:269
19-269
3083 d->cachedStyleOptions = d->titleBarOptions();
executed: d->cachedStyleOptions = d->titleBarOptions();
Execution Count:19
19
3084 else -
3085 killTimer(d->resizeTimerId);
executed: killTimer(d->resizeTimerId);
Execution Count:269
269
3086 d->resizeTimerId = startTimer(200);
executed (the execution status of this line is deduced): d->resizeTimerId = startTimer(200);
-
3087}
executed: }
Execution Count:288
288
3088 -
3089/*! -
3090 \reimp -
3091*/ -
3092void QMdiSubWindow::timerEvent(QTimerEvent *timerEvent) -
3093{ -
3094 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3095 if (timerEvent->timerId() == d->resizeTimerId) {
partially evaluated: timerEvent->timerId() == d->resizeTimerId
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
3096 killTimer(d->resizeTimerId);
executed (the execution status of this line is deduced): killTimer(d->resizeTimerId);
-
3097 d->resizeTimerId = -1;
executed (the execution status of this line is deduced): d->resizeTimerId = -1;
-
3098 d->updateDirtyRegions();
executed (the execution status of this line is deduced): d->updateDirtyRegions();
-
3099 }
executed: }
Execution Count:2
2
3100}
executed: }
Execution Count:2
2
3101 -
3102/*! -
3103 \reimp -
3104*/ -
3105void QMdiSubWindow::moveEvent(QMoveEvent *moveEvent) -
3106{ -
3107 if (!parent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:207
3-207
3108 QWidget::moveEvent(moveEvent);
executed (the execution status of this line is deduced): QWidget::moveEvent(moveEvent);
-
3109 return;
executed: return;
Execution Count:3
3
3110 } -
3111 -
3112 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3113 if (d->isMaximizeMode)
evaluated: d->isMaximizeMode
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:190
17-190
3114 d->ensureWindowState(Qt::WindowMaximized);
executed: d->ensureWindowState(Qt::WindowMaximized);
Execution Count:17
17
3115}
executed: }
Execution Count:207
207
3116 -
3117/*! -
3118 \reimp -
3119*/ -
3120void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) -
3121{ -
3122 if (!parent() || (windowFlags() & Qt::FramelessWindowHint)) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:200
partially evaluated: (windowFlags() & Qt::FramelessWindowHint)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:200
0-200
3123 QWidget::paintEvent(paintEvent);
executed (the execution status of this line is deduced): QWidget::paintEvent(paintEvent);
-
3124 return;
executed: return;
Execution Count:6
6
3125 } -
3126 -
3127 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3128 if (isMaximized() && !d->drawTitleBarWhenMaximized())
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:33
yes
Evaluation Count:167
evaluated: !d->drawTitleBarWhenMaximized()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:27
6-167
3129 return;
executed: return;
Execution Count:6
6
3130 -
3131 if (d->resizeTimerId != -1) {
evaluated: d->resizeTimerId != -1
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:184
10-184
3132 // Only update the style option rect and the window title. -
3133 int border = d->hasBorder(d->cachedStyleOptions) ? 4 : 0;
partially evaluated: d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
3134 int titleBarHeight = d->titleBarHeight(d->cachedStyleOptions);
executed (the execution status of this line is deduced): int titleBarHeight = d->titleBarHeight(d->cachedStyleOptions);
-
3135 titleBarHeight -= isMinimized() ? 2 * border : border;
partially evaluated: isMinimized()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3136 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);
-
3137 if (!d->windowTitle.isEmpty()) {
evaluated: !d->windowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
3138 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,
-
3139 QStyle::SC_TitleBarLabel, this).width();
executed (the execution status of this line is deduced): QStyle::SC_TitleBarLabel, this).width();
-
3140 d->cachedStyleOptions.text = d->cachedStyleOptions.fontMetrics
executed (the execution status of this line is deduced): d->cachedStyleOptions.text = d->cachedStyleOptions.fontMetrics
-
3141 .elidedText(d->windowTitle, Qt::ElideRight, width);
executed (the execution status of this line is deduced): .elidedText(d->windowTitle, Qt::ElideRight, width);
-
3142 }
executed: }
Execution Count:5
5
3143 } else {
executed: }
Execution Count:10
10
3144 // Force full update. -
3145 d->cachedStyleOptions = d->titleBarOptions();
executed (the execution status of this line is deduced): d->cachedStyleOptions = d->titleBarOptions();
-
3146 }
executed: }
Execution Count:184
184
3147 -
3148 QStylePainter painter(this);
executed (the execution status of this line is deduced): QStylePainter painter(this);
-
3149 if (!d->windowTitle.isEmpty())
evaluated: !d->windowTitle.isEmpty()
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:169
25-169
3150 painter.setFont(d->font);
executed: painter.setFont(d->font);
Execution Count:25
25
3151 painter.drawComplexControl(QStyle::CC_TitleBar, d->cachedStyleOptions);
executed (the execution status of this line is deduced): painter.drawComplexControl(QStyle::CC_TitleBar, d->cachedStyleOptions);
-
3152 -
3153 if (isMinimized() && !d->hasBorder(d->cachedStyleOptions))
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:182
partially evaluated: !d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-182
3154 return;
never executed: return;
0
3155 -
3156 QStyleOptionFrame frameOptions;
executed (the execution status of this line is deduced): QStyleOptionFrame frameOptions;
-
3157 frameOptions.initFrom(this);
executed (the execution status of this line is deduced): frameOptions.initFrom(this);
-
3158 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);
-
3159 if (d->isActive)
evaluated: d->isActive
TRUEFALSE
yes
Evaluation Count:161
yes
Evaluation Count:33
33-161
3160 frameOptions.state |= QStyle::State_Active;
executed: frameOptions.state |= QStyle::State_Active;
Execution Count:161
161
3161 else -
3162 frameOptions.state &= ~QStyle::State_Active;
executed: frameOptions.state &= ~QStyle::State_Active;
Execution Count:33
33
3163 -
3164 // ### Ensure that we do not require setting the cliprect for 4.4 -
3165 if (!isMinimized() && !d->hasBorder(d->cachedStyleOptions))
evaluated: !isMinimized()
TRUEFALSE
yes
Evaluation Count:182
yes
Evaluation Count:12
partially evaluated: !d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:182
0-182
3166 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
3167 if (!isMinimized() || d->hasBorder(d->cachedStyleOptions))
evaluated: !isMinimized()
TRUEFALSE
yes
Evaluation Count:182
yes
Evaluation Count:12
partially evaluated: d->hasBorder(d->cachedStyleOptions)
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-182
3168 painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions);
executed: painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions);
Execution Count:194
194
3169}
executed: }
Execution Count:194
194
3170 -
3171/*! -
3172 \reimp -
3173*/ -
3174void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent) -
3175{ -
3176 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3177 QWidget::mousePressEvent(mouseEvent);
never executed (the execution status of this line is deduced): QWidget::mousePressEvent(mouseEvent);
-
3178 return;
never executed: return;
0
3179 } -
3180 -
3181 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3182 if (d->isInInteractiveMode)
partially evaluated: d->isInInteractiveMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3183 d->leaveInteractiveMode();
never executed: d->leaveInteractiveMode();
0
3184#ifndef QT_NO_RUBBERBAND -
3185 if (d->isInRubberBandMode)
partially evaluated: d->isInRubberBandMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3186 d->leaveRubberBandMode();
never executed: d->leaveRubberBandMode();
0
3187#endif -
3188 -
3189 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3190 mouseEvent->ignore();
never executed (the execution status of this line is deduced): mouseEvent->ignore();
-
3191 return;
never executed: return;
0
3192 } -
3193 -
3194 if (d->currentOperation != QMdiSubWindowPrivate::None) {
evaluated: d->currentOperation != QMdiSubWindowPrivate::None
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
3195 d->updateCursor();
executed (the execution status of this line is deduced): d->updateCursor();
-
3196 d->mousePressPosition = mapToParent(mouseEvent->pos());
executed (the execution status of this line is deduced): d->mousePressPosition = mapToParent(mouseEvent->pos());
-
3197 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
3198 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:7
7
3199#ifndef QT_NO_RUBBERBAND -
3200 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
3201 || (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
3202 d->enterRubberBandMode();
executed (the execution status of this line is deduced): d->enterRubberBandMode();
-
3203 }
executed: }
Execution Count:2
2
3204#endif -
3205 return;
executed: return;
Execution Count:7
7
3206 } -
3207 -
3208 d->activeSubControl = d->hoveredSubControl;
executed (the execution status of this line is deduced): d->activeSubControl = d->hoveredSubControl;
-
3209#ifndef QT_NO_MENU -
3210 if (d->activeSubControl == QStyle::SC_TitleBarSysMenu)
partially evaluated: d->activeSubControl == QStyle::SC_TitleBarSysMenu
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
3211 showSystemMenu();
never executed: showSystemMenu();
0
3212 else -
3213#endif -
3214 update(QRegion(0, 0, width(), d->titleBarHeight()));
executed: update(QRegion(0, 0, width(), d->titleBarHeight()));
Execution Count:3
3
3215} -
3216 -
3217/*! -
3218 \reimp -
3219*/ -
3220void QMdiSubWindow::mouseDoubleClickEvent(QMouseEvent *mouseEvent) -
3221{ -
3222 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
3223 QWidget::mouseDoubleClickEvent(mouseEvent);
never executed (the execution status of this line is deduced): QWidget::mouseDoubleClickEvent(mouseEvent);
-
3224 return;
never executed: return;
0
3225 } -
3226 -
3227 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
3228 mouseEvent->ignore();
never executed (the execution status of this line is deduced): mouseEvent->ignore();
-
3229 return;
never executed: return;
0
3230 } -
3231 -
3232 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3233 if (!d->isMoveOperation()) {
partially evaluated: !d->isMoveOperation()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
3234#ifndef QT_NO_MENU -
3235 if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu)
never evaluated: d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
0
3236 close();
never executed: close();
0
3237#endif -
3238 return;
never executed: return;
0
3239 } -
3240 -
3241 Qt::WindowFlags flags = windowFlags();
executed (the execution status of this line is deduced): Qt::WindowFlags flags = windowFlags();
-
3242 if (isMinimized()) {
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
3243 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
3244 || (flags & Qt::WindowMinimizeButtonHint)) {
partially evaluated: (flags & Qt::WindowMinimizeButtonHint)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
3245 showNormal();
executed (the execution status of this line is deduced): showNormal();
-
3246 }
executed: }
Execution Count:2
2
3247 return;
executed: return;
Execution Count:2
2
3248 } -
3249 -
3250 if (isMaximized()) {
evaluated: isMaximized()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
3251 if (flags & Qt::WindowMaximizeButtonHint)
partially evaluated: flags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
3252 showNormal();
executed: showNormal();
Execution Count:1
1
3253 return;
executed: return;
Execution Count:1
1
3254 } -
3255 -
3256 if (flags & Qt::WindowShadeButtonHint)
evaluated: flags & Qt::WindowShadeButtonHint
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
3257 showShaded();
executed: showShaded();
Execution Count:1
1
3258 else if (flags & Qt::WindowMaximizeButtonHint)
partially evaluated: flags & Qt::WindowMaximizeButtonHint
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
3259 showMaximized();
executed: showMaximized();
Execution Count:1
1
3260} -
3261 -
3262/*! -
3263 \reimp -
3264*/ -
3265void QMdiSubWindow::mouseReleaseEvent(QMouseEvent *mouseEvent) -
3266{ -
3267 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3268 QWidget::mouseReleaseEvent(mouseEvent);
never executed (the execution status of this line is deduced): QWidget::mouseReleaseEvent(mouseEvent);
-
3269 return;
never executed: return;
0
3270 } -
3271 -
3272 if (mouseEvent->button() != Qt::LeftButton) {
partially evaluated: mouseEvent->button() != Qt::LeftButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3273 mouseEvent->ignore();
never executed (the execution status of this line is deduced): mouseEvent->ignore();
-
3274 return;
never executed: return;
0
3275 } -
3276 -
3277 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3278 if (d->currentOperation != QMdiSubWindowPrivate::None) {
evaluated: d->currentOperation != QMdiSubWindowPrivate::None
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
3279#ifndef QT_NO_RUBBERBAND -
3280 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
3281 d->leaveRubberBandMode();
executed: d->leaveRubberBandMode();
Execution Count:2
2
3282#endif -
3283 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
3284 d->oldGeometry = geometry();
executed: d->oldGeometry = geometry();
Execution Count:7
7
3285 }
executed: }
Execution Count:7
7
3286 -
3287 d->currentOperation = d->getOperation(mouseEvent->pos());
executed (the execution status of this line is deduced): d->currentOperation = d->getOperation(mouseEvent->pos());
-
3288 d->updateCursor();
executed (the execution status of this line is deduced): d->updateCursor();
-
3289 -
3290 d->hoveredSubControl = d->getSubControl(mouseEvent->pos());
executed (the execution status of this line is deduced): d->hoveredSubControl = d->getSubControl(mouseEvent->pos());
-
3291 if (d->activeSubControl != QStyle::SC_None
evaluated: d->activeSubControl != QStyle::SC_None
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:9
1-9
3292 && d->activeSubControl == d->hoveredSubControl) {
partially evaluated: d->activeSubControl == d->hoveredSubControl
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
3293 d->processClickedSubControl();
never executed (the execution status of this line is deduced): d->processClickedSubControl();
-
3294 }
never executed: }
0
3295 d->activeSubControl = QStyle::SC_None;
executed (the execution status of this line is deduced): d->activeSubControl = QStyle::SC_None;
-
3296 update(QRegion(0, 0, width(), d->titleBarHeight()));
executed (the execution status of this line is deduced): update(QRegion(0, 0, width(), d->titleBarHeight()));
-
3297}
executed: }
Execution Count:10
10
3298 -
3299/*! -
3300 \reimp -
3301*/ -
3302void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent) -
3303{ -
3304 if (!parent()) {
partially evaluated: !parent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:358
0-358
3305 QWidget::mouseMoveEvent(mouseEvent);
never executed (the execution status of this line is deduced): QWidget::mouseMoveEvent(mouseEvent);
-
3306 return;
never executed: return;
0
3307 } -
3308 -
3309 Q_D(QMdiSubWindow);
executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3310 // No update needed if we're in a move/resize operation. -
3311 if (!d->isMoveOperation() && !d->isResizeOperation()) {
evaluated: !d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:318
yes
Evaluation Count:40
evaluated: !d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:311
7-318
3312 // Find previous and current hover region. -
3313 const QStyleOptionTitleBar options = d->titleBarOptions();
executed (the execution status of this line is deduced): const QStyleOptionTitleBar options = d->titleBarOptions();
-
3314 QStyle::SubControl oldHover = d->hoveredSubControl;
executed (the execution status of this line is deduced): QStyle::SubControl oldHover = d->hoveredSubControl;
-
3315 d->hoveredSubControl = d->getSubControl(mouseEvent->pos());
executed (the execution status of this line is deduced): d->hoveredSubControl = d->getSubControl(mouseEvent->pos());
-
3316 QRegion hoverRegion;
executed (the execution status of this line is deduced): QRegion hoverRegion;
-
3317 if (isHoverControl(oldHover) && oldHover != d->hoveredSubControl)
partially evaluated: isHoverControl(oldHover)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
never evaluated: oldHover != d->hoveredSubControl
0-7
3318 hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this);
never executed: hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this);
0
3319 if (isHoverControl(d->hoveredSubControl) && d->hoveredSubControl != oldHover) {
partially evaluated: isHoverControl(d->hoveredSubControl)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
never evaluated: d->hoveredSubControl != oldHover
0-7
3320 hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
never executed (the execution status of this line is deduced): hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
-
3321 d->hoveredSubControl, this);
never executed (the execution status of this line is deduced): d->hoveredSubControl, this);
-
3322 }
never executed: }
0
3323#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) -
3324 if (qobject_cast<QMacStyle *>(style()) && !hoverRegion.isEmpty()) -
3325 hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options)); -
3326#endif -
3327 if (!hoverRegion.isEmpty())
partially evaluated: !hoverRegion.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
3328 update(hoverRegion);
never executed: update(hoverRegion);
0
3329 }
executed: }
Execution Count:7
7
3330 -
3331 if ((mouseEvent->buttons() & Qt::LeftButton) || d->isInInteractiveMode) {
evaluated: (mouseEvent->buttons() & Qt::LeftButton)
TRUEFALSE
yes
Evaluation Count:351
yes
Evaluation Count:7
partially evaluated: d->isInInteractiveMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-351
3332 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
3333 d->setNewGeometry(mapToParent(mouseEvent->pos()));
executed: d->setNewGeometry(mapToParent(mouseEvent->pos()));
Execution Count:351
351
3334 return;
executed: return;
Execution Count:351
351
3335 } -
3336 -
3337 // Do not resize/move if not allowed. -
3338 d->currentOperation = d->getOperation(mouseEvent->pos());
executed (the execution status of this line is deduced): d->currentOperation = d->getOperation(mouseEvent->pos());
-
3339 if ((d->isResizeOperation() && !d->resizeEnabled) || (d->isMoveOperation() && !d->moveEnabled))
evaluated: d->isResizeOperation()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:4
partially evaluated: !d->resizeEnabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
evaluated: d->isMoveOperation()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:4
partially evaluated: !d->moveEnabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-4
3340 d->currentOperation = QMdiSubWindowPrivate::None;
never executed: d->currentOperation = QMdiSubWindowPrivate::None;
0
3341 d->updateCursor();
executed (the execution status of this line is deduced): d->updateCursor();
-
3342}
executed: }
Execution Count:7
7
3343 -
3344/*! -
3345 \reimp -
3346*/ -
3347void QMdiSubWindow::keyPressEvent(QKeyEvent *keyEvent) -
3348{ -
3349 Q_D(QMdiSubWindow);
never executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3350 if (!d->isInInteractiveMode || !parent()) {
never evaluated: !d->isInInteractiveMode
never evaluated: !parent()
0
3351 keyEvent->ignore();
never executed (the execution status of this line is deduced): keyEvent->ignore();
-
3352 return;
never executed: return;
0
3353 } -
3354 -
3355 QPoint delta;
never executed (the execution status of this line is deduced): QPoint delta;
-
3356 switch (keyEvent->key()) { -
3357 case Qt::Key_Right: -
3358 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3359 delta = QPoint(d->keyboardPageStep, 0);
never executed: delta = QPoint(d->keyboardPageStep, 0);
0
3360 else -
3361 delta = QPoint(d->keyboardSingleStep, 0);
never executed: delta = QPoint(d->keyboardSingleStep, 0);
0
3362 break;
never executed: break;
0
3363 case Qt::Key_Up: -
3364 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3365 delta = QPoint(0, -d->keyboardPageStep);
never executed: delta = QPoint(0, -d->keyboardPageStep);
0
3366 else -
3367 delta = QPoint(0, -d->keyboardSingleStep);
never executed: delta = QPoint(0, -d->keyboardSingleStep);
0
3368 break;
never executed: break;
0
3369 case Qt::Key_Left: -
3370 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3371 delta = QPoint(-d->keyboardPageStep, 0);
never executed: delta = QPoint(-d->keyboardPageStep, 0);
0
3372 else -
3373 delta = QPoint(-d->keyboardSingleStep, 0);
never executed: delta = QPoint(-d->keyboardSingleStep, 0);
0
3374 break;
never executed: break;
0
3375 case Qt::Key_Down: -
3376 if (keyEvent->modifiers() & Qt::ShiftModifier)
never evaluated: keyEvent->modifiers() & Qt::ShiftModifier
0
3377 delta = QPoint(0, d->keyboardPageStep);
never executed: delta = QPoint(0, d->keyboardPageStep);
0
3378 else -
3379 delta = QPoint(0, d->keyboardSingleStep);
never executed: delta = QPoint(0, d->keyboardSingleStep);
0
3380 break;
never executed: break;
0
3381 case Qt::Key_Escape: -
3382 case Qt::Key_Return: -
3383 case Qt::Key_Enter: -
3384 d->leaveInteractiveMode();
never executed (the execution status of this line is deduced): d->leaveInteractiveMode();
-
3385 return;
never executed: return;
0
3386 default: -
3387 keyEvent->ignore();
never executed (the execution status of this line is deduced): keyEvent->ignore();
-
3388 return;
never executed: return;
0
3389 } -
3390 -
3391#ifndef QT_NO_CURSOR -
3392 QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta);
never executed (the execution status of this line is deduced): QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta);
-
3393 QRect oldGeometry =
never executed (the execution status of this line is deduced): QRect oldGeometry =
-
3394#ifndef QT_NO_RUBBERBAND
never executed (the execution status of this line is deduced):
-
3395 d->isInRubberBandMode ? d->rubberBand->geometry() :
never evaluated: d->isInRubberBandMode
0
3396#endif
never executed (the execution status of this line is deduced):
-
3397 geometry();
never executed (the execution status of this line is deduced): geometry();
-
3398 d->setNewGeometry(newPosition);
never executed (the execution status of this line is deduced): d->setNewGeometry(newPosition);
-
3399 QRect currentGeometry =
never executed (the execution status of this line is deduced): QRect currentGeometry =
-
3400#ifndef QT_NO_RUBBERBAND
never executed (the execution status of this line is deduced):
-
3401 d->isInRubberBandMode ? d->rubberBand->geometry() :
never evaluated: d->isInRubberBandMode
0
3402#endif
never executed (the execution status of this line is deduced):
-
3403 geometry();
never executed (the execution status of this line is deduced): geometry();
-
3404 if (currentGeometry == oldGeometry)
never evaluated: currentGeometry == oldGeometry
0
3405 return;
never executed: return;
0
3406 -
3407 // Update cursor position -
3408 -
3409 QPoint actualDelta;
never executed (the execution status of this line is deduced): QPoint actualDelta;
-
3410 if (d->isMoveOperation()) {
never evaluated: d->isMoveOperation()
0
3411 actualDelta = QPoint(currentGeometry.x() - oldGeometry.x(),
never executed (the execution status of this line is deduced): actualDelta = QPoint(currentGeometry.x() - oldGeometry.x(),
-
3412 currentGeometry.y() - oldGeometry.y());
never executed (the execution status of this line is deduced): currentGeometry.y() - oldGeometry.y());
-
3413 } else {
never executed: }
0
3414 int dx = isLeftToRight() ? currentGeometry.width() - oldGeometry.width()
never evaluated: isLeftToRight()
0
3415 : currentGeometry.x() - oldGeometry.x();
never executed (the execution status of this line is deduced): : currentGeometry.x() - oldGeometry.x();
-
3416 actualDelta = QPoint(dx, currentGeometry.height() - oldGeometry.height());
never executed (the execution status of this line is deduced): actualDelta = QPoint(dx, currentGeometry.height() - oldGeometry.height());
-
3417 }
never executed: }
0
3418 -
3419 // Adjust in case we weren't able to move as long as wanted. -
3420 if (actualDelta != delta)
never evaluated: actualDelta != delta
0
3421 newPosition += (actualDelta - delta);
never executed: newPosition += (actualDelta - delta);
0
3422 cursor().setPos(parentWidget()->mapToGlobal(newPosition));
never executed (the execution status of this line is deduced): cursor().setPos(parentWidget()->mapToGlobal(newPosition));
-
3423#endif -
3424}
never executed: }
0
3425 -
3426#ifndef QT_NO_CONTEXTMENU -
3427/*! -
3428 \reimp -
3429*/ -
3430void QMdiSubWindow::contextMenuEvent(QContextMenuEvent *contextMenuEvent) -
3431{ -
3432 Q_D(QMdiSubWindow);
never executed (the execution status of this line is deduced): QMdiSubWindowPrivate * const d = d_func();
-
3433 if (!d->systemMenu) {
never evaluated: !d->systemMenu
0
3434 contextMenuEvent->ignore();
never executed (the execution status of this line is deduced): contextMenuEvent->ignore();
-
3435 return;
never executed: return;
0
3436 } -
3437 -
3438 if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
never evaluated: d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
0
3439 || d->getRegion(QMdiSubWindowPrivate::Move).contains(contextMenuEvent->pos())) {
never evaluated: d->getRegion(QMdiSubWindowPrivate::Move).contains(contextMenuEvent->pos())
0
3440 d->systemMenu->exec(contextMenuEvent->globalPos());
never executed (the execution status of this line is deduced): d->systemMenu->exec(contextMenuEvent->globalPos());
-
3441 } else {
never executed: }
0
3442 contextMenuEvent->ignore();
never executed (the execution status of this line is deduced): contextMenuEvent->ignore();
-
3443 }
never executed: }
0
3444} -
3445#endif // QT_NO_CONTEXTMENU -
3446 -
3447/*! -
3448 \reimp -
3449*/ -
3450void QMdiSubWindow::focusInEvent(QFocusEvent *focusInEvent) -
3451{ -
3452 d_func()->focusInReason = focusInEvent->reason();
executed (the execution status of this line is deduced): d_func()->focusInReason = focusInEvent->reason();
-
3453}
executed: }
Execution Count:130
130
3454 -
3455/*! -
3456 \reimp -
3457*/ -
3458void QMdiSubWindow::focusOutEvent(QFocusEvent * /*focusOutEvent*/) -
3459{ -
3460 // To avoid update() in QWidget::focusOutEvent. -
3461} -
3462 -
3463/*! -
3464 \reimp -
3465*/ -
3466void QMdiSubWindow::childEvent(QChildEvent *childEvent) -
3467{ -
3468 if (childEvent->type() != QEvent::ChildPolished)
evaluated: childEvent->type() != QEvent::ChildPolished
TRUEFALSE
yes
Evaluation Count:520
yes
Evaluation Count:238
238-520
3469 return;
executed: return;
Execution Count:520
520
3470#ifndef QT_NO_SIZEGRIP -
3471 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:238
0-238
3472 d_func()->setSizeGrip(sizeGrip);
never executed: d_func()->setSizeGrip(sizeGrip);
0
3473#endif -
3474}
executed: }
Execution Count:238
238
3475 -
3476/*! -
3477 \reimp -
3478*/ -
3479QSize QMdiSubWindow::sizeHint() const -
3480{ -
3481 Q_D(const QMdiSubWindow);
executed (the execution status of this line is deduced): const QMdiSubWindowPrivate * const d = d_func();
-
3482 int margin, minWidth;
executed (the execution status of this line is deduced): int margin, minWidth;
-
3483 d->sizeParameters(&margin, &minWidth);
executed (the execution status of this line is deduced): d->sizeParameters(&margin, &minWidth);
-
3484 QSize size(2 * margin, d->titleBarHeight() + margin);
executed (the execution status of this line is deduced): QSize size(2 * margin, d->titleBarHeight() + margin);
-
3485 if (d->baseWidget && d->baseWidget->sizeHint().isValid())
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:340
yes
Evaluation Count:7
evaluated: d->baseWidget->sizeHint().isValid()
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:256
7-340
3486 size += d->baseWidget->sizeHint();
executed: size += d->baseWidget->sizeHint();
Execution Count:84
84
3487 return size.expandedTo(minimumSizeHint());
executed: return size.expandedTo(minimumSizeHint());
Execution Count:347
347
3488} -
3489 -
3490/*! -
3491 \reimp -
3492*/ -
3493QSize QMdiSubWindow::minimumSizeHint() const -
3494{ -
3495 Q_D(const QMdiSubWindow);
executed (the execution status of this line is deduced): const QMdiSubWindowPrivate * const d = d_func();
-
3496 if (isVisible())
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:249
yes
Evaluation Count:885
249-885
3497 ensurePolished();
executed: ensurePolished();
Execution Count:249
249
3498 -
3499 // Minimized window. -
3500 if (parent() && isMinimized() && !isShaded())
evaluated: parent()
TRUEFALSE
yes
Evaluation Count:1123
yes
Evaluation Count:11
evaluated: isMinimized()
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:1079
evaluated: !isShaded()
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:10
10-1123
3501 return d->iconSize();
executed: return d->iconSize();
Execution Count:34
34
3502 -
3503 // Calculate window decoration. -
3504 int margin, minWidth;
executed (the execution status of this line is deduced): int margin, minWidth;
-
3505 d->sizeParameters(&margin, &minWidth);
executed (the execution status of this line is deduced): d->sizeParameters(&margin, &minWidth);
-
3506 int decorationHeight = margin + d->titleBarHeight();
executed (the execution status of this line is deduced): int decorationHeight = margin + d->titleBarHeight();
-
3507 int minHeight = decorationHeight;
executed (the execution status of this line is deduced): int minHeight = decorationHeight;
-
3508 -
3509 // Shaded window. -
3510 if (parent() && isShaded())
evaluated: parent()
TRUEFALSE
yes
Evaluation Count:1089
yes
Evaluation Count:11
evaluated: isShaded()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1079
10-1089
3511 return QSize(qMax(minWidth, width()), d->titleBarHeight());
executed: return QSize(qMax(minWidth, width()), d->titleBarHeight());
Execution Count:10
10
3512 -
3513 // Content -
3514 if (layout()) {
evaluated: layout()
TRUEFALSE
yes
Evaluation Count:980
yes
Evaluation Count:110
110-980
3515 QSize minLayoutSize = layout()->minimumSize();
executed (the execution status of this line is deduced): QSize minLayoutSize = layout()->minimumSize();
-
3516 if (minLayoutSize.isValid()) {
partially evaluated: minLayoutSize.isValid()
TRUEFALSE
yes
Evaluation Count:980
no
Evaluation Count:0
0-980
3517 minWidth = qMax(minWidth, minLayoutSize.width() + 2 * margin);
executed (the execution status of this line is deduced): minWidth = qMax(minWidth, minLayoutSize.width() + 2 * margin);
-
3518 minHeight += minLayoutSize.height();
executed (the execution status of this line is deduced): minHeight += minLayoutSize.height();
-
3519 }
executed: }
Execution Count:980
980
3520 } else if (d->baseWidget && d->baseWidget->isVisible()) {
executed: }
Execution Count:980
evaluated: d->baseWidget
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:108
evaluated: d->baseWidget->isVisible()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1-980
3521 QSize minBaseWidgetSize = d->baseWidget->minimumSizeHint();
executed (the execution status of this line is deduced): QSize minBaseWidgetSize = d->baseWidget->minimumSizeHint();
-
3522 if (minBaseWidgetSize.isValid()) {
partially evaluated: minBaseWidgetSize.isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
3523 minWidth = qMax(minWidth, minBaseWidgetSize.width() + 2 * margin);
never executed (the execution status of this line is deduced): minWidth = qMax(minWidth, minBaseWidgetSize.width() + 2 * margin);
-
3524 minHeight += minBaseWidgetSize.height();
never executed (the execution status of this line is deduced): minHeight += minBaseWidgetSize.height();
-
3525 }
never executed: }
0
3526 }
executed: }
Execution Count:1
1
3527 -
3528#ifndef QT_NO_SIZEGRIP -
3529 // SizeGrip -
3530 int sizeGripHeight = 0;
executed (the execution status of this line is deduced): int sizeGripHeight = 0;
-
3531 if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
partially evaluated: d->sizeGrip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1090
never evaluated: d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this))
0-1090
3532 sizeGripHeight = d->sizeGrip->height();
never executed: sizeGripHeight = d->sizeGrip->height();
0
3533#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) -
3534 else if (parent() && qobject_cast<QMacStyle *>(style()) && !d->sizeGrip) -
3535 sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this); -
3536#endif -
3537 minHeight = qMax(minHeight, decorationHeight + sizeGripHeight);
executed (the execution status of this line is deduced): minHeight = qMax(minHeight, decorationHeight + sizeGripHeight);
-
3538#endif -
3539 -
3540 return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut());
executed: return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut());
Execution Count:1090
1090
3541} -
3542 -
3543QT_END_NAMESPACE -
3544 -
3545#include "moc_qmdisubwindow.cpp" -
3546#include "qmdisubwindow.moc" -
3547 -
3548#endif //QT_NO_MDIAREA -
3549 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial