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