Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qmdisubwindow.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 Qt::WindowFlags CustomizeWindowFlags = | - | ||||||||||||||||||||||||
27 | Qt::FramelessWindowHint | - | ||||||||||||||||||||||||
28 | | Qt::CustomizeWindowHint | - | ||||||||||||||||||||||||
29 | | Qt::WindowTitleHint | - | ||||||||||||||||||||||||
30 | | Qt::WindowSystemMenuHint | - | ||||||||||||||||||||||||
31 | | Qt::WindowMinimizeButtonHint | - | ||||||||||||||||||||||||
32 | | Qt::WindowMaximizeButtonHint | - | ||||||||||||||||||||||||
33 | | Qt::WindowMinMaxButtonsHint; | - | ||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||
36 | static const int BoundaryMargin = 5; | - | ||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||
38 | static inline int getMoveDeltaComponent(uint cflags, uint moveFlag, uint resizeFlag, | - | ||||||||||||||||||||||||
39 | int delta, int maxDelta, int minDelta) | - | ||||||||||||||||||||||||
40 | { | - | ||||||||||||||||||||||||
41 | if (cflags & moveFlag
| 0 | ||||||||||||||||||||||||
42 | if (delta > 0
| 0 | ||||||||||||||||||||||||
43 | return never executed: (return (cflags & resizeFlag) ? qMin(delta, maxDelta) : delta;
never executed: return (cflags & resizeFlag) ? qMin(delta, maxDelta) : delta; | 0 | ||||||||||||||||||||||||
44 | return never executed: (return (cflags & resizeFlag) ? qMax(delta, minDelta) : delta;
never executed: return (cflags & resizeFlag) ? qMax(delta, minDelta) : delta; | 0 | ||||||||||||||||||||||||
45 | } | - | ||||||||||||||||||||||||
46 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
47 | } | - | ||||||||||||||||||||||||
48 | - | |||||||||||||||||||||||||
49 | static inline int getResizeDeltaComponent(uint cflags, uint resizeFlag, | - | ||||||||||||||||||||||||
50 | uint resizeReverseFlag, int delta) | - | ||||||||||||||||||||||||
51 | { | - | ||||||||||||||||||||||||
52 | if (cflags & resizeFlag
| 0 | ||||||||||||||||||||||||
53 | if (cflags & resizeReverseFlag
| 0 | ||||||||||||||||||||||||
54 | return never executed: -delta;return -delta; never executed: return -delta; | 0 | ||||||||||||||||||||||||
55 | return never executed: delta;return delta; never executed: return delta; | 0 | ||||||||||||||||||||||||
56 | } | - | ||||||||||||||||||||||||
57 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
58 | } | - | ||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||
60 | static inline bool isChildOfQMdiSubWindow(const QWidget *child) | - | ||||||||||||||||||||||||
61 | { | - | ||||||||||||||||||||||||
62 | ((!(child)) ? qt_assert("child",__FILE__,215) : qt_noop()); | - | ||||||||||||||||||||||||
63 | QWidget *parent = child->parentWidget(); | - | ||||||||||||||||||||||||
64 | while (parent
| 0 | ||||||||||||||||||||||||
65 | if (qobject_cast<QMdiSubWindow *>(parent)
| 0 | ||||||||||||||||||||||||
66 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
67 | parent = parent->parentWidget(); | - | ||||||||||||||||||||||||
68 | } never executed: end of block | 0 | ||||||||||||||||||||||||
69 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
70 | } | - | ||||||||||||||||||||||||
71 | - | |||||||||||||||||||||||||
72 | static inline bool isChildOfTabbedQMdiArea(const QMdiSubWindow *child) | - | ||||||||||||||||||||||||
73 | { | - | ||||||||||||||||||||||||
74 | ((!(child)) ? qt_assert("child",__FILE__,227) : qt_noop()); | - | ||||||||||||||||||||||||
75 | if (QMdiArea *mdiArea = child->mdiArea()
| 0 | ||||||||||||||||||||||||
76 | if (mdiArea->viewMode() == QMdiArea::TabbedView
| 0 | ||||||||||||||||||||||||
77 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
78 | } never executed: end of block | 0 | ||||||||||||||||||||||||
79 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
80 | } | - | ||||||||||||||||||||||||
81 | - | |||||||||||||||||||||||||
82 | template<typename T> | - | ||||||||||||||||||||||||
83 | static inline ControlElement<T> *ptr(QWidget *widget) | - | ||||||||||||||||||||||||
84 | { | - | ||||||||||||||||||||||||
85 | if (widget
| 0 | ||||||||||||||||||||||||
86 | && strcmp(widget->metaObject()->className(), T::staticMetaObject.className()) == 0
| 0 | ||||||||||||||||||||||||
87 | return never executed: static_cast<ControlElement<T> *>(widget);return static_cast<ControlElement<T> *>(widget); never executed: return static_cast<ControlElement<T> *>(widget); | 0 | ||||||||||||||||||||||||
88 | } | - | ||||||||||||||||||||||||
89 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
90 | } | - | ||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||
92 | QString QMdiSubWindowPrivate::originalWindowTitle() | - | ||||||||||||||||||||||||
93 | { | - | ||||||||||||||||||||||||
94 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
95 | if (originalTitle.isNull()
| 0 | ||||||||||||||||||||||||
96 | originalTitle = q->window()->windowTitle(); | - | ||||||||||||||||||||||||
97 | if (originalTitle.isNull()
| 0 | ||||||||||||||||||||||||
98 | originalTitle = QLatin1String(""); never executed: originalTitle = QLatin1String(""); | 0 | ||||||||||||||||||||||||
99 | } never executed: end of block | 0 | ||||||||||||||||||||||||
100 | return never executed: originalTitle;return originalTitle; never executed: return originalTitle; | 0 | ||||||||||||||||||||||||
101 | } | - | ||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | void QMdiSubWindowPrivate::setNewWindowTitle() | - | ||||||||||||||||||||||||
104 | { | - | ||||||||||||||||||||||||
105 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
106 | QString childTitle = q->windowTitle(); | - | ||||||||||||||||||||||||
107 | if (childTitle.isEmpty()
| 0 | ||||||||||||||||||||||||
108 | return; never executed: return; | 0 | ||||||||||||||||||||||||
109 | QString original = originalWindowTitle(); | - | ||||||||||||||||||||||||
110 | if (!original.isEmpty()
| 0 | ||||||||||||||||||||||||
111 | if (!original.contains(QMdiSubWindow::tr("- [%1]").arg(childTitle))
| 0 | ||||||||||||||||||||||||
112 | q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle)); never executed: q->window()->setWindowTitle(QMdiSubWindow::tr("%1 - [%2]").arg(original, childTitle)); | 0 | ||||||||||||||||||||||||
113 | - | |||||||||||||||||||||||||
114 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
115 | q->window()->setWindowTitle(childTitle); | - | ||||||||||||||||||||||||
116 | } never executed: end of block | 0 | ||||||||||||||||||||||||
117 | } | - | ||||||||||||||||||||||||
118 | - | |||||||||||||||||||||||||
119 | static inline bool isHoverControl(QStyle::SubControl control) | - | ||||||||||||||||||||||||
120 | { | - | ||||||||||||||||||||||||
121 | return never executed: control != QStyle::SC_Nonereturn control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel;
never executed: return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel; | 0 | ||||||||||||||||||||||||
122 | } | - | ||||||||||||||||||||||||
123 | static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOptionComplex &opt, | - | ||||||||||||||||||||||||
124 | QStyle::ComplexControl complexControl, QStyle::SubControl subControl) | - | ||||||||||||||||||||||||
125 | { | - | ||||||||||||||||||||||||
126 | ((!(helpEvent)) ? qt_assert("helpEvent",__FILE__,288) : qt_noop()); | - | ||||||||||||||||||||||||
127 | ((!(helpEvent->type() == QEvent::ToolTip)) ? qt_assert("helpEvent->type() == QEvent::ToolTip",__FILE__,289) : qt_noop()); | - | ||||||||||||||||||||||||
128 | ((!(widget)) ? qt_assert("widget",__FILE__,290) : qt_noop()); | - | ||||||||||||||||||||||||
129 | if (complexControl == QStyle::CC_MdiControls
| 0 | ||||||||||||||||||||||||
130 | if (subControl == QStyle::SC_MdiMinButton
| 0 | ||||||||||||||||||||||||
131 | subControl = QStyle::SC_TitleBarMinButton; never executed: subControl = QStyle::SC_TitleBarMinButton; | 0 | ||||||||||||||||||||||||
132 | else if (subControl == QStyle::SC_MdiCloseButton
| 0 | ||||||||||||||||||||||||
133 | subControl = QStyle::SC_TitleBarCloseButton; never executed: subControl = QStyle::SC_TitleBarCloseButton; | 0 | ||||||||||||||||||||||||
134 | else if (subControl == QStyle::SC_MdiNormalButton
| 0 | ||||||||||||||||||||||||
135 | subControl = QStyle::SC_TitleBarNormalButton; never executed: subControl = QStyle::SC_TitleBarNormalButton; | 0 | ||||||||||||||||||||||||
136 | else | - | ||||||||||||||||||||||||
137 | subControl = QStyle::SC_None; never executed: subControl = QStyle::SC_None; | 0 | ||||||||||||||||||||||||
138 | } | - | ||||||||||||||||||||||||
139 | - | |||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||
141 | if (subControl == QStyle::SC_None
| 0 | ||||||||||||||||||||||||
142 | return; never executed: return; | 0 | ||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||
144 | QString toolTip; | - | ||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||
146 | switch (subControl) { | - | ||||||||||||||||||||||||
147 | case never executed: QStyle::SC_TitleBarMinButton:case QStyle::SC_TitleBarMinButton: never executed: case QStyle::SC_TitleBarMinButton: | 0 | ||||||||||||||||||||||||
148 | toolTip = QMdiSubWindow::tr("Minimize"); | - | ||||||||||||||||||||||||
149 | break; never executed: break; | 0 | ||||||||||||||||||||||||
150 | case never executed: QStyle::SC_TitleBarMaxButton:case QStyle::SC_TitleBarMaxButton: never executed: case QStyle::SC_TitleBarMaxButton: | 0 | ||||||||||||||||||||||||
151 | toolTip = QMdiSubWindow::tr("Maximize"); | - | ||||||||||||||||||||||||
152 | break; never executed: break; | 0 | ||||||||||||||||||||||||
153 | case never executed: QStyle::SC_TitleBarUnshadeButton:case QStyle::SC_TitleBarUnshadeButton: never executed: case QStyle::SC_TitleBarUnshadeButton: | 0 | ||||||||||||||||||||||||
154 | toolTip = QMdiSubWindow::tr("Unshade"); | - | ||||||||||||||||||||||||
155 | break; never executed: break; | 0 | ||||||||||||||||||||||||
156 | case never executed: QStyle::SC_TitleBarShadeButton:case QStyle::SC_TitleBarShadeButton: never executed: case QStyle::SC_TitleBarShadeButton: | 0 | ||||||||||||||||||||||||
157 | toolTip = QMdiSubWindow::tr("Shade"); | - | ||||||||||||||||||||||||
158 | break; never executed: break; | 0 | ||||||||||||||||||||||||
159 | case never executed: QStyle::SC_TitleBarNormalButton:case QStyle::SC_TitleBarNormalButton: never executed: case QStyle::SC_TitleBarNormalButton: | 0 | ||||||||||||||||||||||||
160 | if (widget->isMaximized()
| 0 | ||||||||||||||||||||||||
161 | toolTip = QMdiSubWindow::tr("Restore Down"); never executed: toolTip = QMdiSubWindow::tr("Restore Down"); | 0 | ||||||||||||||||||||||||
162 | else | - | ||||||||||||||||||||||||
163 | toolTip = QMdiSubWindow::tr("Restore"); never executed: toolTip = QMdiSubWindow::tr("Restore"); | 0 | ||||||||||||||||||||||||
164 | break; never executed: break; | 0 | ||||||||||||||||||||||||
165 | case never executed: QStyle::SC_TitleBarCloseButton:case QStyle::SC_TitleBarCloseButton: never executed: case QStyle::SC_TitleBarCloseButton: | 0 | ||||||||||||||||||||||||
166 | toolTip = QMdiSubWindow::tr("Close"); | - | ||||||||||||||||||||||||
167 | break; never executed: break; | 0 | ||||||||||||||||||||||||
168 | case never executed: QStyle::SC_TitleBarContextHelpButton:case QStyle::SC_TitleBarContextHelpButton: never executed: case QStyle::SC_TitleBarContextHelpButton: | 0 | ||||||||||||||||||||||||
169 | toolTip = QMdiSubWindow::tr("Help"); | - | ||||||||||||||||||||||||
170 | break; never executed: break; | 0 | ||||||||||||||||||||||||
171 | case never executed: QStyle::SC_TitleBarSysMenu:case QStyle::SC_TitleBarSysMenu: never executed: case QStyle::SC_TitleBarSysMenu: | 0 | ||||||||||||||||||||||||
172 | toolTip = QMdiSubWindow::tr("Menu"); | - | ||||||||||||||||||||||||
173 | break; never executed: break; | 0 | ||||||||||||||||||||||||
174 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
175 | break; never executed: break; | 0 | ||||||||||||||||||||||||
176 | } | - | ||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||
178 | const QRect rect = widget->style()->subControlRect(complexControl, &opt, subControl, widget); | - | ||||||||||||||||||||||||
179 | QToolTip::showText(helpEvent->globalPos(), toolTip, widget, rect); | - | ||||||||||||||||||||||||
180 | } never executed: end of block | 0 | ||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||
182 | - | |||||||||||||||||||||||||
183 | namespace QMdi { | - | ||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||
185 | - | |||||||||||||||||||||||||
186 | - | |||||||||||||||||||||||||
187 | - | |||||||||||||||||||||||||
188 | class ControlLabel : public QWidget | - | ||||||||||||||||||||||||
189 | { | - | ||||||||||||||||||||||||
190 | public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } | - | ||||||||||||||||||||||||
191 | #pragma GCC diagnostic push | - | ||||||||||||||||||||||||
192 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||||||||||||||
193 | #pragma GCC diagnostic pop | - | ||||||||||||||||||||||||
194 | struct QPrivateSignal {}; | - | ||||||||||||||||||||||||
195 | public: | - | ||||||||||||||||||||||||
196 | ControlLabel(QMdiSubWindow *subWindow, QWidget *parent = 0); | - | ||||||||||||||||||||||||
197 | - | |||||||||||||||||||||||||
198 | QSize sizeHint() const override; | - | ||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||
200 | public : | - | ||||||||||||||||||||||||
201 | void _q_clicked(); | - | ||||||||||||||||||||||||
202 | void _q_doubleClicked(); | - | ||||||||||||||||||||||||
203 | - | |||||||||||||||||||||||||
204 | protected: | - | ||||||||||||||||||||||||
205 | bool event(QEvent *event) override; | - | ||||||||||||||||||||||||
206 | void paintEvent(QPaintEvent *paintEvent) override; | - | ||||||||||||||||||||||||
207 | void mousePressEvent(QMouseEvent *mouseEvent) override; | - | ||||||||||||||||||||||||
208 | void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override; | - | ||||||||||||||||||||||||
209 | void mouseReleaseEvent(QMouseEvent *mouseEvent) override; | - | ||||||||||||||||||||||||
210 | - | |||||||||||||||||||||||||
211 | private: | - | ||||||||||||||||||||||||
212 | QPixmap label; | - | ||||||||||||||||||||||||
213 | bool isPressed; | - | ||||||||||||||||||||||||
214 | void updateWindowIcon(); | - | ||||||||||||||||||||||||
215 | }; | - | ||||||||||||||||||||||||
216 | } | - | ||||||||||||||||||||||||
217 | - | |||||||||||||||||||||||||
218 | ControlLabel::ControlLabel(QMdiSubWindow *subWindow, QWidget *parent) | - | ||||||||||||||||||||||||
219 | : QWidget(parent), isPressed(false) | - | ||||||||||||||||||||||||
220 | { | - | ||||||||||||||||||||||||
221 | (void)subWindow;; | - | ||||||||||||||||||||||||
222 | setFocusPolicy(Qt::NoFocus); | - | ||||||||||||||||||||||||
223 | updateWindowIcon(); | - | ||||||||||||||||||||||||
224 | setFixedSize(label.size()); | - | ||||||||||||||||||||||||
225 | } never executed: end of block | 0 | ||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | - | |||||||||||||||||||||||||
229 | - | |||||||||||||||||||||||||
230 | QSize ControlLabel::sizeHint() const | - | ||||||||||||||||||||||||
231 | { | - | ||||||||||||||||||||||||
232 | return never executed: label.size();return label.size(); never executed: return label.size(); | 0 | ||||||||||||||||||||||||
233 | } | - | ||||||||||||||||||||||||
234 | - | |||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||
236 | - | |||||||||||||||||||||||||
237 | - | |||||||||||||||||||||||||
238 | bool ControlLabel::event(QEvent *event) | - | ||||||||||||||||||||||||
239 | { | - | ||||||||||||||||||||||||
240 | if (event->type() == QEvent::WindowIconChange
| 0 | ||||||||||||||||||||||||
241 | updateWindowIcon(); never executed: updateWindowIcon(); | 0 | ||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||
243 | else if (event->type() == QEvent::ToolTip
| 0 | ||||||||||||||||||||||||
244 | QStyleOptionTitleBar options; | - | ||||||||||||||||||||||||
245 | options.initFrom(this); | - | ||||||||||||||||||||||||
246 | showToolTip(static_cast<QHelpEvent *>(event), this, options, | - | ||||||||||||||||||||||||
247 | QStyle::CC_TitleBar, QStyle::SC_TitleBarSysMenu); | - | ||||||||||||||||||||||||
248 | } never executed: end of block | 0 | ||||||||||||||||||||||||
249 | - | |||||||||||||||||||||||||
250 | return never executed: QWidget::event(event);return QWidget::event(event); never executed: return QWidget::event(event); | 0 | ||||||||||||||||||||||||
251 | } | - | ||||||||||||||||||||||||
252 | - | |||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||
256 | void ControlLabel::paintEvent(QPaintEvent * ) | - | ||||||||||||||||||||||||
257 | { | - | ||||||||||||||||||||||||
258 | QPainter painter(this); | - | ||||||||||||||||||||||||
259 | painter.drawPixmap(0, 0, label); | - | ||||||||||||||||||||||||
260 | } never executed: end of block | 0 | ||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | - | |||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||
265 | void ControlLabel::mousePressEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
266 | { | - | ||||||||||||||||||||||||
267 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
268 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
269 | return; never executed: return; | 0 | ||||||||||||||||||||||||
270 | } | - | ||||||||||||||||||||||||
271 | isPressed = true; | - | ||||||||||||||||||||||||
272 | } never executed: end of block | 0 | ||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||
275 | - | |||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||
277 | void ControlLabel::mouseDoubleClickEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
278 | { | - | ||||||||||||||||||||||||
279 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
280 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
281 | return; never executed: return; | 0 | ||||||||||||||||||||||||
282 | } | - | ||||||||||||||||||||||||
283 | isPressed = false; | - | ||||||||||||||||||||||||
284 | _q_doubleClicked(); | - | ||||||||||||||||||||||||
285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | - | |||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||
290 | void ControlLabel::mouseReleaseEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
291 | { | - | ||||||||||||||||||||||||
292 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
293 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
294 | return; never executed: return; | 0 | ||||||||||||||||||||||||
295 | } | - | ||||||||||||||||||||||||
296 | if (isPressed
| 0 | ||||||||||||||||||||||||
297 | isPressed = false; | - | ||||||||||||||||||||||||
298 | _q_clicked(); | - | ||||||||||||||||||||||||
299 | } never executed: end of block | 0 | ||||||||||||||||||||||||
300 | } never executed: end of block | 0 | ||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | - | |||||||||||||||||||||||||
303 | - | |||||||||||||||||||||||||
304 | - | |||||||||||||||||||||||||
305 | void ControlLabel::updateWindowIcon() | - | ||||||||||||||||||||||||
306 | { | - | ||||||||||||||||||||||||
307 | QIcon menuIcon = windowIcon(); | - | ||||||||||||||||||||||||
308 | if (menuIcon.isNull()
| 0 | ||||||||||||||||||||||||
309 | menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget()); never executed: menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget()); | 0 | ||||||||||||||||||||||||
310 | label = menuIcon.pixmap(16, 16); | - | ||||||||||||||||||||||||
311 | update(); | - | ||||||||||||||||||||||||
312 | } never executed: end of block | 0 | ||||||||||||||||||||||||
313 | - | |||||||||||||||||||||||||
314 | namespace QMdi { | - | ||||||||||||||||||||||||
315 | - | |||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||
317 | - | |||||||||||||||||||||||||
318 | - | |||||||||||||||||||||||||
319 | class ControllerWidget : public QWidget | - | ||||||||||||||||||||||||
320 | { | - | ||||||||||||||||||||||||
321 | public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } | - | ||||||||||||||||||||||||
322 | #pragma GCC diagnostic push | - | ||||||||||||||||||||||||
323 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||||||||||||||
324 | #pragma GCC diagnostic pop | - | ||||||||||||||||||||||||
325 | struct QPrivateSignal {}; | - | ||||||||||||||||||||||||
326 | public: | - | ||||||||||||||||||||||||
327 | ControllerWidget(QMdiSubWindow *subWindow, QWidget *parent = 0); | - | ||||||||||||||||||||||||
328 | QSize sizeHint() const override; | - | ||||||||||||||||||||||||
329 | void setControlVisible(QMdiSubWindowPrivate::WindowStateAction action, bool visible); | - | ||||||||||||||||||||||||
330 | inline bool hasVisibleControls() const | - | ||||||||||||||||||||||||
331 | { | - | ||||||||||||||||||||||||
332 | return never executed: (return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton);
never executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton); | 0 | ||||||||||||||||||||||||
333 | || (
never executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton); | 0 | ||||||||||||||||||||||||
334 | || (
never executed: return (visibleControls & QStyle::SC_MdiMinButton) || (visibleControls & QStyle::SC_MdiNormalButton) || (visibleControls & QStyle::SC_MdiCloseButton); | 0 | ||||||||||||||||||||||||
335 | } | - | ||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||
337 | public : | - | ||||||||||||||||||||||||
338 | void _q_minimize(); | - | ||||||||||||||||||||||||
339 | void _q_restore(); | - | ||||||||||||||||||||||||
340 | void _q_close(); | - | ||||||||||||||||||||||||
341 | - | |||||||||||||||||||||||||
342 | protected: | - | ||||||||||||||||||||||||
343 | void paintEvent(QPaintEvent *event) override; | - | ||||||||||||||||||||||||
344 | void mousePressEvent(QMouseEvent *event) override; | - | ||||||||||||||||||||||||
345 | void mouseReleaseEvent(QMouseEvent *event) override; | - | ||||||||||||||||||||||||
346 | void mouseMoveEvent(QMouseEvent *event) override; | - | ||||||||||||||||||||||||
347 | void leaveEvent(QEvent *event) override; | - | ||||||||||||||||||||||||
348 | bool event(QEvent *event) override; | - | ||||||||||||||||||||||||
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 never executed: style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea);return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea); never executed: return style()->hitTestComplexControl(QStyle::CC_MdiControls, &opt, pos, mdiArea); | 0 | ||||||||||||||||||||||||
361 | } | - | ||||||||||||||||||||||||
362 | }; | - | ||||||||||||||||||||||||
363 | } | - | ||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||
367 | - | |||||||||||||||||||||||||
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()
| 0 | ||||||||||||||||||||||||
376 | mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget()); never executed: mdiArea = qobject_cast<QMdiArea *>(subWindow->parentWidget()->parentWidget()); | 0 | ||||||||||||||||||||||||
377 | setFocusPolicy(Qt::NoFocus); | - | ||||||||||||||||||||||||
378 | setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); | - | ||||||||||||||||||||||||
379 | setMouseTracking(true); | - | ||||||||||||||||||||||||
380 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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 never executed: style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea);return style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea); never executed: return style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea); | 0 | ||||||||||||||||||||||||
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
| 0 | ||||||||||||||||||||||||
400 | subControl = QStyle::SC_MdiNormalButton; never executed: subControl = QStyle::SC_MdiNormalButton; | 0 | ||||||||||||||||||||||||
401 | else if (action == QMdiSubWindowPrivate::CloseAction
| 0 | ||||||||||||||||||||||||
402 | subControl = QStyle::SC_MdiCloseButton; never executed: subControl = QStyle::SC_MdiCloseButton; | 0 | ||||||||||||||||||||||||
403 | else if (action == QMdiSubWindowPrivate::MinimizeAction
| 0 | ||||||||||||||||||||||||
404 | subControl = QStyle::SC_MdiMinButton; never executed: subControl = QStyle::SC_MdiMinButton; | 0 | ||||||||||||||||||||||||
405 | - | |||||||||||||||||||||||||
406 | if (subControl == QStyle::SC_None
| 0 | ||||||||||||||||||||||||
407 | return; never executed: return; | 0 | ||||||||||||||||||||||||
408 | - | |||||||||||||||||||||||||
409 | if (visible
| 0 | ||||||||||||||||||||||||
410 | visibleControls |= subControl; never executed: visibleControls |= subControl; | 0 | ||||||||||||||||||||||||
411 | else if (!visible
| 0 | ||||||||||||||||||||||||
412 | visibleControls &= ~subControl; never executed: visibleControls &= ~subControl; | 0 | ||||||||||||||||||||||||
413 | } never executed: end of block | 0 | ||||||||||||||||||||||||
414 | - | |||||||||||||||||||||||||
415 | - | |||||||||||||||||||||||||
416 | - | |||||||||||||||||||||||||
417 | - | |||||||||||||||||||||||||
418 | void ControllerWidget::paintEvent(QPaintEvent * ) | - | ||||||||||||||||||||||||
419 | { | - | ||||||||||||||||||||||||
420 | QStyleOptionComplex opt; | - | ||||||||||||||||||||||||
421 | initStyleOption(&opt); | - | ||||||||||||||||||||||||
422 | if (activeControl == hoverControl
| 0 | ||||||||||||||||||||||||
423 | opt.activeSubControls = activeControl; | - | ||||||||||||||||||||||||
424 | opt.state |= QStyle::State_Sunken; | - | ||||||||||||||||||||||||
425 | } never executed: else if (hoverControl != QStyle::SC_Noneend of block
| 0 | ||||||||||||||||||||||||
426 | opt.activeSubControls = hoverControl; | - | ||||||||||||||||||||||||
427 | opt.state |= QStyle::State_MouseOver; | - | ||||||||||||||||||||||||
428 | } never executed: end of block | 0 | ||||||||||||||||||||||||
429 | QPainter painter(this); | - | ||||||||||||||||||||||||
430 | style()->drawComplexControl(QStyle::CC_MdiControls, &opt, &painter, mdiArea); | - | ||||||||||||||||||||||||
431 | } never executed: end of block | 0 | ||||||||||||||||||||||||
432 | - | |||||||||||||||||||||||||
433 | - | |||||||||||||||||||||||||
434 | - | |||||||||||||||||||||||||
435 | - | |||||||||||||||||||||||||
436 | void ControllerWidget::mousePressEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
437 | { | - | ||||||||||||||||||||||||
438 | if (event->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
439 | event->ignore(); | - | ||||||||||||||||||||||||
440 | return; never executed: return; | 0 | ||||||||||||||||||||||||
441 | } | - | ||||||||||||||||||||||||
442 | activeControl = getSubControl(event->pos()); | - | ||||||||||||||||||||||||
443 | update(); | - | ||||||||||||||||||||||||
444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
445 | - | |||||||||||||||||||||||||
446 | - | |||||||||||||||||||||||||
447 | - | |||||||||||||||||||||||||
448 | - | |||||||||||||||||||||||||
449 | void ControllerWidget::mouseReleaseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
450 | { | - | ||||||||||||||||||||||||
451 | if (event->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
452 | event->ignore(); | - | ||||||||||||||||||||||||
453 | return; never executed: return; | 0 | ||||||||||||||||||||||||
454 | } | - | ||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||
456 | QStyle::SubControl under_mouse = getSubControl(event->pos()); | - | ||||||||||||||||||||||||
457 | if (under_mouse == activeControl
| 0 | ||||||||||||||||||||||||
458 | switch (activeControl) { | - | ||||||||||||||||||||||||
459 | case never executed: QStyle::SC_MdiCloseButton:case QStyle::SC_MdiCloseButton: never executed: case QStyle::SC_MdiCloseButton: | 0 | ||||||||||||||||||||||||
460 | _q_close(); | - | ||||||||||||||||||||||||
461 | break; never executed: break; | 0 | ||||||||||||||||||||||||
462 | case never executed: QStyle::SC_MdiNormalButton:case QStyle::SC_MdiNormalButton: never executed: case QStyle::SC_MdiNormalButton: | 0 | ||||||||||||||||||||||||
463 | _q_restore(); | - | ||||||||||||||||||||||||
464 | break; never executed: break; | 0 | ||||||||||||||||||||||||
465 | case never executed: QStyle::SC_MdiMinButton:case QStyle::SC_MdiMinButton: never executed: case QStyle::SC_MdiMinButton: | 0 | ||||||||||||||||||||||||
466 | _q_minimize(); | - | ||||||||||||||||||||||||
467 | break; never executed: break; | 0 | ||||||||||||||||||||||||
468 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
469 | break; never executed: break; | 0 | ||||||||||||||||||||||||
470 | } | - | ||||||||||||||||||||||||
471 | } | - | ||||||||||||||||||||||||
472 | - | |||||||||||||||||||||||||
473 | activeControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
474 | update(); | - | ||||||||||||||||||||||||
475 | } never executed: end of block | 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
| 0 | ||||||||||||||||||||||||
485 | hoverControl = under_mouse; | - | ||||||||||||||||||||||||
486 | update(); | - | ||||||||||||||||||||||||
487 | } never executed: end of block | 0 | ||||||||||||||||||||||||
488 | } never executed: end of block | 0 | ||||||||||||||||||||||||
489 | - | |||||||||||||||||||||||||
490 | - | |||||||||||||||||||||||||
491 | - | |||||||||||||||||||||||||
492 | - | |||||||||||||||||||||||||
493 | void ControllerWidget::leaveEvent(QEvent * ) | - | ||||||||||||||||||||||||
494 | { | - | ||||||||||||||||||||||||
495 | hoverControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
496 | update(); | - | ||||||||||||||||||||||||
497 | } never executed: end of block | 0 | ||||||||||||||||||||||||
498 | - | |||||||||||||||||||||||||
499 | - | |||||||||||||||||||||||||
500 | - | |||||||||||||||||||||||||
501 | - | |||||||||||||||||||||||||
502 | bool ControllerWidget::event(QEvent *event) | - | ||||||||||||||||||||||||
503 | { | - | ||||||||||||||||||||||||
504 | - | |||||||||||||||||||||||||
505 | if (event->type() == QEvent::ToolTip
| 0 | ||||||||||||||||||||||||
506 | QStyleOptionComplex opt; | - | ||||||||||||||||||||||||
507 | initStyleOption(&opt); | - | ||||||||||||||||||||||||
508 | QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event); | - | ||||||||||||||||||||||||
509 | showToolTip(helpEvent, this, opt, QStyle::CC_MdiControls, getSubControl(helpEvent->pos())); | - | ||||||||||||||||||||||||
510 | } never executed: end of block | 0 | ||||||||||||||||||||||||
511 | - | |||||||||||||||||||||||||
512 | return never executed: QWidget::event(event);return QWidget::event(event); never executed: return QWidget::event(event); | 0 | ||||||||||||||||||||||||
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 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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 | ((!(mdiChild)) ? qt_assert("mdiChild",__FILE__,700) : qt_noop()); | - | ||||||||||||||||||||||||
538 | - | |||||||||||||||||||||||||
539 | m_controllerWidget = new ControlElement<ControllerWidget>(mdiChild); | - | ||||||||||||||||||||||||
540 | connect(m_controllerWidget, qFlagLocation("2""_q_close()" "\0" __FILE__ ":" "703"), mdiChild, qFlagLocation("1""close()" "\0" __FILE__ ":" "703")); | - | ||||||||||||||||||||||||
541 | connect(m_controllerWidget, qFlagLocation("2""_q_restore()" "\0" __FILE__ ":" "704"), mdiChild, qFlagLocation("1""showNormal()" "\0" __FILE__ ":" "704")); | - | ||||||||||||||||||||||||
542 | connect(m_controllerWidget, qFlagLocation("2""_q_minimize()" "\0" __FILE__ ":" "705"), mdiChild, qFlagLocation("1""showMinimized()" "\0" __FILE__ ":" "705")); | - | ||||||||||||||||||||||||
543 | - | |||||||||||||||||||||||||
544 | m_menuLabel = new ControlElement<ControlLabel>(mdiChild); | - | ||||||||||||||||||||||||
545 | m_menuLabel->setWindowIcon(mdiChild->windowIcon()); | - | ||||||||||||||||||||||||
546 | - | |||||||||||||||||||||||||
547 | connect(m_menuLabel, qFlagLocation("2""_q_clicked()" "\0" __FILE__ ":" "710"), mdiChild, qFlagLocation("1""showSystemMenu()" "\0" __FILE__ ":" "710")); | - | ||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||
549 | connect(m_menuLabel, qFlagLocation("2""_q_doubleClicked()" "\0" __FILE__ ":" "712"), mdiChild, qFlagLocation("1""close()" "\0" __FILE__ ":" "712")); | - | ||||||||||||||||||||||||
550 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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()
| 0 | ||||||||||||||||||||||||
574 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
575 | - | |||||||||||||||||||||||||
576 | if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())
| 0 | ||||||||||||||||||||||||
577 | return never executed: mainWindow->menuBar();return mainWindow->menuBar(); never executed: return mainWindow->menuBar(); | 0 | ||||||||||||||||||||||||
578 | - | |||||||||||||||||||||||||
579 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||
581 | } | - | ||||||||||||||||||||||||
582 | - | |||||||||||||||||||||||||
583 | - | |||||||||||||||||||||||||
584 | - | |||||||||||||||||||||||||
585 | - | |||||||||||||||||||||||||
586 | void ControlContainer::showButtonsInMenuBar(QMenuBar *menuBar) | - | ||||||||||||||||||||||||
587 | { | - | ||||||||||||||||||||||||
588 | if (!menuBar
| 0 | ||||||||||||||||||||||||
589 | return; never executed: return; | 0 | ||||||||||||||||||||||||
590 | m_menuBar = menuBar; | - | ||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||
592 | if (m_menuLabel
| 0 | ||||||||||||||||||||||||
593 | QWidget *currentLeft = menuBar->cornerWidget(Qt::TopLeftCorner); | - | ||||||||||||||||||||||||
594 | if (currentLeft
| 0 | ||||||||||||||||||||||||
595 | currentLeft->hide(); never executed: currentLeft->hide(); | 0 | ||||||||||||||||||||||||
596 | if (currentLeft != m_menuLabel
| 0 | ||||||||||||||||||||||||
597 | menuBar->setCornerWidget(m_menuLabel, Qt::TopLeftCorner); | - | ||||||||||||||||||||||||
598 | previousLeft = currentLeft; | - | ||||||||||||||||||||||||
599 | } never executed: end of block | 0 | ||||||||||||||||||||||||
600 | m_menuLabel->show(); | - | ||||||||||||||||||||||||
601 | } never executed: end of block | 0 | ||||||||||||||||||||||||
602 | ControllerWidget *controllerWidget = qobject_cast<ControllerWidget *>(m_controllerWidget); | - | ||||||||||||||||||||||||
603 | if (controllerWidget
| 0 | ||||||||||||||||||||||||
604 | QWidget *currentRight = menuBar->cornerWidget(Qt::TopRightCorner); | - | ||||||||||||||||||||||||
605 | if (currentRight
| 0 | ||||||||||||||||||||||||
606 | currentRight->hide(); never executed: currentRight->hide(); | 0 | ||||||||||||||||||||||||
607 | if (currentRight != m_controllerWidget
| 0 | ||||||||||||||||||||||||
608 | menuBar->setCornerWidget(m_controllerWidget, Qt::TopRightCorner); | - | ||||||||||||||||||||||||
609 | previousRight = currentRight; | - | ||||||||||||||||||||||||
610 | } never executed: end of block | 0 | ||||||||||||||||||||||||
611 | m_controllerWidget->show(); | - | ||||||||||||||||||||||||
612 | } never executed: end of block | 0 | ||||||||||||||||||||||||
613 | mdiChild->d_func()->setNewWindowTitle(); | - | ||||||||||||||||||||||||
614 | } never executed: end of block | 0 | ||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||
616 | - | |||||||||||||||||||||||||
617 | - | |||||||||||||||||||||||||
618 | - | |||||||||||||||||||||||||
619 | void ControlContainer::removeButtonsFromMenuBar(QMenuBar *menuBar) | - | ||||||||||||||||||||||||
620 | { | - | ||||||||||||||||||||||||
621 | if (menuBar
| 0 | ||||||||||||||||||||||||
622 | - | |||||||||||||||||||||||||
623 | previousRight = 0; | - | ||||||||||||||||||||||||
624 | previousLeft = 0; | - | ||||||||||||||||||||||||
625 | m_menuBar = menuBar; | - | ||||||||||||||||||||||||
626 | } never executed: end of block | 0 | ||||||||||||||||||||||||
627 | - | |||||||||||||||||||||||||
628 | if (!m_menuBar
| 0 | ||||||||||||||||||||||||
629 | return; never executed: return; | 0 | ||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||
631 | QMdiSubWindow *child = 0; | - | ||||||||||||||||||||||||
632 | if (m_controllerWidget
| 0 | ||||||||||||||||||||||||
633 | QWidget *currentRight = m_menuBar->cornerWidget(Qt::TopRightCorner); | - | ||||||||||||||||||||||||
634 | if (currentRight == m_controllerWidget
| 0 | ||||||||||||||||||||||||
635 | if (ControlElement<ControllerWidget> *ce = ptr<ControllerWidget>(previousRight)
| 0 | ||||||||||||||||||||||||
636 | if (!ce->mdiChild
| 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
| 0 | ||||||||||||||||||||||||
643 | previousRight->show(); | - | ||||||||||||||||||||||||
644 | previousRight = 0; | - | ||||||||||||||||||||||||
645 | } never executed: end of block | 0 | ||||||||||||||||||||||||
646 | } never executed: end of block | 0 | ||||||||||||||||||||||||
647 | m_controllerWidget->hide(); | - | ||||||||||||||||||||||||
648 | m_controllerWidget->setParent(0); | - | ||||||||||||||||||||||||
649 | } never executed: end of block | 0 | ||||||||||||||||||||||||
650 | if (m_menuLabel
| 0 | ||||||||||||||||||||||||
651 | QWidget *currentLeft = m_menuBar->cornerWidget(Qt::TopLeftCorner); | - | ||||||||||||||||||||||||
652 | if (currentLeft == m_menuLabel
| 0 | ||||||||||||||||||||||||
653 | if (ControlElement<ControlLabel> *ce = ptr<ControlLabel>(previousLeft)
| 0 | ||||||||||||||||||||||||
654 | if (!ce->mdiChild
| 0 | ||||||||||||||||||||||||
655 | previousLeft = 0; never executed: previousLeft = 0; | 0 | ||||||||||||||||||||||||
656 | else if (!child
| 0 | ||||||||||||||||||||||||
657 | child = mdiChild; never executed: child = mdiChild; | 0 | ||||||||||||||||||||||||
658 | } never executed: end of block | 0 | ||||||||||||||||||||||||
659 | m_menuBar->setCornerWidget(previousLeft, Qt::TopLeftCorner); | - | ||||||||||||||||||||||||
660 | if (previousLeft
| 0 | ||||||||||||||||||||||||
661 | previousLeft->show(); | - | ||||||||||||||||||||||||
662 | previousLeft = 0; | - | ||||||||||||||||||||||||
663 | } never executed: end of block | 0 | ||||||||||||||||||||||||
664 | } never executed: end of block | 0 | ||||||||||||||||||||||||
665 | m_menuLabel->hide(); | - | ||||||||||||||||||||||||
666 | m_menuLabel->setParent(0); | - | ||||||||||||||||||||||||
667 | } never executed: end of block | 0 | ||||||||||||||||||||||||
668 | m_menuBar->update(); | - | ||||||||||||||||||||||||
669 | if (child
| 0 | ||||||||||||||||||||||||
670 | child->d_func()->setNewWindowTitle(); never executed: child->d_func()->setNewWindowTitle(); | 0 | ||||||||||||||||||||||||
671 | else if (mdiChild
| 0 | ||||||||||||||||||||||||
672 | mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle()); never executed: mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle()); | 0 | ||||||||||||||||||||||||
673 | } never executed: end of block | 0 | ||||||||||||||||||||||||
674 | - | |||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||
676 | - | |||||||||||||||||||||||||
677 | void ControlContainer::updateWindowIcon(const QIcon &windowIcon) | - | ||||||||||||||||||||||||
678 | { | - | ||||||||||||||||||||||||
679 | if (m_menuLabel
| 0 | ||||||||||||||||||||||||
680 | m_menuLabel->setWindowIcon(windowIcon); never executed: m_menuLabel->setWindowIcon(windowIcon); | 0 | ||||||||||||||||||||||||
681 | } never executed: end of block | 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 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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())
| 0 | ||||||||||||||||||||||||
731 | if (senderAction->isChecked()
| 0 | ||||||||||||||||||||||||
732 | q->setWindowFlags(q->windowFlags() | Qt::WindowStaysOnTopHint); | - | ||||||||||||||||||||||||
733 | q->raise(); | - | ||||||||||||||||||||||||
734 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
735 | q->setWindowFlags(q->windowFlags() & ~Qt::WindowStaysOnTopHint); | - | ||||||||||||||||||||||||
736 | q->lower(); | - | ||||||||||||||||||||||||
737 | } never executed: end of block | 0 | ||||||||||||||||||||||||
738 | } | - | ||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||
740 | } never executed: end of block | 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; never executed: return; | 0 | ||||||||||||||||||||||||
752 | - | |||||||||||||||||||||||||
753 | QPoint pressPos; | - | ||||||||||||||||||||||||
754 | if (actions[MoveAction]
| 0 | ||||||||||||||||||||||||
755 | currentOperation = Move; | - | ||||||||||||||||||||||||
756 | pressPos = QPoint(q->width() / 2, titleBarHeight() - 1); | - | ||||||||||||||||||||||||
757 | } never executed: else if (actions[ResizeAction]end of block
| 0 | ||||||||||||||||||||||||
758 | currentOperation = q->isLeftToRight()
| 0 | ||||||||||||||||||||||||
759 | int offset = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q) / 2; | - | ||||||||||||||||||||||||
760 | int x = q->isLeftToRight()
| 0 | ||||||||||||||||||||||||
761 | pressPos = QPoint(x, q->height() - offset); | - | ||||||||||||||||||||||||
762 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
763 | return; never executed: return; | 0 | ||||||||||||||||||||||||
764 | } | - | ||||||||||||||||||||||||
765 | - | |||||||||||||||||||||||||
766 | updateCursor(); | - | ||||||||||||||||||||||||
767 | - | |||||||||||||||||||||||||
768 | q->cursor().setPos(q->mapToGlobal(pressPos)); | - | ||||||||||||||||||||||||
769 | - | |||||||||||||||||||||||||
770 | mousePressPosition = q->mapToParent(pressPos); | - | ||||||||||||||||||||||||
771 | oldGeometry = q->geometry(); | - | ||||||||||||||||||||||||
772 | isInInteractiveMode = true; | - | ||||||||||||||||||||||||
773 | q->setFocus(); | - | ||||||||||||||||||||||||
774 | - | |||||||||||||||||||||||||
775 | if ((q->testOption(QMdiSubWindow::RubberBandResize)
| 0 | ||||||||||||||||||||||||
776 | && (currentOperation == BottomRightResize
| 0 | ||||||||||||||||||||||||
777 | || (q->testOption(QMdiSubWindow::RubberBandMove)
| 0 | ||||||||||||||||||||||||
778 | enterRubberBandMode(); | - | ||||||||||||||||||||||||
779 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
780 | - | |||||||||||||||||||||||||
781 | { | - | ||||||||||||||||||||||||
782 | q->grabMouse(); | - | ||||||||||||||||||||||||
783 | } never executed: end of block | 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
| 0 | ||||||||||||||||||||||||
795 | if (now == q
| 0 | ||||||||||||||||||||||||
796 | setFocusWidget(); never executed: setFocusWidget(); | 0 | ||||||||||||||||||||||||
797 | setActive(true); | - | ||||||||||||||||||||||||
798 | } never executed: end of block | 0 | ||||||||||||||||||||||||
799 | } never executed: end of block | 0 | ||||||||||||||||||||||||
800 | - | |||||||||||||||||||||||||
801 | - | |||||||||||||||||||||||||
802 | - | |||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||
804 | void QMdiSubWindowPrivate::leaveInteractiveMode() | - | ||||||||||||||||||||||||
805 | { | - | ||||||||||||||||||||||||
806 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
807 | - | |||||||||||||||||||||||||
808 | if (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
| 0 | ||||||||||||||||||||||||
818 | baseWidget->focusWidget()->setFocus(); never executed: baseWidget->focusWidget()->setFocus(); | 0 | ||||||||||||||||||||||||
819 | } never executed: end of block | 0 | ||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||
821 | - | |||||||||||||||||||||||||
822 | - | |||||||||||||||||||||||||
823 | - | |||||||||||||||||||||||||
824 | void QMdiSubWindowPrivate::removeBaseWidget() | - | ||||||||||||||||||||||||
825 | { | - | ||||||||||||||||||||||||
826 | if (!baseWidget
| 0 | ||||||||||||||||||||||||
827 | return; never executed: return; | 0 | ||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||
829 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
830 | baseWidget->removeEventFilter(q); | - | ||||||||||||||||||||||||
831 | if (layout
| 0 | ||||||||||||||||||||||||
832 | layout->removeWidget(baseWidget); never executed: layout->removeWidget(baseWidget); | 0 | ||||||||||||||||||||||||
833 | if (baseWidget->windowTitle() == q->windowTitle()
| 0 | ||||||||||||||||||||||||
834 | ignoreWindowTitleChange = true; | - | ||||||||||||||||||||||||
835 | q->setWindowTitle(QString()); | - | ||||||||||||||||||||||||
836 | ignoreWindowTitleChange = false; | - | ||||||||||||||||||||||||
837 | q->setWindowModified(false); | - | ||||||||||||||||||||||||
838 | } never executed: end of block | 0 | ||||||||||||||||||||||||
839 | lastChildWindowTitle.clear(); | - | ||||||||||||||||||||||||
840 | baseWidget->setParent(0); | - | ||||||||||||||||||||||||
841 | baseWidget = 0; | - | ||||||||||||||||||||||||
842 | isWidgetHiddenByUs = false; | - | ||||||||||||||||||||||||
843 | } never executed: end of block | 0 | ||||||||||||||||||||||||
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 | } never executed: end of block | 0 | ||||||||||||||||||||||||
863 | - | |||||||||||||||||||||||||
864 | - | |||||||||||||||||||||||||
865 | - | |||||||||||||||||||||||||
866 | - | |||||||||||||||||||||||||
867 | - | |||||||||||||||||||||||||
868 | - | |||||||||||||||||||||||||
869 | void QMdiSubWindowPrivate::createSystemMenu() | - | ||||||||||||||||||||||||
870 | { | - | ||||||||||||||||||||||||
871 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
872 | ((!(q)) ? qt_assert_x("QMdiSubWindowPrivate::createSystemMenu", "You can NOT call this function before QMdiSubWindow's ctor", | - | ||||||||||||||||||||||||
873 | __FILE__ | - | ||||||||||||||||||||||||
874 | , | - | ||||||||||||||||||||||||
875 | 1036 | - | ||||||||||||||||||||||||
876 | ) : qt_noop()) | - | ||||||||||||||||||||||||
877 | ; | - | ||||||||||||||||||||||||
878 | systemMenu = new QMenu(q); | - | ||||||||||||||||||||||||
879 | systemMenu->installEventFilter(q); | - | ||||||||||||||||||||||||
880 | const QStyle *style = q->style(); | - | ||||||||||||||||||||||||
881 | addToSystemMenu(RestoreAction, QMdiSubWindow::tr("&Restore"), qFlagLocation("1""showNormal()" "\0" __FILE__ ":" "1040")); | - | ||||||||||||||||||||||||
882 | actions[RestoreAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarNormalButton, 0, q)); | - | ||||||||||||||||||||||||
883 | actions[RestoreAction]->setEnabled(false); | - | ||||||||||||||||||||||||
884 | addToSystemMenu(MoveAction, QMdiSubWindow::tr("&Move"), qFlagLocation("1""_q_enterInteractiveMode()" "\0" __FILE__ ":" "1043")); | - | ||||||||||||||||||||||||
885 | addToSystemMenu(ResizeAction, QMdiSubWindow::tr("&Size"), qFlagLocation("1""_q_enterInteractiveMode()" "\0" __FILE__ ":" "1044")); | - | ||||||||||||||||||||||||
886 | addToSystemMenu(MinimizeAction, QMdiSubWindow::tr("Mi&nimize"), qFlagLocation("1""showMinimized()" "\0" __FILE__ ":" "1045")); | - | ||||||||||||||||||||||||
887 | actions[MinimizeAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarMinButton, 0, q)); | - | ||||||||||||||||||||||||
888 | addToSystemMenu(MaximizeAction, QMdiSubWindow::tr("Ma&ximize"), qFlagLocation("1""showMaximized()" "\0" __FILE__ ":" "1047")); | - | ||||||||||||||||||||||||
889 | actions[MaximizeAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarMaxButton, 0, q)); | - | ||||||||||||||||||||||||
890 | addToSystemMenu(StayOnTopAction, QMdiSubWindow::tr("Stay on &Top"), qFlagLocation("1""_q_updateStaysOnTopHint()" "\0" __FILE__ ":" "1049")); | - | ||||||||||||||||||||||||
891 | actions[StayOnTopAction]->setCheckable(true); | - | ||||||||||||||||||||||||
892 | systemMenu->addSeparator(); | - | ||||||||||||||||||||||||
893 | addToSystemMenu(CloseAction, QMdiSubWindow::tr("&Close"), qFlagLocation("1""close()" "\0" __FILE__ ":" "1052")); | - | ||||||||||||||||||||||||
894 | actions[CloseAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarCloseButton, 0, q)); | - | ||||||||||||||||||||||||
895 | - | |||||||||||||||||||||||||
896 | actions[CloseAction]->setShortcuts(QKeySequence::Close); | - | ||||||||||||||||||||||||
897 | - | |||||||||||||||||||||||||
898 | updateActions(); | - | ||||||||||||||||||||||||
899 | } never executed: end of block | 0 | ||||||||||||||||||||||||
900 | - | |||||||||||||||||||||||||
901 | - | |||||||||||||||||||||||||
902 | - | |||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||
904 | - | |||||||||||||||||||||||||
905 | void QMdiSubWindowPrivate::updateCursor() | - | ||||||||||||||||||||||||
906 | { | - | ||||||||||||||||||||||||
907 | - | |||||||||||||||||||||||||
908 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
909 | - | |||||||||||||||||||||||||
910 | - | |||||||||||||||||||||||||
911 | - | |||||||||||||||||||||||||
912 | - | |||||||||||||||||||||||||
913 | - | |||||||||||||||||||||||||
914 | if (currentOperation == None
| 0 | ||||||||||||||||||||||||
915 | q->unsetCursor(); | - | ||||||||||||||||||||||||
916 | return; never executed: return; | 0 | ||||||||||||||||||||||||
917 | } | - | ||||||||||||||||||||||||
918 | - | |||||||||||||||||||||||||
919 | if (currentOperation == Move
| 0 | ||||||||||||||||||||||||
920 | q->setCursor(operationMap.find(currentOperation).value().cursorShape); | - | ||||||||||||||||||||||||
921 | return; never executed: return; | 0 | ||||||||||||||||||||||||
922 | } | - | ||||||||||||||||||||||||
923 | - | |||||||||||||||||||||||||
924 | } never executed: end of block | 0 | ||||||||||||||||||||||||
925 | - | |||||||||||||||||||||||||
926 | - | |||||||||||||||||||||||||
927 | - | |||||||||||||||||||||||||
928 | - | |||||||||||||||||||||||||
929 | void QMdiSubWindowPrivate::updateDirtyRegions() | - | ||||||||||||||||||||||||
930 | { | - | ||||||||||||||||||||||||
931 | - | |||||||||||||||||||||||||
932 | if (!parent
| 0 | ||||||||||||||||||||||||
933 | return; never executed: return; | 0 | ||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||
935 | for (OperationInfoMap::iterator it = operationMap.begin(), end = operationMap.end(); it != end
| 0 | ||||||||||||||||||||||||
936 | it.value().region = getRegion(it.key()); never executed: it.value().region = getRegion(it.key()); | 0 | ||||||||||||||||||||||||
937 | } never executed: end of block | 0 | ||||||||||||||||||||||||
938 | - | |||||||||||||||||||||||||
939 | - | |||||||||||||||||||||||||
940 | - | |||||||||||||||||||||||||
941 | - | |||||||||||||||||||||||||
942 | void QMdiSubWindowPrivate::updateGeometryConstraints() | - | ||||||||||||||||||||||||
943 | { | - | ||||||||||||||||||||||||
944 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
945 | if (!parent
| 0 | ||||||||||||||||||||||||
946 | return; never executed: return; | 0 | ||||||||||||||||||||||||
947 | - | |||||||||||||||||||||||||
948 | internalMinimumSize = (!q->isMinimized()
| 0 | ||||||||||||||||||||||||
949 | ? q->minimumSize() : q->minimumSizeHint(); | - | ||||||||||||||||||||||||
950 | int margin, minWidth; | - | ||||||||||||||||||||||||
951 | sizeParameters(&margin, &minWidth); | - | ||||||||||||||||||||||||
952 | q->setContentsMargins(margin, titleBarHeight(), margin, margin); | - | ||||||||||||||||||||||||
953 | if (q->isMaximized()
| 0 | ||||||||||||||||||||||||
954 | moveEnabled = false; | - | ||||||||||||||||||||||||
955 | resizeEnabled = false; | - | ||||||||||||||||||||||||
956 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
957 | moveEnabled = true; | - | ||||||||||||||||||||||||
958 | if ((
| 0 | ||||||||||||||||||||||||
959 | resizeEnabled = false; never executed: resizeEnabled = false; | 0 | ||||||||||||||||||||||||
960 | else | - | ||||||||||||||||||||||||
961 | resizeEnabled = true; never executed: resizeEnabled = true; | 0 | ||||||||||||||||||||||||
962 | } | - | ||||||||||||||||||||||||
963 | updateDirtyRegions(); | - | ||||||||||||||||||||||||
964 | } never executed: end of block | 0 | ||||||||||||||||||||||||
965 | - | |||||||||||||||||||||||||
966 | - | |||||||||||||||||||||||||
967 | - | |||||||||||||||||||||||||
968 | - | |||||||||||||||||||||||||
969 | void QMdiSubWindowPrivate::updateMask() | - | ||||||||||||||||||||||||
970 | { | - | ||||||||||||||||||||||||
971 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
972 | if (!q->mask().isEmpty()
| 0 | ||||||||||||||||||||||||
973 | q->clearMask(); never executed: q->clearMask(); | 0 | ||||||||||||||||||||||||
974 | - | |||||||||||||||||||||||||
975 | if (!parent
| 0 | ||||||||||||||||||||||||
976 | return; never executed: return; | 0 | ||||||||||||||||||||||||
977 | - | |||||||||||||||||||||||||
978 | if ((q->isMaximized()
| 0 | ||||||||||||||||||||||||
979 | || q->windowFlags() & Qt::FramelessWindowHint
| 0 | ||||||||||||||||||||||||
980 | return; never executed: return; | 0 | ||||||||||||||||||||||||
981 | - | |||||||||||||||||||||||||
982 | if (resizeTimerId == -1
| 0 | ||||||||||||||||||||||||
983 | cachedStyleOptions = titleBarOptions(); never executed: cachedStyleOptions = titleBarOptions(); | 0 | ||||||||||||||||||||||||
984 | cachedStyleOptions.rect = q->rect(); | - | ||||||||||||||||||||||||
985 | QStyleHintReturnMask frameMask; | - | ||||||||||||||||||||||||
986 | q->style()->styleHint(QStyle::SH_WindowFrame_Mask, &cachedStyleOptions, q, &frameMask); | - | ||||||||||||||||||||||||
987 | if (!frameMask.region.isEmpty()
| 0 | ||||||||||||||||||||||||
988 | q->setMask(frameMask.region); never executed: q->setMask(frameMask.region); | 0 | ||||||||||||||||||||||||
989 | } never executed: end of block | 0 | ||||||||||||||||||||||||
990 | - | |||||||||||||||||||||||||
991 | - | |||||||||||||||||||||||||
992 | - | |||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||
994 | void QMdiSubWindowPrivate::setNewGeometry(const QPoint &pos) | - | ||||||||||||||||||||||||
995 | { | - | ||||||||||||||||||||||||
996 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
997 | ((!(currentOperation != None)) ? qt_assert("currentOperation != None",__FILE__,1156) : qt_noop()); | - | ||||||||||||||||||||||||
998 | ((!(parent)) ? qt_assert("parent",__FILE__,1157) : qt_noop()); | - | ||||||||||||||||||||||||
999 | - | |||||||||||||||||||||||||
1000 | uint cflags = operationMap.find(currentOperation).value().changeFlags; | - | ||||||||||||||||||||||||
1001 | int posX = pos.x(); | - | ||||||||||||||||||||||||
1002 | int posY = pos.y(); | - | ||||||||||||||||||||||||
1003 | - | |||||||||||||||||||||||||
1004 | const bool restrictHorizontal = !q->testOption(QMdiSubWindow::AllowOutsideAreaHorizontally); | - | ||||||||||||||||||||||||
1005 | const bool restrictVertical = !q->testOption(QMdiSubWindow::AllowOutsideAreaVertically); | - | ||||||||||||||||||||||||
1006 | - | |||||||||||||||||||||||||
1007 | if (restrictHorizontal
| 0 | ||||||||||||||||||||||||
1008 | QRect parentRect = q->parentWidget()->rect(); | - | ||||||||||||||||||||||||
1009 | if (restrictVertical
| 0 | ||||||||||||||||||||||||
1010 | posY = qMin(qMax(mousePressPosition.y() - oldGeometry.y(), posY), | - | ||||||||||||||||||||||||
1011 | parentRect.height() - BoundaryMargin); | - | ||||||||||||||||||||||||
1012 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1013 | if (currentOperation == Move
| 0 | ||||||||||||||||||||||||
1014 | if (restrictHorizontal
| 0 | ||||||||||||||||||||||||
1015 | posX = qMin(qMax(BoundaryMargin, posX), parentRect.width() - BoundaryMargin); never executed: posX = qMin(qMax(BoundaryMargin, posX), parentRect.width() - BoundaryMargin); | 0 | ||||||||||||||||||||||||
1016 | if (restrictVertical
| 0 | ||||||||||||||||||||||||
1017 | posY = qMin(posY, parentRect.height() - BoundaryMargin); never executed: posY = qMin(posY, parentRect.height() - BoundaryMargin); | 0 | ||||||||||||||||||||||||
1018 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1019 | if (restrictHorizontal
| 0 | ||||||||||||||||||||||||
1020 | if (cflags & HResizeReverse
| 0 | ||||||||||||||||||||||||
1021 | posX = qMax(mousePressPosition.x() - oldGeometry.x(), posX); never executed: posX = qMax(mousePressPosition.x() - oldGeometry.x(), posX); | 0 | ||||||||||||||||||||||||
1022 | else | - | ||||||||||||||||||||||||
1023 | posX = qMin(parentRect.width() - (oldGeometry.x() + oldGeometry.width() never executed: posX = qMin(parentRect.width() - (oldGeometry.x() + oldGeometry.width() - mousePressPosition.x()), posX); | 0 | ||||||||||||||||||||||||
1024 | - mousePressPosition.x()), posX); never executed: posX = qMin(parentRect.width() - (oldGeometry.x() + oldGeometry.width() - mousePressPosition.x()), posX); | 0 | ||||||||||||||||||||||||
1025 | } | - | ||||||||||||||||||||||||
1026 | if (restrictVertical
| 0 | ||||||||||||||||||||||||
1027 | posY = qMin(parentRect.height() - (oldGeometry.y() + oldGeometry.height() | - | ||||||||||||||||||||||||
1028 | - mousePressPosition.y()), posY); | - | ||||||||||||||||||||||||
1029 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1030 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1031 | } | - | ||||||||||||||||||||||||
1032 | - | |||||||||||||||||||||||||
1033 | QRect geometry; | - | ||||||||||||||||||||||||
1034 | if (cflags & (HMove | VMove)
| 0 | ||||||||||||||||||||||||
1035 | int dx = getMoveDeltaComponent(cflags, HMove, HResize, posX - mousePressPosition.x(), | - | ||||||||||||||||||||||||
1036 | oldGeometry.width() - internalMinimumSize.width(), | - | ||||||||||||||||||||||||
1037 | oldGeometry.width() - q->maximumWidth()); | - | ||||||||||||||||||||||||
1038 | int dy = getMoveDeltaComponent(cflags, VMove, VResize, posY - mousePressPosition.y(), | - | ||||||||||||||||||||||||
1039 | oldGeometry.height() - internalMinimumSize.height(), | - | ||||||||||||||||||||||||
1040 | oldGeometry.height() - q->maximumHeight()); | - | ||||||||||||||||||||||||
1041 | geometry.setTopLeft(oldGeometry.topLeft() + QPoint(dx, dy)); | - | ||||||||||||||||||||||||
1042 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1043 | geometry.setTopLeft(q->geometry().topLeft()); | - | ||||||||||||||||||||||||
1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||
1046 | if (cflags & (HResize | VResize)
| 0 | ||||||||||||||||||||||||
1047 | int dx = getResizeDeltaComponent(cflags, HResize, HResizeReverse, | - | ||||||||||||||||||||||||
1048 | posX - mousePressPosition.x()); | - | ||||||||||||||||||||||||
1049 | int dy = getResizeDeltaComponent(cflags, VResize, VResizeReverse, | - | ||||||||||||||||||||||||
1050 | posY - mousePressPosition.y()); | - | ||||||||||||||||||||||||
1051 | geometry.setSize(oldGeometry.size() + QSize(dx, dy)); | - | ||||||||||||||||||||||||
1052 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1053 | geometry.setSize(q->geometry().size()); | - | ||||||||||||||||||||||||
1054 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1055 | - | |||||||||||||||||||||||||
1056 | setNewGeometry(&geometry); | - | ||||||||||||||||||||||||
1057 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1058 | - | |||||||||||||||||||||||||
1059 | - | |||||||||||||||||||||||||
1060 | - | |||||||||||||||||||||||||
1061 | - | |||||||||||||||||||||||||
1062 | void QMdiSubWindowPrivate::setMinimizeMode() | - | ||||||||||||||||||||||||
1063 | { | - | ||||||||||||||||||||||||
1064 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1065 | ((!(parent)) ? qt_assert("parent",__FILE__,1224) : qt_noop()); | - | ||||||||||||||||||||||||
1066 | - | |||||||||||||||||||||||||
1067 | ensureWindowState(Qt::WindowMinimized); | - | ||||||||||||||||||||||||
1068 | isShadeRequestFromMinimizeMode = true; | - | ||||||||||||||||||||||||
1069 | q->showShaded(); | - | ||||||||||||||||||||||||
1070 | isShadeRequestFromMinimizeMode = false; | - | ||||||||||||||||||||||||
1071 | - | |||||||||||||||||||||||||
1072 | moveEnabled = false; | - | ||||||||||||||||||||||||
1073 | - | |||||||||||||||||||||||||
1074 | setEnabled(MoveAction, moveEnabled); | - | ||||||||||||||||||||||||
1075 | - | |||||||||||||||||||||||||
1076 | - | |||||||||||||||||||||||||
1077 | ((!(q->windowState() & Qt::WindowMinimized)) ? qt_assert("q->windowState() & Qt::WindowMinimized",__FILE__,1236) : qt_noop()); | - | ||||||||||||||||||||||||
1078 | ((!(!(q->windowState() & Qt::WindowMaximized))) ? qt_assert("!(q->windowState() & Qt::WindowMaximized)",__FILE__,1237) : qt_noop()); | - | ||||||||||||||||||||||||
1079 | - | |||||||||||||||||||||||||
1080 | - | |||||||||||||||||||||||||
1081 | - | |||||||||||||||||||||||||
1082 | - | |||||||||||||||||||||||||
1083 | - | |||||||||||||||||||||||||
1084 | setActive(true); | - | ||||||||||||||||||||||||
1085 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1086 | - | |||||||||||||||||||||||||
1087 | - | |||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||
1090 | void QMdiSubWindowPrivate::setNormalMode() | - | ||||||||||||||||||||||||
1091 | { | - | ||||||||||||||||||||||||
1092 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1093 | ((!(parent)) ? qt_assert("parent",__FILE__,1252) : qt_noop()); | - | ||||||||||||||||||||||||
1094 | - | |||||||||||||||||||||||||
1095 | isShadeMode = false; | - | ||||||||||||||||||||||||
1096 | isMaximizeMode = false; | - | ||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||
1098 | ensureWindowState(Qt::WindowNoState); | - | ||||||||||||||||||||||||
1099 | - | |||||||||||||||||||||||||
1100 | removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
1101 | - | |||||||||||||||||||||||||
1102 | - | |||||||||||||||||||||||||
1103 | - | |||||||||||||||||||||||||
1104 | - | |||||||||||||||||||||||||
1105 | const bool wasVisible = q->isVisible(); | - | ||||||||||||||||||||||||
1106 | if (wasVisible
| 0 | ||||||||||||||||||||||||
1107 | q->setVisible(false); never executed: q->setVisible(false); | 0 | ||||||||||||||||||||||||
1108 | - | |||||||||||||||||||||||||
1109 | - | |||||||||||||||||||||||||
1110 | if (!userMinimumSize.isNull()
| 0 | ||||||||||||||||||||||||
1111 | q->setMinimumSize(userMinimumSize); | - | ||||||||||||||||||||||||
1112 | userMinimumSize = QSize(0, 0); | - | ||||||||||||||||||||||||
1113 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1114 | - | |||||||||||||||||||||||||
1115 | - | |||||||||||||||||||||||||
1116 | if (baseWidget
| 0 | ||||||||||||||||||||||||
1117 | baseWidget->show(); | - | ||||||||||||||||||||||||
1118 | isWidgetHiddenByUs = false; | - | ||||||||||||||||||||||||
1119 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1120 | - | |||||||||||||||||||||||||
1121 | updateGeometryConstraints(); | - | ||||||||||||||||||||||||
1122 | QRect newGeometry = oldGeometry; | - | ||||||||||||||||||||||||
1123 | newGeometry.setSize(restoreSize.expandedTo(internalMinimumSize)); | - | ||||||||||||||||||||||||
1124 | q->setGeometry(newGeometry); | - | ||||||||||||||||||||||||
1125 | - | |||||||||||||||||||||||||
1126 | if (wasVisible
| 0 | ||||||||||||||||||||||||
1127 | q->setVisible(true); never executed: q->setVisible(true); | 0 | ||||||||||||||||||||||||
1128 | - | |||||||||||||||||||||||||
1129 | - | |||||||||||||||||||||||||
1130 | restoreSize.setWidth(-1); | - | ||||||||||||||||||||||||
1131 | restoreSize.setHeight(-1); | - | ||||||||||||||||||||||||
1132 | - | |||||||||||||||||||||||||
1133 | - | |||||||||||||||||||||||||
1134 | setSizeGripVisible(true); | - | ||||||||||||||||||||||||
1135 | - | |||||||||||||||||||||||||
1136 | - | |||||||||||||||||||||||||
1137 | - | |||||||||||||||||||||||||
1138 | setEnabled(MoveAction, true); | - | ||||||||||||||||||||||||
1139 | setEnabled(MaximizeAction, true); | - | ||||||||||||||||||||||||
1140 | setEnabled(MinimizeAction, true); | - | ||||||||||||||||||||||||
1141 | setEnabled(RestoreAction, false); | - | ||||||||||||||||||||||||
1142 | setEnabled(ResizeAction, resizeEnabled); | - | ||||||||||||||||||||||||
1143 | - | |||||||||||||||||||||||||
1144 | - | |||||||||||||||||||||||||
1145 | ((!(!(q_func()->windowState() & Qt::WindowMinimized))) ? qt_assert("!(q_func()->windowState() & Qt::WindowMinimized)",__FILE__,1304) : qt_noop()); | - | ||||||||||||||||||||||||
1146 | - | |||||||||||||||||||||||||
1147 | - | |||||||||||||||||||||||||
1148 | - | |||||||||||||||||||||||||
1149 | ((!((isMaximizeMode && q_func()->windowState() & Qt::WindowMaximized) || (!isMaximizeMode && !(q_func()->windowState() & Qt::WindowMaximized)))) ? qt_assert("(isMaximizeMode && q_func()->windowState() & Qt::WindowMaximized) || (!isMaximizeMode && !(q_func()->windowState() & Qt::WindowMaximized))", | - | ||||||||||||||||||||||||
1150 | __FILE__ | - | ||||||||||||||||||||||||
1151 | , | - | ||||||||||||||||||||||||
1152 | 1309 | - | ||||||||||||||||||||||||
1153 | ) : qt_noop()) | - | ||||||||||||||||||||||||
1154 | ; | - | ||||||||||||||||||||||||
1155 | ((!(!isShadeMode)) ? qt_assert("!isShadeMode",__FILE__,1310) : qt_noop()); | - | ||||||||||||||||||||||||
1156 | - | |||||||||||||||||||||||||
1157 | setActive(true); | - | ||||||||||||||||||||||||
1158 | restoreFocus(); | - | ||||||||||||||||||||||||
1159 | updateMask(); | - | ||||||||||||||||||||||||
1160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1161 | - | |||||||||||||||||||||||||
1162 | inline void QMdiSubWindowPrivate::storeFocusWidget() | - | ||||||||||||||||||||||||
1163 | { | - | ||||||||||||||||||||||||
1164 | if (QWidget *focus = QApplication::focusWidget()
| 0 | ||||||||||||||||||||||||
1165 | if (!restoreFocusWidget
| 0 | ||||||||||||||||||||||||
1166 | restoreFocusWidget = focus; never executed: restoreFocusWidget = focus; | 0 | ||||||||||||||||||||||||
1167 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1168 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1169 | - | |||||||||||||||||||||||||
1170 | - | |||||||||||||||||||||||||
1171 | - | |||||||||||||||||||||||||
1172 | - | |||||||||||||||||||||||||
1173 | void QMdiSubWindowPrivate::setMaximizeMode() | - | ||||||||||||||||||||||||
1174 | { | - | ||||||||||||||||||||||||
1175 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1176 | ((!(parent)) ? qt_assert("parent",__FILE__,1331) : qt_noop()); | - | ||||||||||||||||||||||||
1177 | - | |||||||||||||||||||||||||
1178 | ensureWindowState(Qt::WindowMaximized); | - | ||||||||||||||||||||||||
1179 | isShadeMode = false; | - | ||||||||||||||||||||||||
1180 | isMaximizeMode = true; | - | ||||||||||||||||||||||||
1181 | - | |||||||||||||||||||||||||
1182 | storeFocusWidget(); | - | ||||||||||||||||||||||||
1183 | - | |||||||||||||||||||||||||
1184 | - | |||||||||||||||||||||||||
1185 | setSizeGripVisible(false); | - | ||||||||||||||||||||||||
1186 | - | |||||||||||||||||||||||||
1187 | - | |||||||||||||||||||||||||
1188 | - | |||||||||||||||||||||||||
1189 | if (!restoreSize.isValid()
| 0 | ||||||||||||||||||||||||
1190 | oldGeometry = q->geometry(); | - | ||||||||||||||||||||||||
1191 | restoreSize.setWidth(oldGeometry.width()); | - | ||||||||||||||||||||||||
1192 | restoreSize.setHeight(oldGeometry.height()); | - | ||||||||||||||||||||||||
1193 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1194 | - | |||||||||||||||||||||||||
1195 | - | |||||||||||||||||||||||||
1196 | - | |||||||||||||||||||||||||
1197 | const bool wasVisible = q->isVisible(); | - | ||||||||||||||||||||||||
1198 | if (wasVisible
| 0 | ||||||||||||||||||||||||
1199 | q->setVisible(false); never executed: q->setVisible(false); | 0 | ||||||||||||||||||||||||
1200 | - | |||||||||||||||||||||||||
1201 | - | |||||||||||||||||||||||||
1202 | if (baseWidget
| 0 | ||||||||||||||||||||||||
1203 | baseWidget->show(); | - | ||||||||||||||||||||||||
1204 | isWidgetHiddenByUs = false; | - | ||||||||||||||||||||||||
1205 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1206 | - | |||||||||||||||||||||||||
1207 | updateGeometryConstraints(); | - | ||||||||||||||||||||||||
1208 | - | |||||||||||||||||||||||||
1209 | if (wasVisible
| 0 | ||||||||||||||||||||||||
1210 | - | |||||||||||||||||||||||||
1211 | if (QMenuBar *mBar = menuBar()
| 0 | ||||||||||||||||||||||||
1212 | showButtonsInMenuBar(mBar); never executed: showButtonsInMenuBar(mBar); | 0 | ||||||||||||||||||||||||
1213 | else | - | ||||||||||||||||||||||||
1214 | - | |||||||||||||||||||||||||
1215 | if (!controlContainer
| 0 | ||||||||||||||||||||||||
1216 | controlContainer = new ControlContainer(q); never executed: controlContainer = new ControlContainer(q); | 0 | ||||||||||||||||||||||||
1217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1218 | - | |||||||||||||||||||||||||
1219 | QWidget *parent = q->parentWidget(); | - | ||||||||||||||||||||||||
1220 | QRect availableRect = parent->contentsRect(); | - | ||||||||||||||||||||||||
1221 | - | |||||||||||||||||||||||||
1222 | - | |||||||||||||||||||||||||
1223 | QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent->parentWidget()); | - | ||||||||||||||||||||||||
1224 | if (scrollArea
| 0 | ||||||||||||||||||||||||
1225 | QScrollBar *hbar = scrollArea->horizontalScrollBar(); | - | ||||||||||||||||||||||||
1226 | QScrollBar *vbar = scrollArea->verticalScrollBar(); | - | ||||||||||||||||||||||||
1227 | const int xOffset = hbar
| 0 | ||||||||||||||||||||||||
1228 | const int yOffset = vbar
| 0 | ||||||||||||||||||||||||
1229 | availableRect.adjust(-xOffset, -yOffset, -xOffset, -yOffset); | - | ||||||||||||||||||||||||
1230 | oldGeometry.adjust(xOffset, yOffset, xOffset, yOffset); | - | ||||||||||||||||||||||||
1231 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1232 | - | |||||||||||||||||||||||||
1233 | setNewGeometry(&availableRect); | - | ||||||||||||||||||||||||
1234 | - | |||||||||||||||||||||||||
1235 | ensureWindowState(Qt::WindowMaximized); | - | ||||||||||||||||||||||||
1236 | - | |||||||||||||||||||||||||
1237 | if (wasVisible
| 0 | ||||||||||||||||||||||||
1238 | q->setVisible(true); never executed: q->setVisible(true); | 0 | ||||||||||||||||||||||||
1239 | - | |||||||||||||||||||||||||
1240 | resizeEnabled = false; | - | ||||||||||||||||||||||||
1241 | moveEnabled = false; | - | ||||||||||||||||||||||||
1242 | - | |||||||||||||||||||||||||
1243 | - | |||||||||||||||||||||||||
1244 | setEnabled(MoveAction, moveEnabled); | - | ||||||||||||||||||||||||
1245 | setEnabled(MaximizeAction, false); | - | ||||||||||||||||||||||||
1246 | setEnabled(MinimizeAction, true); | - | ||||||||||||||||||||||||
1247 | setEnabled(RestoreAction, true); | - | ||||||||||||||||||||||||
1248 | setEnabled(ResizeAction, resizeEnabled); | - | ||||||||||||||||||||||||
1249 | - | |||||||||||||||||||||||||
1250 | - | |||||||||||||||||||||||||
1251 | ((!(q->windowState() & Qt::WindowMaximized)) ? qt_assert("q->windowState() & Qt::WindowMaximized",__FILE__,1406) : qt_noop()); | - | ||||||||||||||||||||||||
1252 | ((!(!(q->windowState() & Qt::WindowMinimized))) ? qt_assert("!(q->windowState() & Qt::WindowMinimized)",__FILE__,1407) : qt_noop()); | - | ||||||||||||||||||||||||
1253 | - | |||||||||||||||||||||||||
1254 | restoreFocus(); | - | ||||||||||||||||||||||||
1255 | updateMask(); | - | ||||||||||||||||||||||||
1256 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1257 | - | |||||||||||||||||||||||||
1258 | - | |||||||||||||||||||||||||
1259 | - | |||||||||||||||||||||||||
1260 | - | |||||||||||||||||||||||||
1261 | void QMdiSubWindowPrivate::setActive(bool activate, bool changeFocus) | - | ||||||||||||||||||||||||
1262 | { | - | ||||||||||||||||||||||||
1263 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1264 | if (!parent
| 0 | ||||||||||||||||||||||||
1265 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1266 | - | |||||||||||||||||||||||||
1267 | if (activate
| 0 | ||||||||||||||||||||||||
1268 | isActive = true; | - | ||||||||||||||||||||||||
1269 | isExplicitlyDeactivated = false; | - | ||||||||||||||||||||||||
1270 | Qt::WindowStates oldWindowState = q->windowState(); | - | ||||||||||||||||||||||||
1271 | ensureWindowState(Qt::WindowActive); | - | ||||||||||||||||||||||||
1272 | q->aboutToActivate(); | - | ||||||||||||||||||||||||
1273 | - | |||||||||||||||||||||||||
1274 | if (QMenuBar *mBar = menuBar()
| 0 | ||||||||||||||||||||||||
1275 | showButtonsInMenuBar(mBar); never executed: showButtonsInMenuBar(mBar); | 0 | ||||||||||||||||||||||||
1276 | - | |||||||||||||||||||||||||
1277 | ((!(isActive)) ? qt_assert("isActive",__FILE__,1432) : qt_noop()); | - | ||||||||||||||||||||||||
1278 | q->windowStateChanged(oldWindowState, q->windowState()); | - | ||||||||||||||||||||||||
1279 | } never executed: else if (!activateend of block
| 0 | ||||||||||||||||||||||||
1280 | isActive = false; | - | ||||||||||||||||||||||||
1281 | Qt::WindowStates oldWindowState = q->windowState(); | - | ||||||||||||||||||||||||
1282 | q->overrideWindowState(q->windowState() & ~Qt::WindowActive); | - | ||||||||||||||||||||||||
1283 | if (changeFocus
| 0 | ||||||||||||||||||||||||
1284 | storeFocusWidget(); | - | ||||||||||||||||||||||||
1285 | QWidget *focusWidget = QApplication::focusWidget(); | - | ||||||||||||||||||||||||
1286 | if (focusWidget
| 0 | ||||||||||||||||||||||||
1287 | focusWidget->clearFocus(); never executed: focusWidget->clearFocus(); | 0 | ||||||||||||||||||||||||
1288 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1289 | if (baseWidget
| 0 | ||||||||||||||||||||||||
1290 | baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive); never executed: baseWidget->overrideWindowState(baseWidget->windowState() & ~Qt::WindowActive); | 0 | ||||||||||||||||||||||||
1291 | ((!(!isActive)) ? qt_assert("!isActive",__FILE__,1446) : qt_noop()); | - | ||||||||||||||||||||||||
1292 | q->windowStateChanged(oldWindowState, q->windowState()); | - | ||||||||||||||||||||||||
1293 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1294 | - | |||||||||||||||||||||||||
1295 | if (activate
| 0 | ||||||||||||||||||||||||
1296 | && !q->isAncestorOf(QApplication::focusWidget())
| 0 | ||||||||||||||||||||||||
1297 | if (changeFocus
| 0 | ||||||||||||||||||||||||
1298 | setFocusWidget(); never executed: setFocusWidget(); | 0 | ||||||||||||||||||||||||
1299 | ensureWindowState(Qt::WindowActive); | - | ||||||||||||||||||||||||
1300 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1301 | - | |||||||||||||||||||||||||
1302 | int frameWidth = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); | - | ||||||||||||||||||||||||
1303 | int titleBarHeight = this->titleBarHeight(); | - | ||||||||||||||||||||||||
1304 | QRegion windowDecoration = QRegion(0, 0, q->width(), q->height()); | - | ||||||||||||||||||||||||
1305 | windowDecoration -= QRegion(frameWidth, titleBarHeight, q->width() - 2 * frameWidth, | - | ||||||||||||||||||||||||
1306 | q->height() - titleBarHeight - frameWidth); | - | ||||||||||||||||||||||||
1307 | - | |||||||||||||||||||||||||
1308 | - | |||||||||||||||||||||||||
1309 | - | |||||||||||||||||||||||||
1310 | if (resizeTimerId != -1
| 0 | ||||||||||||||||||||||||
1311 | q->killTimer(resizeTimerId); | - | ||||||||||||||||||||||||
1312 | resizeTimerId = -1; | - | ||||||||||||||||||||||||
1313 | updateDirtyRegions(); | - | ||||||||||||||||||||||||
1314 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1315 | - | |||||||||||||||||||||||||
1316 | q->update(windowDecoration); | - | ||||||||||||||||||||||||
1317 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1318 | - | |||||||||||||||||||||||||
1319 | - | |||||||||||||||||||||||||
1320 | - | |||||||||||||||||||||||||
1321 | - | |||||||||||||||||||||||||
1322 | void QMdiSubWindowPrivate::processClickedSubControl() | - | ||||||||||||||||||||||||
1323 | { | - | ||||||||||||||||||||||||
1324 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1325 | switch (activeSubControl) { | - | ||||||||||||||||||||||||
1326 | case never executed: QStyle::SC_TitleBarContextHelpButton:case QStyle::SC_TitleBarContextHelpButton: never executed: case QStyle::SC_TitleBarContextHelpButton: | 0 | ||||||||||||||||||||||||
1327 | - | |||||||||||||||||||||||||
1328 | QWhatsThis::enterWhatsThisMode(); | - | ||||||||||||||||||||||||
1329 | - | |||||||||||||||||||||||||
1330 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1331 | case never executed: QStyle::SC_TitleBarShadeButton:case QStyle::SC_TitleBarShadeButton: never executed: case QStyle::SC_TitleBarShadeButton: | 0 | ||||||||||||||||||||||||
1332 | q->showShaded(); | - | ||||||||||||||||||||||||
1333 | hoveredSubControl = QStyle::SC_TitleBarUnshadeButton; | - | ||||||||||||||||||||||||
1334 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1335 | case never executed: QStyle::SC_TitleBarUnshadeButton:case QStyle::SC_TitleBarUnshadeButton: never executed: case QStyle::SC_TitleBarUnshadeButton: | 0 | ||||||||||||||||||||||||
1336 | if (q->isShaded()
| 0 | ||||||||||||||||||||||||
1337 | hoveredSubControl = QStyle::SC_TitleBarShadeButton; never executed: hoveredSubControl = QStyle::SC_TitleBarShadeButton; | 0 | ||||||||||||||||||||||||
1338 | q->showNormal(); | - | ||||||||||||||||||||||||
1339 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1340 | case never executed: QStyle::SC_TitleBarMinButton:case QStyle::SC_TitleBarMinButton: never executed: case QStyle::SC_TitleBarMinButton: | 0 | ||||||||||||||||||||||||
1341 | q->showMinimized(); | - | ||||||||||||||||||||||||
1342 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1343 | case never executed: QStyle::SC_TitleBarNormalButton:case QStyle::SC_TitleBarNormalButton: never executed: case QStyle::SC_TitleBarNormalButton: | 0 | ||||||||||||||||||||||||
1344 | if (q->isShaded()
| 0 | ||||||||||||||||||||||||
1345 | hoveredSubControl = QStyle::SC_TitleBarMinButton; never executed: hoveredSubControl = QStyle::SC_TitleBarMinButton; | 0 | ||||||||||||||||||||||||
1346 | q->showNormal(); | - | ||||||||||||||||||||||||
1347 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1348 | case never executed: QStyle::SC_TitleBarMaxButton:case QStyle::SC_TitleBarMaxButton: never executed: case QStyle::SC_TitleBarMaxButton: | 0 | ||||||||||||||||||||||||
1349 | q->showMaximized(); | - | ||||||||||||||||||||||||
1350 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1351 | case never executed: QStyle::SC_TitleBarCloseButton:case QStyle::SC_TitleBarCloseButton: never executed: case QStyle::SC_TitleBarCloseButton: | 0 | ||||||||||||||||||||||||
1352 | q->close(); | - | ||||||||||||||||||||||||
1353 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1354 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
1355 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1356 | } | - | ||||||||||||||||||||||||
1357 | } | - | ||||||||||||||||||||||||
1358 | - | |||||||||||||||||||||||||
1359 | - | |||||||||||||||||||||||||
1360 | - | |||||||||||||||||||||||||
1361 | - | |||||||||||||||||||||||||
1362 | QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const | - | ||||||||||||||||||||||||
1363 | { | - | ||||||||||||||||||||||||
1364 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1365 | int width = q->width(); | - | ||||||||||||||||||||||||
1366 | int height = q->height(); | - | ||||||||||||||||||||||||
1367 | int titleBarHeight = this->titleBarHeight(); | - | ||||||||||||||||||||||||
1368 | int frameWidth = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); | - | ||||||||||||||||||||||||
1369 | int cornerConst = titleBarHeight - frameWidth; | - | ||||||||||||||||||||||||
1370 | int titleBarConst = 2 * titleBarHeight; | - | ||||||||||||||||||||||||
1371 | - | |||||||||||||||||||||||||
1372 | if (operation == Move
| 0 | ||||||||||||||||||||||||
1373 | QStyleOptionTitleBar titleBarOptions = this->titleBarOptions(); | - | ||||||||||||||||||||||||
1374 | QRegion move(frameWidth, frameWidth, width - 2 * frameWidth, cornerConst); | - | ||||||||||||||||||||||||
1375 | - | |||||||||||||||||||||||||
1376 | - | |||||||||||||||||||||||||
1377 | for (int i = 0; i < NumSubControls
| 0 | ||||||||||||||||||||||||
1378 | if (SubControls[i] == QStyle::SC_TitleBarLabel
| 0 | ||||||||||||||||||||||||
1379 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
1380 | move -= QRegion(q->style()->subControlRect(QStyle::CC_TitleBar, &titleBarOptions, | - | ||||||||||||||||||||||||
1381 | SubControls[i])); | - | ||||||||||||||||||||||||
1382 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1383 | return never executed: move;return move; never executed: return move; | 0 | ||||||||||||||||||||||||
1384 | } | - | ||||||||||||||||||||||||
1385 | - | |||||||||||||||||||||||||
1386 | QRegion region; | - | ||||||||||||||||||||||||
1387 | - | |||||||||||||||||||||||||
1388 | - | |||||||||||||||||||||||||
1389 | - | |||||||||||||||||||||||||
1390 | - | |||||||||||||||||||||||||
1391 | - | |||||||||||||||||||||||||
1392 | switch (operation) { | - | ||||||||||||||||||||||||
1393 | case never executed: TopResize:case TopResize: never executed: case TopResize: | 0 | ||||||||||||||||||||||||
1394 | region = QRegion(titleBarHeight, 0, width - titleBarConst, frameWidth); | - | ||||||||||||||||||||||||
1395 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1396 | case never executed: BottomResize:case BottomResize: never executed: case BottomResize: | 0 | ||||||||||||||||||||||||
1397 | region = QRegion(titleBarHeight, height - frameWidth, width - titleBarConst, frameWidth); | - | ||||||||||||||||||||||||
1398 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1399 | case never executed: LeftResize:case LeftResize: never executed: case LeftResize: | 0 | ||||||||||||||||||||||||
1400 | region = QRegion(0, titleBarHeight, frameWidth, height - titleBarConst); | - | ||||||||||||||||||||||||
1401 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1402 | case never executed: RightResize:case RightResize: never executed: case RightResize: | 0 | ||||||||||||||||||||||||
1403 | region = QRegion(width - frameWidth, titleBarHeight, frameWidth, height - titleBarConst); | - | ||||||||||||||||||||||||
1404 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1405 | case never executed: TopLeftResize:case TopLeftResize: never executed: case TopLeftResize: | 0 | ||||||||||||||||||||||||
1406 | region = QRegion(0, 0, titleBarHeight, titleBarHeight) | - | ||||||||||||||||||||||||
1407 | - QRegion(frameWidth, frameWidth, cornerConst, cornerConst); | - | ||||||||||||||||||||||||
1408 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1409 | case never executed: TopRightResize:case TopRightResize: never executed: case TopRightResize: | 0 | ||||||||||||||||||||||||
1410 | region = QRegion(width - titleBarHeight, 0, titleBarHeight, titleBarHeight) | - | ||||||||||||||||||||||||
1411 | - QRegion(width - titleBarHeight, frameWidth, cornerConst, cornerConst); | - | ||||||||||||||||||||||||
1412 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1413 | case never executed: BottomLeftResize:case BottomLeftResize: never executed: case BottomLeftResize: | 0 | ||||||||||||||||||||||||
1414 | region = QRegion(0, height - titleBarHeight, titleBarHeight, titleBarHeight) | - | ||||||||||||||||||||||||
1415 | - QRegion(frameWidth, height - titleBarHeight, cornerConst, cornerConst); | - | ||||||||||||||||||||||||
1416 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1417 | case never executed: BottomRightResize:case BottomRightResize: never executed: case BottomRightResize: | 0 | ||||||||||||||||||||||||
1418 | region = QRegion(width - titleBarHeight, height - titleBarHeight, titleBarHeight, titleBarHeight) | - | ||||||||||||||||||||||||
1419 | - QRegion(width - titleBarHeight, height - titleBarHeight, cornerConst, cornerConst); | - | ||||||||||||||||||||||||
1420 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1421 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
1422 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1423 | } | - | ||||||||||||||||||||||||
1424 | - | |||||||||||||||||||||||||
1425 | return never executed: region;return region; never executed: return region; | 0 | ||||||||||||||||||||||||
1426 | } | - | ||||||||||||||||||||||||
1427 | - | |||||||||||||||||||||||||
1428 | - | |||||||||||||||||||||||||
1429 | - | |||||||||||||||||||||||||
1430 | - | |||||||||||||||||||||||||
1431 | QMdiSubWindowPrivate::Operation QMdiSubWindowPrivate::getOperation(const QPoint &pos) const | - | ||||||||||||||||||||||||
1432 | { | - | ||||||||||||||||||||||||
1433 | OperationInfoMap::const_iterator it; | - | ||||||||||||||||||||||||
1434 | for (it = operationMap.constBegin(); it != operationMap.constEnd()
| 0 | ||||||||||||||||||||||||
1435 | if (it.value().region.contains(pos)
| 0 | ||||||||||||||||||||||||
1436 | return never executed: it.key();return it.key(); never executed: return it.key(); | 0 | ||||||||||||||||||||||||
1437 | return never executed: None;return None; never executed: return None; | 0 | ||||||||||||||||||||||||
1438 | } | - | ||||||||||||||||||||||||
1439 | - | |||||||||||||||||||||||||
1440 | extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); | - | ||||||||||||||||||||||||
1441 | - | |||||||||||||||||||||||||
1442 | - | |||||||||||||||||||||||||
1443 | - | |||||||||||||||||||||||||
1444 | - | |||||||||||||||||||||||||
1445 | QStyleOptionTitleBar QMdiSubWindowPrivate::titleBarOptions() const | - | ||||||||||||||||||||||||
1446 | { | - | ||||||||||||||||||||||||
1447 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1448 | QStyleOptionTitleBar titleBarOptions; | - | ||||||||||||||||||||||||
1449 | titleBarOptions.initFrom(q); | - | ||||||||||||||||||||||||
1450 | if (activeSubControl != QStyle::SC_None
| 0 | ||||||||||||||||||||||||
1451 | if (hoveredSubControl == activeSubControl
| 0 | ||||||||||||||||||||||||
1452 | titleBarOptions.state |= QStyle::State_Sunken; | - | ||||||||||||||||||||||||
1453 | titleBarOptions.activeSubControls = activeSubControl; | - | ||||||||||||||||||||||||
1454 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1455 | } never executed: else if (autoRaise()end of block
| 0 | ||||||||||||||||||||||||
1456 | && hoveredSubControl != QStyle::SC_TitleBarLabel
| 0 | ||||||||||||||||||||||||
1457 | titleBarOptions.state |= QStyle::State_MouseOver; | - | ||||||||||||||||||||||||
1458 | titleBarOptions.activeSubControls = hoveredSubControl; | - | ||||||||||||||||||||||||
1459 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1460 | titleBarOptions.state &= ~QStyle::State_MouseOver; | - | ||||||||||||||||||||||||
1461 | titleBarOptions.activeSubControls = QStyle::SC_None; | - | ||||||||||||||||||||||||
1462 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1463 | - | |||||||||||||||||||||||||
1464 | titleBarOptions.subControls = QStyle::SC_All; | - | ||||||||||||||||||||||||
1465 | titleBarOptions.titleBarFlags = q->windowFlags(); | - | ||||||||||||||||||||||||
1466 | titleBarOptions.titleBarState = q->windowState(); | - | ||||||||||||||||||||||||
1467 | titleBarOptions.palette = titleBarPalette; | - | ||||||||||||||||||||||||
1468 | titleBarOptions.icon = menuIcon; | - | ||||||||||||||||||||||||
1469 | - | |||||||||||||||||||||||||
1470 | if (isActive
| 0 | ||||||||||||||||||||||||
1471 | titleBarOptions.state |= QStyle::State_Active; | - | ||||||||||||||||||||||||
1472 | titleBarOptions.titleBarState |= QStyle::State_Active; | - | ||||||||||||||||||||||||
1473 | titleBarOptions.palette.setCurrentColorGroup(QPalette::Active); | - | ||||||||||||||||||||||||
1474 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1475 | titleBarOptions.state &= ~QStyle::State_Active; | - | ||||||||||||||||||||||||
1476 | titleBarOptions.palette.setCurrentColorGroup(QPalette::Inactive); | - | ||||||||||||||||||||||||
1477 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1478 | - | |||||||||||||||||||||||||
1479 | int border = hasBorder(titleBarOptions)
| 0 | ||||||||||||||||||||||||
1480 | int paintHeight = titleBarHeight(titleBarOptions); | - | ||||||||||||||||||||||||
1481 | paintHeight -= q->isMinimized()
| 0 | ||||||||||||||||||||||||
1482 | titleBarOptions.rect = QRect(border, border, q->width() - 2 * border, paintHeight); | - | ||||||||||||||||||||||||
1483 | - | |||||||||||||||||||||||||
1484 | if (!windowTitle.isEmpty()
| 0 | ||||||||||||||||||||||||
1485 | - | |||||||||||||||||||||||||
1486 | - | |||||||||||||||||||||||||
1487 | titleBarOptions.text = windowTitle; | - | ||||||||||||||||||||||||
1488 | titleBarOptions.fontMetrics = QFontMetrics(font); | - | ||||||||||||||||||||||||
1489 | int width = q->style()->subControlRect(QStyle::CC_TitleBar, &titleBarOptions, | - | ||||||||||||||||||||||||
1490 | QStyle::SC_TitleBarLabel, q).width(); | - | ||||||||||||||||||||||||
1491 | - | |||||||||||||||||||||||||
1492 | titleBarOptions.text = titleBarOptions.fontMetrics.elidedText(windowTitle, Qt::ElideRight, width); | - | ||||||||||||||||||||||||
1493 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1494 | return never executed: titleBarOptions;return titleBarOptions; never executed: return titleBarOptions; | 0 | ||||||||||||||||||||||||
1495 | } | - | ||||||||||||||||||||||||
1496 | - | |||||||||||||||||||||||||
1497 | - | |||||||||||||||||||||||||
1498 | - | |||||||||||||||||||||||||
1499 | - | |||||||||||||||||||||||||
1500 | void QMdiSubWindowPrivate::ensureWindowState(Qt::WindowState state) | - | ||||||||||||||||||||||||
1501 | { | - | ||||||||||||||||||||||||
1502 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1503 | Qt::WindowStates windowStates = q->windowState() | state; | - | ||||||||||||||||||||||||
1504 | switch (state) { | - | ||||||||||||||||||||||||
1505 | case never executed: Qt::WindowMinimized:case Qt::WindowMinimized: never executed: case Qt::WindowMinimized: | 0 | ||||||||||||||||||||||||
1506 | windowStates &= ~Qt::WindowMaximized; | - | ||||||||||||||||||||||||
1507 | windowStates &= ~Qt::WindowFullScreen; | - | ||||||||||||||||||||||||
1508 | windowStates &= ~Qt::WindowNoState; | - | ||||||||||||||||||||||||
1509 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1510 | case never executed: Qt::WindowMaximized:case Qt::WindowMaximized: never executed: case Qt::WindowMaximized: | 0 | ||||||||||||||||||||||||
1511 | windowStates &= ~Qt::WindowMinimized; | - | ||||||||||||||||||||||||
1512 | windowStates &= ~Qt::WindowFullScreen; | - | ||||||||||||||||||||||||
1513 | windowStates &= ~Qt::WindowNoState; | - | ||||||||||||||||||||||||
1514 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1515 | case never executed: Qt::WindowNoState:case Qt::WindowNoState: never executed: case Qt::WindowNoState: | 0 | ||||||||||||||||||||||||
1516 | windowStates &= ~Qt::WindowMinimized; | - | ||||||||||||||||||||||||
1517 | windowStates &= ~Qt::WindowMaximized; | - | ||||||||||||||||||||||||
1518 | windowStates &= ~Qt::WindowFullScreen; | - | ||||||||||||||||||||||||
1519 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1520 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
1521 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1522 | } | - | ||||||||||||||||||||||||
1523 | if (baseWidget
| 0 | ||||||||||||||||||||||||
1524 | if (!(baseWidget->windowState() & Qt::WindowActive)
| 0 | ||||||||||||||||||||||||
1525 | baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive); never executed: baseWidget->overrideWindowState(windowStates & ~Qt::WindowActive); | 0 | ||||||||||||||||||||||||
1526 | else | - | ||||||||||||||||||||||||
1527 | baseWidget->overrideWindowState(windowStates); never executed: baseWidget->overrideWindowState(windowStates); | 0 | ||||||||||||||||||||||||
1528 | } | - | ||||||||||||||||||||||||
1529 | q->overrideWindowState(windowStates); | - | ||||||||||||||||||||||||
1530 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1531 | - | |||||||||||||||||||||||||
1532 | - | |||||||||||||||||||||||||
1533 | - | |||||||||||||||||||||||||
1534 | - | |||||||||||||||||||||||||
1535 | int QMdiSubWindowPrivate::titleBarHeight(const QStyleOptionTitleBar &options) const | - | ||||||||||||||||||||||||
1536 | { | - | ||||||||||||||||||||||||
1537 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1538 | if (!parent
| 0 | ||||||||||||||||||||||||
1539 | || (q->isMaximized()
| 0 | ||||||||||||||||||||||||
1540 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1541 | } | - | ||||||||||||||||||||||||
1542 | - | |||||||||||||||||||||||||
1543 | int height = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, q); | - | ||||||||||||||||||||||||
1544 | if (hasBorder(options)
| 0 | ||||||||||||||||||||||||
1545 | height += q->isMinimized()
never executed: height += q->isMinimized() ? 8 : 4; | 0 | ||||||||||||||||||||||||
1546 | return never executed: height;return height; never executed: return height; | 0 | ||||||||||||||||||||||||
1547 | } | - | ||||||||||||||||||||||||
1548 | - | |||||||||||||||||||||||||
1549 | - | |||||||||||||||||||||||||
1550 | - | |||||||||||||||||||||||||
1551 | - | |||||||||||||||||||||||||
1552 | void QMdiSubWindowPrivate::sizeParameters(int *margin, int *minWidth) const | - | ||||||||||||||||||||||||
1553 | { | - | ||||||||||||||||||||||||
1554 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1555 | Qt::WindowFlags flags = q->windowFlags(); | - | ||||||||||||||||||||||||
1556 | if (!parent
| 0 | ||||||||||||||||||||||||
1557 | *margin = 0; | - | ||||||||||||||||||||||||
1558 | *minWidth = 0; | - | ||||||||||||||||||||||||
1559 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1560 | } | - | ||||||||||||||||||||||||
1561 | - | |||||||||||||||||||||||||
1562 | if (q->isMaximized()
| 0 | ||||||||||||||||||||||||
1563 | * never executed: margin = 0;*margin = 0; never executed: *margin = 0; | 0 | ||||||||||||||||||||||||
1564 | else | - | ||||||||||||||||||||||||
1565 | * never executed: margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q);*margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); never executed: *margin = q->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, q); | 0 | ||||||||||||||||||||||||
1566 | - | |||||||||||||||||||||||||
1567 | QStyleOptionTitleBar opt = this->titleBarOptions(); | - | ||||||||||||||||||||||||
1568 | int tempWidth = 0; | - | ||||||||||||||||||||||||
1569 | for (int i = 0; i < NumSubControls
| 0 | ||||||||||||||||||||||||
1570 | if (SubControls[i] == QStyle::SC_TitleBarLabel
| 0 | ||||||||||||||||||||||||
1571 | tempWidth += 30; | - | ||||||||||||||||||||||||
1572 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
1573 | } | - | ||||||||||||||||||||||||
1574 | QRect rect = q->style()->subControlRect(QStyle::CC_TitleBar, &opt, SubControls[i], q); | - | ||||||||||||||||||||||||
1575 | if (!rect.isValid()
| 0 | ||||||||||||||||||||||||
1576 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
1577 | tempWidth += rect.width(); | - | ||||||||||||||||||||||||
1578 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1579 | *minWidth = tempWidth; | - | ||||||||||||||||||||||||
1580 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1581 | - | |||||||||||||||||||||||||
1582 | - | |||||||||||||||||||||||||
1583 | - | |||||||||||||||||||||||||
1584 | - | |||||||||||||||||||||||||
1585 | bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const | - | ||||||||||||||||||||||||
1586 | { | - | ||||||||||||||||||||||||
1587 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1588 | if (q->window()->testAttribute(Qt::WA_CanHostQMdiSubWindowTitleBar)
| 0 | ||||||||||||||||||||||||
1589 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1590 | - | |||||||||||||||||||||||||
1591 | if (isChildOfTabbedQMdiArea(q)
| 0 | ||||||||||||||||||||||||
1592 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1593 | - | |||||||||||||||||||||||||
1594 | - | |||||||||||||||||||||||||
1595 | - | |||||||||||||||||||||||||
1596 | - | |||||||||||||||||||||||||
1597 | - | |||||||||||||||||||||||||
1598 | if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q)
| 0 | ||||||||||||||||||||||||
1599 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1600 | - | |||||||||||||||||||||||||
1601 | - | |||||||||||||||||||||||||
1602 | - | |||||||||||||||||||||||||
1603 | - | |||||||||||||||||||||||||
1604 | QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window()); | - | ||||||||||||||||||||||||
1605 | if (!mainWindow
| 0 | ||||||||||||||||||||||||
1606 | || mainWindow->menuWidget()->isHidden()
| 0 | ||||||||||||||||||||||||
1607 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1608 | - | |||||||||||||||||||||||||
1609 | return never executed: isChildOfQMdiSubWindow(q);return isChildOfQMdiSubWindow(q); never executed: return isChildOfQMdiSubWindow(q); | 0 | ||||||||||||||||||||||||
1610 | - | |||||||||||||||||||||||||
1611 | - | |||||||||||||||||||||||||
1612 | } | - | ||||||||||||||||||||||||
1613 | - | |||||||||||||||||||||||||
1614 | - | |||||||||||||||||||||||||
1615 | - | |||||||||||||||||||||||||
1616 | - | |||||||||||||||||||||||||
1617 | - | |||||||||||||||||||||||||
1618 | - | |||||||||||||||||||||||||
1619 | void QMdiSubWindowPrivate::showButtonsInMenuBar(QMenuBar *menuBar) | - | ||||||||||||||||||||||||
1620 | { | - | ||||||||||||||||||||||||
1621 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1622 | ((!(q->isMaximized() && !drawTitleBarWhenMaximized())) ? qt_assert("q->isMaximized() && !drawTitleBarWhenMaximized()",__FILE__,1795) : qt_noop()); | - | ||||||||||||||||||||||||
1623 | - | |||||||||||||||||||||||||
1624 | if (isChildOfTabbedQMdiArea(q)
| 0 | ||||||||||||||||||||||||
1625 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1626 | - | |||||||||||||||||||||||||
1627 | removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
1628 | if (!controlContainer
| 0 | ||||||||||||||||||||||||
1629 | controlContainer = new ControlContainer(q); never executed: controlContainer = new ControlContainer(q); | 0 | ||||||||||||||||||||||||
1630 | - | |||||||||||||||||||||||||
1631 | ignoreWindowTitleChange = true; | - | ||||||||||||||||||||||||
1632 | controlContainer->showButtonsInMenuBar(menuBar); | - | ||||||||||||||||||||||||
1633 | ignoreWindowTitleChange = false; | - | ||||||||||||||||||||||||
1634 | - | |||||||||||||||||||||||||
1635 | QWidget *topLevelWindow = q->window(); | - | ||||||||||||||||||||||||
1636 | topLevelWindow->setWindowModified(q->isWindowModified()); | - | ||||||||||||||||||||||||
1637 | topLevelWindow->installEventFilter(q); | - | ||||||||||||||||||||||||
1638 | - | |||||||||||||||||||||||||
1639 | int buttonHeight = 0; | - | ||||||||||||||||||||||||
1640 | if (controlContainer->controllerWidget()
| 0 | ||||||||||||||||||||||||
1641 | buttonHeight = controlContainer->controllerWidget()->height(); never executed: buttonHeight = controlContainer->controllerWidget()->height(); | 0 | ||||||||||||||||||||||||
1642 | else if (controlContainer->systemMenuLabel()
| 0 | ||||||||||||||||||||||||
1643 | buttonHeight = controlContainer->systemMenuLabel()->height(); never executed: buttonHeight = controlContainer->systemMenuLabel()->height(); | 0 | ||||||||||||||||||||||||
1644 | - | |||||||||||||||||||||||||
1645 | - | |||||||||||||||||||||||||
1646 | if (menuBar
| 0 | ||||||||||||||||||||||||
1647 | && topLevelWindow->layout()
| 0 | ||||||||||||||||||||||||
1648 | - | |||||||||||||||||||||||||
1649 | - | |||||||||||||||||||||||||
1650 | QEvent event(QEvent::LayoutRequest); | - | ||||||||||||||||||||||||
1651 | QApplication::sendEvent(topLevelWindow, &event); | - | ||||||||||||||||||||||||
1652 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1653 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1654 | - | |||||||||||||||||||||||||
1655 | - | |||||||||||||||||||||||||
1656 | - | |||||||||||||||||||||||||
1657 | - | |||||||||||||||||||||||||
1658 | void QMdiSubWindowPrivate::removeButtonsFromMenuBar() | - | ||||||||||||||||||||||||
1659 | { | - | ||||||||||||||||||||||||
1660 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1661 | - | |||||||||||||||||||||||||
1662 | if (!controlContainer
| 0 | ||||||||||||||||||||||||
1663 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1664 | - | |||||||||||||||||||||||||
1665 | QMenuBar *currentMenuBar = 0; | - | ||||||||||||||||||||||||
1666 | - | |||||||||||||||||||||||||
1667 | if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())
| 0 | ||||||||||||||||||||||||
1668 | - | |||||||||||||||||||||||||
1669 | - | |||||||||||||||||||||||||
1670 | currentMenuBar = qobject_cast<QMenuBar *>(mainWindow->menuWidget()); | - | ||||||||||||||||||||||||
1671 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1672 | - | |||||||||||||||||||||||||
1673 | - | |||||||||||||||||||||||||
1674 | ignoreWindowTitleChange = true; | - | ||||||||||||||||||||||||
1675 | controlContainer->removeButtonsFromMenuBar(currentMenuBar); | - | ||||||||||||||||||||||||
1676 | ignoreWindowTitleChange = false; | - | ||||||||||||||||||||||||
1677 | - | |||||||||||||||||||||||||
1678 | QWidget *topLevelWindow = q->window(); | - | ||||||||||||||||||||||||
1679 | topLevelWindow->removeEventFilter(q); | - | ||||||||||||||||||||||||
1680 | if (baseWidget
| 0 | ||||||||||||||||||||||||
1681 | topLevelWindow->setWindowModified(false); never executed: topLevelWindow->setWindowModified(false); | 0 | ||||||||||||||||||||||||
1682 | originalTitle = QString::null; | - | ||||||||||||||||||||||||
1683 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1684 | - | |||||||||||||||||||||||||
1685 | - | |||||||||||||||||||||||||
1686 | - | |||||||||||||||||||||||||
1687 | void QMdiSubWindowPrivate::updateWindowTitle(bool isRequestFromChild) | - | ||||||||||||||||||||||||
1688 | { | - | ||||||||||||||||||||||||
1689 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1690 | if (isRequestFromChild
| 0 | ||||||||||||||||||||||||
1691 | && lastChildWindowTitle != q->windowTitle()
| 0 | ||||||||||||||||||||||||
1692 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1693 | } | - | ||||||||||||||||||||||||
1694 | - | |||||||||||||||||||||||||
1695 | QWidget *titleWidget = 0; | - | ||||||||||||||||||||||||
1696 | if (isRequestFromChild
| 0 | ||||||||||||||||||||||||
1697 | titleWidget = baseWidget; never executed: titleWidget = baseWidget; | 0 | ||||||||||||||||||||||||
1698 | else | - | ||||||||||||||||||||||||
1699 | titleWidget = q; never executed: titleWidget = q; | 0 | ||||||||||||||||||||||||
1700 | if (!titleWidget
| 0 | ||||||||||||||||||||||||
1701 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1702 | - | |||||||||||||||||||||||||
1703 | ignoreWindowTitleChange = true; | - | ||||||||||||||||||||||||
1704 | q->setWindowTitle(titleWidget->windowTitle()); | - | ||||||||||||||||||||||||
1705 | if (q->maximizedButtonsWidget()
| 0 | ||||||||||||||||||||||||
1706 | setNewWindowTitle(); never executed: setNewWindowTitle(); | 0 | ||||||||||||||||||||||||
1707 | ignoreWindowTitleChange = false; | - | ||||||||||||||||||||||||
1708 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1709 | - | |||||||||||||||||||||||||
1710 | - | |||||||||||||||||||||||||
1711 | void QMdiSubWindowPrivate::enterRubberBandMode() | - | ||||||||||||||||||||||||
1712 | { | - | ||||||||||||||||||||||||
1713 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1714 | if (q->isMaximized()
| 0 | ||||||||||||||||||||||||
1715 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1716 | ((!(oldGeometry.isValid())) ? qt_assert("oldGeometry.isValid()",__FILE__,1889) : qt_noop()); | - | ||||||||||||||||||||||||
1717 | ((!(parent)) ? qt_assert("parent",__FILE__,1890) : qt_noop()); | - | ||||||||||||||||||||||||
1718 | if (!rubberBand
| 0 | ||||||||||||||||||||||||
1719 | rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget()); | - | ||||||||||||||||||||||||
1720 | - | |||||||||||||||||||||||||
1721 | rubberBand->setObjectName(QLatin1String("qt_rubberband")); | - | ||||||||||||||||||||||||
1722 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1723 | QPoint rubberBandPos = q->mapToParent(QPoint(0, 0)); | - | ||||||||||||||||||||||||
1724 | rubberBand->setGeometry(rubberBandPos.x(), rubberBandPos.y(), | - | ||||||||||||||||||||||||
1725 | oldGeometry.width(), oldGeometry.height()); | - | ||||||||||||||||||||||||
1726 | rubberBand->show(); | - | ||||||||||||||||||||||||
1727 | isInRubberBandMode = true; | - | ||||||||||||||||||||||||
1728 | q->grabMouse(); | - | ||||||||||||||||||||||||
1729 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1730 | - | |||||||||||||||||||||||||
1731 | void QMdiSubWindowPrivate::leaveRubberBandMode() | - | ||||||||||||||||||||||||
1732 | { | - | ||||||||||||||||||||||||
1733 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1734 | ((!(rubberBand)) ? qt_assert("rubberBand",__FILE__,1907) : qt_noop()); | - | ||||||||||||||||||||||||
1735 | ((!(isInRubberBandMode)) ? qt_assert("isInRubberBandMode",__FILE__,1908) : qt_noop()); | - | ||||||||||||||||||||||||
1736 | q->releaseMouse(); | - | ||||||||||||||||||||||||
1737 | isInRubberBandMode = false; | - | ||||||||||||||||||||||||
1738 | q->setGeometry(rubberBand->geometry()); | - | ||||||||||||||||||||||||
1739 | rubberBand->hide(); | - | ||||||||||||||||||||||||
1740 | currentOperation = None; | - | ||||||||||||||||||||||||
1741 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1742 | - | |||||||||||||||||||||||||
1743 | - | |||||||||||||||||||||||||
1744 | - | |||||||||||||||||||||||||
1745 | QPalette QMdiSubWindowPrivate::desktopPalette() const | - | ||||||||||||||||||||||||
1746 | { | - | ||||||||||||||||||||||||
1747 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1748 | QPalette newPalette = q->palette(); | - | ||||||||||||||||||||||||
1749 | - | |||||||||||||||||||||||||
1750 | bool colorsInitialized = false; | - | ||||||||||||||||||||||||
1751 | if (!colorsInitialized
| 0 | ||||||||||||||||||||||||
1752 | newPalette.setColor(QPalette::Active, QPalette::Highlight, | - | ||||||||||||||||||||||||
1753 | newPalette.color(QPalette::Active, QPalette::Highlight)); | - | ||||||||||||||||||||||||
1754 | newPalette.setColor(QPalette::Active, QPalette::Base, | - | ||||||||||||||||||||||||
1755 | newPalette.color(QPalette::Active, QPalette::Highlight)); | - | ||||||||||||||||||||||||
1756 | newPalette.setColor(QPalette::Inactive, QPalette::Highlight, | - | ||||||||||||||||||||||||
1757 | newPalette.color(QPalette::Inactive, QPalette::Dark)); | - | ||||||||||||||||||||||||
1758 | newPalette.setColor(QPalette::Inactive, QPalette::Base, | - | ||||||||||||||||||||||||
1759 | newPalette.color(QPalette::Inactive, QPalette::Dark)); | - | ||||||||||||||||||||||||
1760 | newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText, | - | ||||||||||||||||||||||||
1761 | newPalette.color(QPalette::Inactive, QPalette::Window)); | - | ||||||||||||||||||||||||
1762 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1763 | - | |||||||||||||||||||||||||
1764 | return never executed: newPalette;return newPalette; never executed: return newPalette; | 0 | ||||||||||||||||||||||||
1765 | } | - | ||||||||||||||||||||||||
1766 | - | |||||||||||||||||||||||||
1767 | void QMdiSubWindowPrivate::updateActions() | - | ||||||||||||||||||||||||
1768 | { | - | ||||||||||||||||||||||||
1769 | Qt::WindowFlags windowFlags = q_func()->windowFlags(); | - | ||||||||||||||||||||||||
1770 | - | |||||||||||||||||||||||||
1771 | for (int i = 0; i < NumWindowStateActions
| 0 | ||||||||||||||||||||||||
1772 | setVisible(WindowStateAction(i), false); never executed: setVisible(WindowStateAction(i), false); | 0 | ||||||||||||||||||||||||
1773 | - | |||||||||||||||||||||||||
1774 | if (windowFlags & Qt::FramelessWindowHint
| 0 | ||||||||||||||||||||||||
1775 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1776 | - | |||||||||||||||||||||||||
1777 | setVisible(StayOnTopAction, true); | - | ||||||||||||||||||||||||
1778 | setVisible(MoveAction, moveEnabled); | - | ||||||||||||||||||||||||
1779 | setVisible(ResizeAction, resizeEnabled); | - | ||||||||||||||||||||||||
1780 | - | |||||||||||||||||||||||||
1781 | - | |||||||||||||||||||||||||
1782 | if (windowFlags & Qt::WindowSystemMenuHint
| 0 | ||||||||||||||||||||||||
1783 | setVisible(CloseAction, true); never executed: setVisible(CloseAction, true); | 0 | ||||||||||||||||||||||||
1784 | - | |||||||||||||||||||||||||
1785 | - | |||||||||||||||||||||||||
1786 | if (windowFlags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint)
| 0 | ||||||||||||||||||||||||
1787 | setVisible(RestoreAction, true); never executed: setVisible(RestoreAction, true); | 0 | ||||||||||||||||||||||||
1788 | - | |||||||||||||||||||||||||
1789 | - | |||||||||||||||||||||||||
1790 | if (windowFlags & Qt::WindowMinimizeButtonHint
| 0 | ||||||||||||||||||||||||
1791 | setVisible(MinimizeAction, true); never executed: setVisible(MinimizeAction, true); | 0 | ||||||||||||||||||||||||
1792 | - | |||||||||||||||||||||||||
1793 | - | |||||||||||||||||||||||||
1794 | if (windowFlags & Qt::WindowMaximizeButtonHint
| 0 | ||||||||||||||||||||||||
1795 | setVisible(MaximizeAction, true); never executed: setVisible(MaximizeAction, true); | 0 | ||||||||||||||||||||||||
1796 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1797 | - | |||||||||||||||||||||||||
1798 | void QMdiSubWindowPrivate::setFocusWidget() | - | ||||||||||||||||||||||||
1799 | { | - | ||||||||||||||||||||||||
1800 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1801 | if (!baseWidget
| 0 | ||||||||||||||||||||||||
1802 | q->setFocus(); | - | ||||||||||||||||||||||||
1803 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1804 | } | - | ||||||||||||||||||||||||
1805 | - | |||||||||||||||||||||||||
1806 | - | |||||||||||||||||||||||||
1807 | - | |||||||||||||||||||||||||
1808 | - | |||||||||||||||||||||||||
1809 | if (focusInReason == Qt::TabFocusReason
| 0 | ||||||||||||||||||||||||
1810 | q->focusNextChild(); | - | ||||||||||||||||||||||||
1811 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1812 | } | - | ||||||||||||||||||||||||
1813 | - | |||||||||||||||||||||||||
1814 | - | |||||||||||||||||||||||||
1815 | if (focusInReason == Qt::BacktabFocusReason
| 0 | ||||||||||||||||||||||||
1816 | q->focusPreviousChild(); | - | ||||||||||||||||||||||||
1817 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1818 | } | - | ||||||||||||||||||||||||
1819 | - | |||||||||||||||||||||||||
1820 | if (!(q->windowState() & Qt::WindowMinimized)
| 0 | ||||||||||||||||||||||||
1821 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1822 | - | |||||||||||||||||||||||||
1823 | if (QWidget *focusWidget = baseWidget->focusWidget()
| 0 | ||||||||||||||||||||||||
1824 | if (!focusWidget->hasFocus()
| 0 | ||||||||||||||||||||||||
1825 | && focusWidget->isVisible()
| 0 | ||||||||||||||||||||||||
1826 | && focusWidget->focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1827 | focusWidget->setFocus(); | - | ||||||||||||||||||||||||
1828 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1829 | q->setFocus(); | - | ||||||||||||||||||||||||
1830 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1831 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1832 | } | - | ||||||||||||||||||||||||
1833 | - | |||||||||||||||||||||||||
1834 | QWidget *focusWidget = q->nextInFocusChain(); | - | ||||||||||||||||||||||||
1835 | while (focusWidget
| 0 | ||||||||||||||||||||||||
1836 | focusWidget = focusWidget->nextInFocusChain(); never executed: focusWidget = focusWidget->nextInFocusChain(); | 0 | ||||||||||||||||||||||||
1837 | if (focusWidget
| 0 | ||||||||||||||||||||||||
1838 | focusWidget->setFocus(); never executed: focusWidget->setFocus(); | 0 | ||||||||||||||||||||||||
1839 | else if (baseWidget->focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1840 | baseWidget->setFocus(); never executed: baseWidget->setFocus(); | 0 | ||||||||||||||||||||||||
1841 | else if (!q->hasFocus()
| 0 | ||||||||||||||||||||||||
1842 | q->setFocus(); never executed: q->setFocus(); | 0 | ||||||||||||||||||||||||
1843 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1844 | - | |||||||||||||||||||||||||
1845 | bool QMdiSubWindowPrivate::restoreFocus() | - | ||||||||||||||||||||||||
1846 | { | - | ||||||||||||||||||||||||
1847 | if (restoreFocusWidget.isNull()
| 0 | ||||||||||||||||||||||||
1848 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1849 | QWidget *candidate = restoreFocusWidget; | - | ||||||||||||||||||||||||
1850 | restoreFocusWidget.clear(); | - | ||||||||||||||||||||||||
1851 | if (!candidate->hasFocus()
| 0 | ||||||||||||||||||||||||
1852 | && candidate->isVisible()
| 0 | ||||||||||||||||||||||||
1853 | && candidate->focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1854 | candidate->setFocus(); | - | ||||||||||||||||||||||||
1855 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1856 | } | - | ||||||||||||||||||||||||
1857 | return never executed: candidate->hasFocus();return candidate->hasFocus(); never executed: return candidate->hasFocus(); | 0 | ||||||||||||||||||||||||
1858 | } | - | ||||||||||||||||||||||||
1859 | - | |||||||||||||||||||||||||
1860 | - | |||||||||||||||||||||||||
1861 | - | |||||||||||||||||||||||||
1862 | - | |||||||||||||||||||||||||
1863 | void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags) | - | ||||||||||||||||||||||||
1864 | { | - | ||||||||||||||||||||||||
1865 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1866 | - | |||||||||||||||||||||||||
1867 | if (!parent
| 0 | ||||||||||||||||||||||||
1868 | QWidgetPrivate::setWindowFlags(windowFlags); | - | ||||||||||||||||||||||||
1869 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1870 | } | - | ||||||||||||||||||||||||
1871 | - | |||||||||||||||||||||||||
1872 | Qt::WindowFlags windowType = windowFlags & Qt::WindowType_Mask; | - | ||||||||||||||||||||||||
1873 | if (windowType == Qt::Dialog
| 0 | ||||||||||||||||||||||||
1874 | windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint; never executed: windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint; | 0 | ||||||||||||||||||||||||
1875 | - | |||||||||||||||||||||||||
1876 | - | |||||||||||||||||||||||||
1877 | if (!(windowFlags & CustomizeWindowFlags)
| 0 | ||||||||||||||||||||||||
1878 | windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint; never executed: windowFlags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint; | 0 | ||||||||||||||||||||||||
1879 | else if (windowFlags & Qt::FramelessWindowHint
| 0 | ||||||||||||||||||||||||
1880 | windowFlags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; never executed: windowFlags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; | 0 | ||||||||||||||||||||||||
1881 | else if (windowFlags & Qt::FramelessWindowHint
| 0 | ||||||||||||||||||||||||
1882 | windowFlags = Qt::FramelessWindowHint; never executed: windowFlags = Qt::FramelessWindowHint; | 0 | ||||||||||||||||||||||||
1883 | - | |||||||||||||||||||||||||
1884 | windowFlags &= ~windowType; | - | ||||||||||||||||||||||||
1885 | windowFlags &= ~Qt::WindowFullscreenButtonHint; | - | ||||||||||||||||||||||||
1886 | windowFlags |= Qt::SubWindow; | - | ||||||||||||||||||||||||
1887 | - | |||||||||||||||||||||||||
1888 | - | |||||||||||||||||||||||||
1889 | if (QAction *stayOnTopAction = actions[QMdiSubWindowPrivate::StayOnTopAction]
| 0 | ||||||||||||||||||||||||
1890 | if (windowFlags & Qt::WindowStaysOnTopHint
| 0 | ||||||||||||||||||||||||
1891 | stayOnTopAction->setChecked(true); never executed: stayOnTopAction->setChecked(true); | 0 | ||||||||||||||||||||||||
1892 | else | - | ||||||||||||||||||||||||
1893 | stayOnTopAction->setChecked(false); never executed: stayOnTopAction->setChecked(false); | 0 | ||||||||||||||||||||||||
1894 | } | - | ||||||||||||||||||||||||
1895 | - | |||||||||||||||||||||||||
1896 | - | |||||||||||||||||||||||||
1897 | - | |||||||||||||||||||||||||
1898 | if ((
| 0 | ||||||||||||||||||||||||
1899 | delete sizeGrip; never executed: delete sizeGrip; | 0 | ||||||||||||||||||||||||
1900 | - | |||||||||||||||||||||||||
1901 | - | |||||||||||||||||||||||||
1902 | QWidgetPrivate::setWindowFlags(windowFlags); | - | ||||||||||||||||||||||||
1903 | updateGeometryConstraints(); | - | ||||||||||||||||||||||||
1904 | updateActions(); | - | ||||||||||||||||||||||||
1905 | QSize currentSize = q->size(); | - | ||||||||||||||||||||||||
1906 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||
1907 | || currentSize.height() < internalMinimumSize.height()
| 0 | ||||||||||||||||||||||||
1908 | q->resize(currentSize.expandedTo(internalMinimumSize)); | - | ||||||||||||||||||||||||
1909 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1910 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1911 | - | |||||||||||||||||||||||||
1912 | void QMdiSubWindowPrivate::setVisible(WindowStateAction action, bool visible) | - | ||||||||||||||||||||||||
1913 | { | - | ||||||||||||||||||||||||
1914 | - | |||||||||||||||||||||||||
1915 | if (actions[action]
| 0 | ||||||||||||||||||||||||
1916 | actions[action]->setVisible(visible); never executed: actions[action]->setVisible(visible); | 0 | ||||||||||||||||||||||||
1917 | - | |||||||||||||||||||||||||
1918 | - | |||||||||||||||||||||||||
1919 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1920 | if (!controlContainer
| 0 | ||||||||||||||||||||||||
1921 | controlContainer = new ControlContainer(q); never executed: controlContainer = new ControlContainer(q); | 0 | ||||||||||||||||||||||||
1922 | - | |||||||||||||||||||||||||
1923 | if (ControllerWidget *ctrlWidget = qobject_cast<ControllerWidget *>
| 0 | ||||||||||||||||||||||||
1924 | (controlContainer->controllerWidget())
| 0 | ||||||||||||||||||||||||
1925 | ctrlWidget->setControlVisible(action, visible); | - | ||||||||||||||||||||||||
1926 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1927 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1928 | - | |||||||||||||||||||||||||
1929 | - | |||||||||||||||||||||||||
1930 | void QMdiSubWindowPrivate::setEnabled(WindowStateAction action, bool enable) | - | ||||||||||||||||||||||||
1931 | { | - | ||||||||||||||||||||||||
1932 | if (actions[action]
| 0 | ||||||||||||||||||||||||
1933 | actions[action]->setEnabled(enable); never executed: actions[action]->setEnabled(enable); | 0 | ||||||||||||||||||||||||
1934 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1935 | - | |||||||||||||||||||||||||
1936 | - | |||||||||||||||||||||||||
1937 | void QMdiSubWindowPrivate::addToSystemMenu(WindowStateAction action, const QString &text, | - | ||||||||||||||||||||||||
1938 | const char *slot) | - | ||||||||||||||||||||||||
1939 | { | - | ||||||||||||||||||||||||
1940 | if (!systemMenu
| 0 | ||||||||||||||||||||||||
1941 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1942 | actions[action] = systemMenu->addAction(text, q_func(), slot); | - | ||||||||||||||||||||||||
1943 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1944 | - | |||||||||||||||||||||||||
1945 | - | |||||||||||||||||||||||||
1946 | - | |||||||||||||||||||||||||
1947 | - | |||||||||||||||||||||||||
1948 | - | |||||||||||||||||||||||||
1949 | - | |||||||||||||||||||||||||
1950 | QSize QMdiSubWindowPrivate::iconSize() const | - | ||||||||||||||||||||||||
1951 | { | - | ||||||||||||||||||||||||
1952 | const QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1953 | if (!parent
| 0 | ||||||||||||||||||||||||
1954 | return never executed: QSize(-1, -1);return QSize(-1, -1); never executed: return QSize(-1, -1); | 0 | ||||||||||||||||||||||||
1955 | return never executed: QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight());return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight()); never executed: return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight()); | 0 | ||||||||||||||||||||||||
1956 | } | - | ||||||||||||||||||||||||
1957 | - | |||||||||||||||||||||||||
1958 | - | |||||||||||||||||||||||||
1959 | - | |||||||||||||||||||||||||
1960 | - | |||||||||||||||||||||||||
1961 | - | |||||||||||||||||||||||||
1962 | - | |||||||||||||||||||||||||
1963 | void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip) | - | ||||||||||||||||||||||||
1964 | { | - | ||||||||||||||||||||||||
1965 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
1966 | if (!newSizeGrip
| 0 | ||||||||||||||||||||||||
1967 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1968 | - | |||||||||||||||||||||||||
1969 | if (layout
| 0 | ||||||||||||||||||||||||
1970 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1971 | newSizeGrip->setFixedSize(newSizeGrip->sizeHint()); | - | ||||||||||||||||||||||||
1972 | bool putSizeGripInLayout = layout
| 0 | ||||||||||||||||||||||||
1973 | - | |||||||||||||||||||||||||
1974 | - | |||||||||||||||||||||||||
1975 | - | |||||||||||||||||||||||||
1976 | - | |||||||||||||||||||||||||
1977 | if (putSizeGripInLayout
| 0 | ||||||||||||||||||||||||
1978 | layout->addWidget(newSizeGrip); | - | ||||||||||||||||||||||||
1979 | layout->setAlignment(newSizeGrip, Qt::AlignBottom | Qt::AlignRight); | - | ||||||||||||||||||||||||
1980 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1981 | newSizeGrip->setParent(q); | - | ||||||||||||||||||||||||
1982 | newSizeGrip->move(q->isLeftToRight() ? q->width() - newSizeGrip->width() : 0, | - | ||||||||||||||||||||||||
1983 | q->height() - newSizeGrip->height()); | - | ||||||||||||||||||||||||
1984 | sizeGrip = newSizeGrip; | - | ||||||||||||||||||||||||
1985 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1986 | newSizeGrip->raise(); | - | ||||||||||||||||||||||||
1987 | updateGeometryConstraints(); | - | ||||||||||||||||||||||||
1988 | newSizeGrip->installEventFilter(q); | - | ||||||||||||||||||||||||
1989 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1990 | - | |||||||||||||||||||||||||
1991 | - | |||||||||||||||||||||||||
1992 | - | |||||||||||||||||||||||||
1993 | - | |||||||||||||||||||||||||
1994 | void QMdiSubWindowPrivate::setSizeGripVisible(bool visible) const | - | ||||||||||||||||||||||||
1995 | { | - | ||||||||||||||||||||||||
1996 | - | |||||||||||||||||||||||||
1997 | QList<QSizeGrip *> sizeGrips = q_func()->findChildren<QSizeGrip *>(); | - | ||||||||||||||||||||||||
1998 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(sizeGrips)>::type> _container_((sizeGrips)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QSizeGrip *grip = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||
1999 | grip->setVisible(visible); never executed: grip->setVisible(visible); | 0 | ||||||||||||||||||||||||
2000 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2001 | - | |||||||||||||||||||||||||
2002 | - | |||||||||||||||||||||||||
2003 | - | |||||||||||||||||||||||||
2004 | - | |||||||||||||||||||||||||
2005 | - | |||||||||||||||||||||||||
2006 | - | |||||||||||||||||||||||||
2007 | void QMdiSubWindowPrivate::updateInternalWindowTitle() | - | ||||||||||||||||||||||||
2008 | { | - | ||||||||||||||||||||||||
2009 | QMdiSubWindow * const q = q_func(); | - | ||||||||||||||||||||||||
2010 | if (q->isWindowModified()
| 0 | ||||||||||||||||||||||||
2011 | windowTitle = q->windowTitle(); | - | ||||||||||||||||||||||||
2012 | windowTitle.replace(QLatin1String("[*]"), QLatin1String("*")); | - | ||||||||||||||||||||||||
2013 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2014 | windowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q); | - | ||||||||||||||||||||||||
2015 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2016 | q->update(0, 0, q->width(), titleBarHeight()); | - | ||||||||||||||||||||||||
2017 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2018 | QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) | - | ||||||||||||||||||||||||
2019 | : QWidget(*new QMdiSubWindowPrivate, parent, 0) | - | ||||||||||||||||||||||||
2020 | { | - | ||||||||||||||||||||||||
2021 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2022 | - | |||||||||||||||||||||||||
2023 | d->createSystemMenu(); | - | ||||||||||||||||||||||||
2024 | addActions(d->systemMenu->actions()); | - | ||||||||||||||||||||||||
2025 | - | |||||||||||||||||||||||||
2026 | d->setWindowFlags(flags); | - | ||||||||||||||||||||||||
2027 | setBackgroundRole(QPalette::Window); | - | ||||||||||||||||||||||||
2028 | setAutoFillBackground(true); | - | ||||||||||||||||||||||||
2029 | setMouseTracking(true); | - | ||||||||||||||||||||||||
2030 | setLayout(new QVBoxLayout); | - | ||||||||||||||||||||||||
2031 | setFocusPolicy(Qt::StrongFocus); | - | ||||||||||||||||||||||||
2032 | layout()->setMargin(0); | - | ||||||||||||||||||||||||
2033 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2034 | setAttribute(Qt::WA_Resized, false); | - | ||||||||||||||||||||||||
2035 | d->titleBarPalette = d->desktopPalette(); | - | ||||||||||||||||||||||||
2036 | d->font = QApplication::font("QMdiSubWindowTitleBar"); | - | ||||||||||||||||||||||||
2037 | - | |||||||||||||||||||||||||
2038 | - | |||||||||||||||||||||||||
2039 | if (windowIcon().isNull()
| 0 | ||||||||||||||||||||||||
2040 | d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this); never executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this); | 0 | ||||||||||||||||||||||||
2041 | else | - | ||||||||||||||||||||||||
2042 | d->menuIcon = windowIcon(); never executed: d->menuIcon = windowIcon(); | 0 | ||||||||||||||||||||||||
2043 | - | |||||||||||||||||||||||||
2044 | connect((static_cast<QApplication *>(QCoreApplication::instance())), qFlagLocation("2""focusChanged(QWidget*,QWidget*)" "\0" __FILE__ ":" "2273"), | - | ||||||||||||||||||||||||
2045 | this, qFlagLocation("1""_q_processFocusChanged(QWidget*,QWidget*)" "\0" __FILE__ ":" "2274")); | - | ||||||||||||||||||||||||
2046 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2047 | - | |||||||||||||||||||||||||
2048 | - | |||||||||||||||||||||||||
2049 | - | |||||||||||||||||||||||||
2050 | - | |||||||||||||||||||||||||
2051 | - | |||||||||||||||||||||||||
2052 | - | |||||||||||||||||||||||||
2053 | QMdiSubWindow::~QMdiSubWindow() | - | ||||||||||||||||||||||||
2054 | { | - | ||||||||||||||||||||||||
2055 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2056 | - | |||||||||||||||||||||||||
2057 | d->removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
2058 | - | |||||||||||||||||||||||||
2059 | d->setActive(false); | - | ||||||||||||||||||||||||
2060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2061 | void QMdiSubWindow::setWidget(QWidget *widget) | - | ||||||||||||||||||||||||
2062 | { | - | ||||||||||||||||||||||||
2063 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2064 | if (!widget
| 0 | ||||||||||||||||||||||||
2065 | d->removeBaseWidget(); | - | ||||||||||||||||||||||||
2066 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2067 | } | - | ||||||||||||||||||||||||
2068 | - | |||||||||||||||||||||||||
2069 | if (widget == d->baseWidget
| 0 | ||||||||||||||||||||||||
2070 | QMessageLogger(__FILE__, 2311, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setWidget: widget is already set"); | - | ||||||||||||||||||||||||
2071 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2072 | } | - | ||||||||||||||||||||||||
2073 | - | |||||||||||||||||||||||||
2074 | bool wasResized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||
2075 | d->removeBaseWidget(); | - | ||||||||||||||||||||||||
2076 | - | |||||||||||||||||||||||||
2077 | if (QLayout *layout = this->layout()
| 0 | ||||||||||||||||||||||||
2078 | layout->addWidget(widget); never executed: layout->addWidget(widget); | 0 | ||||||||||||||||||||||||
2079 | else | - | ||||||||||||||||||||||||
2080 | widget->setParent(this); never executed: widget->setParent(this); | 0 | ||||||||||||||||||||||||
2081 | - | |||||||||||||||||||||||||
2082 | - | |||||||||||||||||||||||||
2083 | QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>(); | - | ||||||||||||||||||||||||
2084 | if (sizeGrip
| 0 | ||||||||||||||||||||||||
2085 | sizeGrip->installEventFilter(this); never executed: sizeGrip->installEventFilter(this); | 0 | ||||||||||||||||||||||||
2086 | if (d->sizeGrip
| 0 | ||||||||||||||||||||||||
2087 | d->sizeGrip->raise(); never executed: d->sizeGrip->raise(); | 0 | ||||||||||||||||||||||||
2088 | - | |||||||||||||||||||||||||
2089 | - | |||||||||||||||||||||||||
2090 | d->baseWidget = widget; | - | ||||||||||||||||||||||||
2091 | d->baseWidget->installEventFilter(this); | - | ||||||||||||||||||||||||
2092 | - | |||||||||||||||||||||||||
2093 | d->ignoreWindowTitleChange = true; | - | ||||||||||||||||||||||||
2094 | bool isWindowModified = this->isWindowModified(); | - | ||||||||||||||||||||||||
2095 | if (windowTitle().isEmpty()
| 0 | ||||||||||||||||||||||||
2096 | d->updateWindowTitle(true); | - | ||||||||||||||||||||||||
2097 | isWindowModified = d->baseWidget->isWindowModified(); | - | ||||||||||||||||||||||||
2098 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2099 | if (!this->isWindowModified()
| 0 | ||||||||||||||||||||||||
2100 | && windowTitle().contains(QLatin1String("[*]"))
| 0 | ||||||||||||||||||||||||
2101 | setWindowModified(isWindowModified); | - | ||||||||||||||||||||||||
2102 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2103 | d->lastChildWindowTitle = d->baseWidget->windowTitle(); | - | ||||||||||||||||||||||||
2104 | d->ignoreWindowTitleChange = false; | - | ||||||||||||||||||||||||
2105 | - | |||||||||||||||||||||||||
2106 | if (windowIcon().isNull()
| 0 | ||||||||||||||||||||||||
2107 | setWindowIcon(d->baseWidget->windowIcon()); never executed: setWindowIcon(d->baseWidget->windowIcon()); | 0 | ||||||||||||||||||||||||
2108 | - | |||||||||||||||||||||||||
2109 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2110 | if (!wasResized
| 0 | ||||||||||||||||||||||||
2111 | setAttribute(Qt::WA_Resized, false); never executed: setAttribute(Qt::WA_Resized, false); | 0 | ||||||||||||||||||||||||
2112 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2113 | - | |||||||||||||||||||||||||
2114 | - | |||||||||||||||||||||||||
2115 | - | |||||||||||||||||||||||||
2116 | - | |||||||||||||||||||||||||
2117 | - | |||||||||||||||||||||||||
2118 | - | |||||||||||||||||||||||||
2119 | QWidget *QMdiSubWindow::widget() const | - | ||||||||||||||||||||||||
2120 | { | - | ||||||||||||||||||||||||
2121 | return never executed: d_func()->baseWidget;return d_func()->baseWidget; never executed: return d_func()->baseWidget; | 0 | ||||||||||||||||||||||||
2122 | } | - | ||||||||||||||||||||||||
2123 | - | |||||||||||||||||||||||||
2124 | - | |||||||||||||||||||||||||
2125 | - | |||||||||||||||||||||||||
2126 | - | |||||||||||||||||||||||||
2127 | - | |||||||||||||||||||||||||
2128 | QWidget *QMdiSubWindow::maximizedButtonsWidget() const | - | ||||||||||||||||||||||||
2129 | { | - | ||||||||||||||||||||||||
2130 | const QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2131 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2132 | && !isChildOfTabbedQMdiArea(this)
| 0 | ||||||||||||||||||||||||
2133 | return never executed: d->controlContainer->controllerWidget();return d->controlContainer->controllerWidget(); never executed: return d->controlContainer->controllerWidget(); | 0 | ||||||||||||||||||||||||
2134 | } | - | ||||||||||||||||||||||||
2135 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
2136 | } | - | ||||||||||||||||||||||||
2137 | - | |||||||||||||||||||||||||
2138 | - | |||||||||||||||||||||||||
2139 | - | |||||||||||||||||||||||||
2140 | - | |||||||||||||||||||||||||
2141 | QWidget *QMdiSubWindow::maximizedSystemMenuIconWidget() const | - | ||||||||||||||||||||||||
2142 | { | - | ||||||||||||||||||||||||
2143 | const QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2144 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2145 | && !isChildOfTabbedQMdiArea(this)
| 0 | ||||||||||||||||||||||||
2146 | return never executed: d->controlContainer->systemMenuLabel();return d->controlContainer->systemMenuLabel(); never executed: return d->controlContainer->systemMenuLabel(); | 0 | ||||||||||||||||||||||||
2147 | } | - | ||||||||||||||||||||||||
2148 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
2149 | } | - | ||||||||||||||||||||||||
2150 | - | |||||||||||||||||||||||||
2151 | - | |||||||||||||||||||||||||
2152 | - | |||||||||||||||||||||||||
2153 | - | |||||||||||||||||||||||||
2154 | - | |||||||||||||||||||||||||
2155 | - | |||||||||||||||||||||||||
2156 | - | |||||||||||||||||||||||||
2157 | bool QMdiSubWindow::isShaded() const | - | ||||||||||||||||||||||||
2158 | { | - | ||||||||||||||||||||||||
2159 | return never executed: d_func()->isShadeMode;return d_func()->isShadeMode; never executed: return d_func()->isShadeMode; | 0 | ||||||||||||||||||||||||
2160 | } | - | ||||||||||||||||||||||||
2161 | - | |||||||||||||||||||||||||
2162 | - | |||||||||||||||||||||||||
2163 | - | |||||||||||||||||||||||||
2164 | - | |||||||||||||||||||||||||
2165 | - | |||||||||||||||||||||||||
2166 | - | |||||||||||||||||||||||||
2167 | - | |||||||||||||||||||||||||
2168 | void QMdiSubWindow::setOption(SubWindowOption option, bool on) | - | ||||||||||||||||||||||||
2169 | { | - | ||||||||||||||||||||||||
2170 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2171 | if (on
| 0 | ||||||||||||||||||||||||
2172 | d->options |= option; never executed: d->options |= option; | 0 | ||||||||||||||||||||||||
2173 | else if (!on
| 0 | ||||||||||||||||||||||||
2174 | d->options &= ~option; never executed: d->options &= ~option; | 0 | ||||||||||||||||||||||||
2175 | - | |||||||||||||||||||||||||
2176 | - | |||||||||||||||||||||||||
2177 | if ((
| 0 | ||||||||||||||||||||||||
2178 | d->leaveRubberBandMode(); never executed: d->leaveRubberBandMode(); | 0 | ||||||||||||||||||||||||
2179 | - | |||||||||||||||||||||||||
2180 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2181 | - | |||||||||||||||||||||||||
2182 | - | |||||||||||||||||||||||||
2183 | - | |||||||||||||||||||||||||
2184 | - | |||||||||||||||||||||||||
2185 | - | |||||||||||||||||||||||||
2186 | - | |||||||||||||||||||||||||
2187 | bool QMdiSubWindow::testOption(SubWindowOption option) const | - | ||||||||||||||||||||||||
2188 | { | - | ||||||||||||||||||||||||
2189 | return never executed: d_func()->options & option;return d_func()->options & option; never executed: return d_func()->options & option; | 0 | ||||||||||||||||||||||||
2190 | } | - | ||||||||||||||||||||||||
2191 | int QMdiSubWindow::keyboardSingleStep() const | - | ||||||||||||||||||||||||
2192 | { | - | ||||||||||||||||||||||||
2193 | return never executed: d_func()->keyboardSingleStep;return d_func()->keyboardSingleStep; never executed: return d_func()->keyboardSingleStep; | 0 | ||||||||||||||||||||||||
2194 | } | - | ||||||||||||||||||||||||
2195 | - | |||||||||||||||||||||||||
2196 | void QMdiSubWindow::setKeyboardSingleStep(int step) | - | ||||||||||||||||||||||||
2197 | { | - | ||||||||||||||||||||||||
2198 | - | |||||||||||||||||||||||||
2199 | - | |||||||||||||||||||||||||
2200 | - | |||||||||||||||||||||||||
2201 | d_func()->keyboardSingleStep = step; | - | ||||||||||||||||||||||||
2202 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2203 | int QMdiSubWindow::keyboardPageStep() const | - | ||||||||||||||||||||||||
2204 | { | - | ||||||||||||||||||||||||
2205 | return never executed: d_func()->keyboardPageStep;return d_func()->keyboardPageStep; never executed: return d_func()->keyboardPageStep; | 0 | ||||||||||||||||||||||||
2206 | } | - | ||||||||||||||||||||||||
2207 | - | |||||||||||||||||||||||||
2208 | void QMdiSubWindow::setKeyboardPageStep(int step) | - | ||||||||||||||||||||||||
2209 | { | - | ||||||||||||||||||||||||
2210 | - | |||||||||||||||||||||||||
2211 | - | |||||||||||||||||||||||||
2212 | - | |||||||||||||||||||||||||
2213 | d_func()->keyboardPageStep = step; | - | ||||||||||||||||||||||||
2214 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2215 | void QMdiSubWindow::setSystemMenu(QMenu *systemMenu) | - | ||||||||||||||||||||||||
2216 | { | - | ||||||||||||||||||||||||
2217 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2218 | if (systemMenu
| 0 | ||||||||||||||||||||||||
2219 | QMessageLogger(__FILE__, 2509, __PRETTY_FUNCTION__).warning("QMdiSubWindow::setSystemMenu: system menu is already set"); | - | ||||||||||||||||||||||||
2220 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2221 | } | - | ||||||||||||||||||||||||
2222 | - | |||||||||||||||||||||||||
2223 | if (d->systemMenu
| 0 | ||||||||||||||||||||||||
2224 | delete d->systemMenu; | - | ||||||||||||||||||||||||
2225 | d->systemMenu = 0; | - | ||||||||||||||||||||||||
2226 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2227 | - | |||||||||||||||||||||||||
2228 | if (!systemMenu
| 0 | ||||||||||||||||||||||||
2229 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2230 | - | |||||||||||||||||||||||||
2231 | if (systemMenu->parent() != this
| 0 | ||||||||||||||||||||||||
2232 | systemMenu->setParent(this); never executed: systemMenu->setParent(this); | 0 | ||||||||||||||||||||||||
2233 | d->systemMenu = systemMenu; | - | ||||||||||||||||||||||||
2234 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2235 | QMenu *QMdiSubWindow::systemMenu() const | - | ||||||||||||||||||||||||
2236 | { | - | ||||||||||||||||||||||||
2237 | return never executed: d_func()->systemMenu;return d_func()->systemMenu; never executed: return d_func()->systemMenu; | 0 | ||||||||||||||||||||||||
2238 | } | - | ||||||||||||||||||||||||
2239 | - | |||||||||||||||||||||||||
2240 | - | |||||||||||||||||||||||||
2241 | - | |||||||||||||||||||||||||
2242 | - | |||||||||||||||||||||||||
2243 | - | |||||||||||||||||||||||||
2244 | - | |||||||||||||||||||||||||
2245 | void QMdiSubWindow::showSystemMenu() | - | ||||||||||||||||||||||||
2246 | { | - | ||||||||||||||||||||||||
2247 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2248 | if (!d->systemMenu
| 0 | ||||||||||||||||||||||||
2249 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2250 | - | |||||||||||||||||||||||||
2251 | QPoint globalPopupPos; | - | ||||||||||||||||||||||||
2252 | if (QWidget *icon = maximizedSystemMenuIconWidget()
| 0 | ||||||||||||||||||||||||
2253 | if (isLeftToRight()
| 0 | ||||||||||||||||||||||||
2254 | globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height())); never executed: globalPopupPos = icon->mapToGlobal(QPoint(0, icon->y() + icon->height())); | 0 | ||||||||||||||||||||||||
2255 | else | - | ||||||||||||||||||||||||
2256 | globalPopupPos = icon->mapToGlobal(QPoint(icon->width(), icon->y() + icon->height())); never executed: globalPopupPos = icon->mapToGlobal(QPoint(icon->width(), icon->y() + icon->height())); | 0 | ||||||||||||||||||||||||
2257 | } else { | - | ||||||||||||||||||||||||
2258 | if (isLeftToRight()
| 0 | ||||||||||||||||||||||||
2259 | globalPopupPos = mapToGlobal(contentsRect().topLeft()); never executed: globalPopupPos = mapToGlobal(contentsRect().topLeft()); | 0 | ||||||||||||||||||||||||
2260 | else | - | ||||||||||||||||||||||||
2261 | globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0); never executed: globalPopupPos = mapToGlobal(contentsRect().topRight()) + QPoint(1, 0); | 0 | ||||||||||||||||||||||||
2262 | } | - | ||||||||||||||||||||||||
2263 | - | |||||||||||||||||||||||||
2264 | - | |||||||||||||||||||||||||
2265 | if (isRightToLeft()
| 0 | ||||||||||||||||||||||||
2266 | globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0); never executed: globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0); | 0 | ||||||||||||||||||||||||
2267 | d->systemMenu->popup(globalPopupPos); | - | ||||||||||||||||||||||||
2268 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2269 | QMdiArea *QMdiSubWindow::mdiArea() const | - | ||||||||||||||||||||||||
2270 | { | - | ||||||||||||||||||||||||
2271 | QWidget *parent = parentWidget(); | - | ||||||||||||||||||||||||
2272 | while (parent
| 0 | ||||||||||||||||||||||||
2273 | if (QMdiArea *area = qobject_cast<QMdiArea *>(parent)
| 0 | ||||||||||||||||||||||||
2274 | if (area->viewport() == parentWidget()
| 0 | ||||||||||||||||||||||||
2275 | return never executed: area;return area; never executed: return area; | 0 | ||||||||||||||||||||||||
2276 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2277 | parent = parent->parentWidget(); | - | ||||||||||||||||||||||||
2278 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2279 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
2280 | } | - | ||||||||||||||||||||||||
2281 | void QMdiSubWindow::showShaded() | - | ||||||||||||||||||||||||
2282 | { | - | ||||||||||||||||||||||||
2283 | if (!parent()
| 0 | ||||||||||||||||||||||||
2284 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2285 | - | |||||||||||||||||||||||||
2286 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2287 | - | |||||||||||||||||||||||||
2288 | if (!d->isShadeRequestFromMinimizeMode
| 0 | ||||||||||||||||||||||||
2289 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2290 | - | |||||||||||||||||||||||||
2291 | d->isMaximizeMode = false; | - | ||||||||||||||||||||||||
2292 | - | |||||||||||||||||||||||||
2293 | d->storeFocusWidget(); | - | ||||||||||||||||||||||||
2294 | - | |||||||||||||||||||||||||
2295 | if (!d->isShadeRequestFromMinimizeMode
| 0 | ||||||||||||||||||||||||
2296 | d->isShadeMode = true; | - | ||||||||||||||||||||||||
2297 | d->ensureWindowState(Qt::WindowMinimized); | - | ||||||||||||||||||||||||
2298 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2299 | - | |||||||||||||||||||||||||
2300 | - | |||||||||||||||||||||||||
2301 | d->removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
2302 | - | |||||||||||||||||||||||||
2303 | - | |||||||||||||||||||||||||
2304 | - | |||||||||||||||||||||||||
2305 | - | |||||||||||||||||||||||||
2306 | - | |||||||||||||||||||||||||
2307 | if (hasFocus()
| 0 | ||||||||||||||||||||||||
2308 | d->ensureWindowState(Qt::WindowActive); never executed: d->ensureWindowState(Qt::WindowActive); | 0 | ||||||||||||||||||||||||
2309 | - | |||||||||||||||||||||||||
2310 | - | |||||||||||||||||||||||||
2311 | d->setSizeGripVisible(false); | - | ||||||||||||||||||||||||
2312 | - | |||||||||||||||||||||||||
2313 | - | |||||||||||||||||||||||||
2314 | if (!d->restoreSize.isValid()
| 0 | ||||||||||||||||||||||||
2315 | d->oldGeometry = geometry(); | - | ||||||||||||||||||||||||
2316 | d->restoreSize.setWidth(d->oldGeometry.width()); | - | ||||||||||||||||||||||||
2317 | d->restoreSize.setHeight(d->oldGeometry.height()); | - | ||||||||||||||||||||||||
2318 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2319 | - | |||||||||||||||||||||||||
2320 | - | |||||||||||||||||||||||||
2321 | - | |||||||||||||||||||||||||
2322 | const bool wasVisible = isVisible(); | - | ||||||||||||||||||||||||
2323 | if (wasVisible
| 0 | ||||||||||||||||||||||||
2324 | setVisible(false); never executed: setVisible(false); | 0 | ||||||||||||||||||||||||
2325 | - | |||||||||||||||||||||||||
2326 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2327 | - | |||||||||||||||||||||||||
2328 | if (!minimumSize().isNull()
| 0 | ||||||||||||||||||||||||
2329 | d->userMinimumSize = minimumSize(); | - | ||||||||||||||||||||||||
2330 | setMinimumSize(d->internalMinimumSize); | - | ||||||||||||||||||||||||
2331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2332 | resize(d->internalMinimumSize); | - | ||||||||||||||||||||||||
2333 | - | |||||||||||||||||||||||||
2334 | - | |||||||||||||||||||||||||
2335 | if (d->baseWidget
| 0 | ||||||||||||||||||||||||
2336 | d->baseWidget->hide(); | - | ||||||||||||||||||||||||
2337 | d->isWidgetHiddenByUs = true; | - | ||||||||||||||||||||||||
2338 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2339 | - | |||||||||||||||||||||||||
2340 | if (wasVisible
| 0 | ||||||||||||||||||||||||
2341 | setVisible(true); never executed: setVisible(true); | 0 | ||||||||||||||||||||||||
2342 | - | |||||||||||||||||||||||||
2343 | d->setFocusWidget(); | - | ||||||||||||||||||||||||
2344 | d->resizeEnabled = false; | - | ||||||||||||||||||||||||
2345 | d->moveEnabled = true; | - | ||||||||||||||||||||||||
2346 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2347 | d->updateMask(); | - | ||||||||||||||||||||||||
2348 | - | |||||||||||||||||||||||||
2349 | - | |||||||||||||||||||||||||
2350 | d->setEnabled(QMdiSubWindowPrivate::MinimizeAction, false); | - | ||||||||||||||||||||||||
2351 | d->setEnabled(QMdiSubWindowPrivate::ResizeAction, d->resizeEnabled); | - | ||||||||||||||||||||||||
2352 | d->setEnabled(QMdiSubWindowPrivate::MaximizeAction, true); | - | ||||||||||||||||||||||||
2353 | d->setEnabled(QMdiSubWindowPrivate::RestoreAction, true); | - | ||||||||||||||||||||||||
2354 | d->setEnabled(QMdiSubWindowPrivate::MoveAction, d->moveEnabled); | - | ||||||||||||||||||||||||
2355 | - | |||||||||||||||||||||||||
2356 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2357 | - | |||||||||||||||||||||||||
2358 | - | |||||||||||||||||||||||||
2359 | - | |||||||||||||||||||||||||
2360 | - | |||||||||||||||||||||||||
2361 | bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event) | - | ||||||||||||||||||||||||
2362 | { | - | ||||||||||||||||||||||||
2363 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2364 | if (!object
| 0 | ||||||||||||||||||||||||
2365 | return never executed: QWidget::eventFilter(object, event);return QWidget::eventFilter(object, event); never executed: return QWidget::eventFilter(object, event); | 0 | ||||||||||||||||||||||||
2366 | - | |||||||||||||||||||||||||
2367 | - | |||||||||||||||||||||||||
2368 | - | |||||||||||||||||||||||||
2369 | if (d->systemMenu
| 0 | ||||||||||||||||||||||||
2370 | if (event->type() == QEvent::MouseButtonDblClick
| 0 | ||||||||||||||||||||||||
2371 | const QMouseEvent *mouseEvent = static_cast<const QMouseEvent *>(event); | - | ||||||||||||||||||||||||
2372 | const QAction *action = d->systemMenu->actionAt(mouseEvent->pos()); | - | ||||||||||||||||||||||||
2373 | if (!action
| 0 | ||||||||||||||||||||||||
2374 | close(); never executed: close(); | 0 | ||||||||||||||||||||||||
2375 | } never executed: else if (event->type() == QEvent::MouseMoveend of block
| 0 | ||||||||||||||||||||||||
2376 | QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); | - | ||||||||||||||||||||||||
2377 | d->hoveredSubControl = d->getSubControl(mapFromGlobal(mouseEvent->globalPos())); | - | ||||||||||||||||||||||||
2378 | } never executed: else if (event->type() == QEvent::Hideend of block
| 0 | ||||||||||||||||||||||||
2379 | d->activeSubControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
2380 | update(QRegion(0, 0, width(), d->titleBarHeight())); | - | ||||||||||||||||||||||||
2381 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2382 | return never executed: QWidget::eventFilter(object, event);return QWidget::eventFilter(object, event); never executed: return QWidget::eventFilter(object, event); | 0 | ||||||||||||||||||||||||
2383 | } | - | ||||||||||||||||||||||||
2384 | - | |||||||||||||||||||||||||
2385 | - | |||||||||||||||||||||||||
2386 | - | |||||||||||||||||||||||||
2387 | if (object != d->baseWidget
| 0 | ||||||||||||||||||||||||
2388 | if (event->type() != QEvent::MouseButtonPress
| 0 | ||||||||||||||||||||||||
2389 | return never executed: QWidget::eventFilter(object, event);return QWidget::eventFilter(object, event); never executed: return QWidget::eventFilter(object, event); | 0 | ||||||||||||||||||||||||
2390 | const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); | - | ||||||||||||||||||||||||
2391 | d->mousePressPosition = parentWidget()->mapFromGlobal(mouseEvent->globalPos()); | - | ||||||||||||||||||||||||
2392 | d->oldGeometry = geometry(); | - | ||||||||||||||||||||||||
2393 | d->currentOperation = isLeftToRight()
| 0 | ||||||||||||||||||||||||
2394 | : QMdiSubWindowPrivate::BottomLeftResize; | - | ||||||||||||||||||||||||
2395 | - | |||||||||||||||||||||||||
2396 | d->enterRubberBandMode(); | - | ||||||||||||||||||||||||
2397 | - | |||||||||||||||||||||||||
2398 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
2399 | } | - | ||||||||||||||||||||||||
2400 | - | |||||||||||||||||||||||||
2401 | - | |||||||||||||||||||||||||
2402 | if (object != d->baseWidget
| 0 | ||||||||||||||||||||||||
2403 | return never executed: QWidget::eventFilter(object, event);return QWidget::eventFilter(object, event); never executed: return QWidget::eventFilter(object, event); | 0 | ||||||||||||||||||||||||
2404 | - | |||||||||||||||||||||||||
2405 | switch (event->type()) { | - | ||||||||||||||||||||||||
2406 | case never executed: QEvent::Show:case QEvent::Show: never executed: case QEvent::Show: | 0 | ||||||||||||||||||||||||
2407 | d->setActive(true); | - | ||||||||||||||||||||||||
2408 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2409 | case never executed: QEvent::ShowToParent:case QEvent::ShowToParent: never executed: case QEvent::ShowToParent: | 0 | ||||||||||||||||||||||||
2410 | if (!d->isWidgetHiddenByUs
| 0 | ||||||||||||||||||||||||
2411 | show(); never executed: show(); | 0 | ||||||||||||||||||||||||
2412 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2413 | case never executed: QEvent::WindowStateChange:case QEvent::WindowStateChange: never executed: {case QEvent::WindowStateChange: | 0 | ||||||||||||||||||||||||
2414 | QWindowStateChangeEvent *changeEvent = static_cast<QWindowStateChangeEvent*>(event); | - | ||||||||||||||||||||||||
2415 | if (changeEvent->isOverride()
| 0 | ||||||||||||||||||||||||
2416 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2417 | Qt::WindowStates oldState = changeEvent->oldState(); | - | ||||||||||||||||||||||||
2418 | Qt::WindowStates newState = d->baseWidget->windowState(); | - | ||||||||||||||||||||||||
2419 | if (!(oldState & Qt::WindowMinimized)
| 0 | ||||||||||||||||||||||||
2420 | showMinimized(); never executed: showMinimized(); | 0 | ||||||||||||||||||||||||
2421 | else if (!(oldState & Qt::WindowMaximized)
| 0 | ||||||||||||||||||||||||
2422 | showMaximized(); never executed: showMaximized(); | 0 | ||||||||||||||||||||||||
2423 | else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized | Qt::WindowFullScreen))
| 0 | ||||||||||||||||||||||||
2424 | showNormal(); never executed: showNormal(); | 0 | ||||||||||||||||||||||||
2425 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2426 | } | - | ||||||||||||||||||||||||
2427 | case never executed: QEvent::Enter:case QEvent::Enter: never executed: case QEvent::Enter: | 0 | ||||||||||||||||||||||||
2428 | d->currentOperation = QMdiSubWindowPrivate::None; | - | ||||||||||||||||||||||||
2429 | d->updateCursor(); | - | ||||||||||||||||||||||||
2430 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2431 | case never executed: QEvent::LayoutRequest:case QEvent::LayoutRequest: never executed: case QEvent::LayoutRequest: | 0 | ||||||||||||||||||||||||
2432 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2433 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2434 | case never executed: QEvent::WindowTitleChange:case QEvent::WindowTitleChange: never executed: case QEvent::WindowTitleChange: | 0 | ||||||||||||||||||||||||
2435 | if (d->ignoreWindowTitleChange
| 0 | ||||||||||||||||||||||||
2436 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2437 | if (object == d->baseWidget
| 0 | ||||||||||||||||||||||||
2438 | d->updateWindowTitle(true); | - | ||||||||||||||||||||||||
2439 | d->lastChildWindowTitle = d->baseWidget->windowTitle(); | - | ||||||||||||||||||||||||
2440 | - | |||||||||||||||||||||||||
2441 | } never executed: else if (maximizedButtonsWidget()end of block
| 0 | ||||||||||||||||||||||||
2442 | ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
| 0 | ||||||||||||||||||||||||
2443 | d->originalTitle = QString::null; | - | ||||||||||||||||||||||||
2444 | if (d->baseWidget
| 0 | ||||||||||||||||||||||||
2445 | d->updateWindowTitle(true); never executed: d->updateWindowTitle(true); | 0 | ||||||||||||||||||||||||
2446 | else | - | ||||||||||||||||||||||||
2447 | d->updateWindowTitle(false); never executed: d->updateWindowTitle(false); | 0 | ||||||||||||||||||||||||
2448 | - | |||||||||||||||||||||||||
2449 | } | - | ||||||||||||||||||||||||
2450 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2451 | case never executed: QEvent::ModifiedChange:case QEvent::ModifiedChange: never executed: {case QEvent::ModifiedChange: | 0 | ||||||||||||||||||||||||
2452 | if (object != d->baseWidget
| 0 | ||||||||||||||||||||||||
2453 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2454 | bool windowModified = d->baseWidget->isWindowModified(); | - | ||||||||||||||||||||||||
2455 | if (!windowModified
| 0 | ||||||||||||||||||||||||
2456 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2457 | if (windowTitle().contains(QLatin1String("[*]"))
| 0 | ||||||||||||||||||||||||
2458 | setWindowModified(windowModified); never executed: setWindowModified(windowModified); | 0 | ||||||||||||||||||||||||
2459 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2460 | } | - | ||||||||||||||||||||||||
2461 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2462 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2463 | } | - | ||||||||||||||||||||||||
2464 | return never executed: QWidget::eventFilter(object, event);return QWidget::eventFilter(object, event); never executed: return QWidget::eventFilter(object, event); | 0 | ||||||||||||||||||||||||
2465 | } | - | ||||||||||||||||||||||||
2466 | - | |||||||||||||||||||||||||
2467 | - | |||||||||||||||||||||||||
2468 | - | |||||||||||||||||||||||||
2469 | - | |||||||||||||||||||||||||
2470 | bool QMdiSubWindow::event(QEvent *event) | - | ||||||||||||||||||||||||
2471 | { | - | ||||||||||||||||||||||||
2472 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2473 | switch (event->type()) { | - | ||||||||||||||||||||||||
2474 | case never executed: QEvent::StyleChange:case QEvent::StyleChange: never executed: {case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||
2475 | bool wasShaded = isShaded(); | - | ||||||||||||||||||||||||
2476 | bool wasMinimized = isMinimized(); | - | ||||||||||||||||||||||||
2477 | bool wasMaximized = isMaximized(); | - | ||||||||||||||||||||||||
2478 | - | |||||||||||||||||||||||||
2479 | const QScopedValueRollback<bool> activationEnabledSaver(d->activationEnabled); | - | ||||||||||||||||||||||||
2480 | d->activationEnabled = false; | - | ||||||||||||||||||||||||
2481 | - | |||||||||||||||||||||||||
2482 | ensurePolished(); | - | ||||||||||||||||||||||||
2483 | setContentsMargins(0, 0, 0, 0); | - | ||||||||||||||||||||||||
2484 | if (wasMinimized
| 0 | ||||||||||||||||||||||||
2485 | showNormal(); never executed: showNormal(); | 0 | ||||||||||||||||||||||||
2486 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2487 | resize(d->internalMinimumSize.expandedTo(size())); | - | ||||||||||||||||||||||||
2488 | d->updateMask(); | - | ||||||||||||||||||||||||
2489 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2490 | if (wasShaded
| 0 | ||||||||||||||||||||||||
2491 | showShaded(); never executed: showShaded(); | 0 | ||||||||||||||||||||||||
2492 | else if (wasMinimized
| 0 | ||||||||||||||||||||||||
2493 | showMinimized(); never executed: showMinimized(); | 0 | ||||||||||||||||||||||||
2494 | else if (wasMaximized
| 0 | ||||||||||||||||||||||||
2495 | showMaximized(); never executed: showMaximized(); | 0 | ||||||||||||||||||||||||
2496 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2497 | } | - | ||||||||||||||||||||||||
2498 | case never executed: QEvent::ParentAboutToChange:case QEvent::ParentAboutToChange: never executed: case QEvent::ParentAboutToChange: | 0 | ||||||||||||||||||||||||
2499 | d->setActive(false); | - | ||||||||||||||||||||||||
2500 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2501 | case never executed: QEvent::ParentChange:case QEvent::ParentChange: never executed: {case QEvent::ParentChange: | 0 | ||||||||||||||||||||||||
2502 | bool wasResized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||
2503 | - | |||||||||||||||||||||||||
2504 | d->removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
2505 | - | |||||||||||||||||||||||||
2506 | d->currentOperation = QMdiSubWindowPrivate::None; | - | ||||||||||||||||||||||||
2507 | d->activeSubControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
2508 | d->hoveredSubControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
2509 | - | |||||||||||||||||||||||||
2510 | if (d->isInRubberBandMode
| 0 | ||||||||||||||||||||||||
2511 | d->leaveRubberBandMode(); never executed: d->leaveRubberBandMode(); | 0 | ||||||||||||||||||||||||
2512 | - | |||||||||||||||||||||||||
2513 | d->isShadeMode = false; | - | ||||||||||||||||||||||||
2514 | d->isMaximizeMode = false; | - | ||||||||||||||||||||||||
2515 | d->isWidgetHiddenByUs = false; | - | ||||||||||||||||||||||||
2516 | if (!parent()
| 0 | ||||||||||||||||||||||||
2517 | - | |||||||||||||||||||||||||
2518 | - | |||||||||||||||||||||||||
2519 | - | |||||||||||||||||||||||||
2520 | - | |||||||||||||||||||||||||
2521 | setOption(RubberBandResize, false); | - | ||||||||||||||||||||||||
2522 | setOption(RubberBandMove, false); | - | ||||||||||||||||||||||||
2523 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2524 | d->setWindowFlags(windowFlags()); | - | ||||||||||||||||||||||||
2525 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2526 | setContentsMargins(0, 0, 0, 0); | - | ||||||||||||||||||||||||
2527 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2528 | d->updateCursor(); | - | ||||||||||||||||||||||||
2529 | d->updateMask(); | - | ||||||||||||||||||||||||
2530 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2531 | d->updateActions(); | - | ||||||||||||||||||||||||
2532 | if (!wasResized
| 0 | ||||||||||||||||||||||||
2533 | setAttribute(Qt::WA_Resized, false); never executed: setAttribute(Qt::WA_Resized, false); | 0 | ||||||||||||||||||||||||
2534 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2535 | } | - | ||||||||||||||||||||||||
2536 | case never executed: QEvent::WindowActivate:case QEvent::WindowActivate: never executed: case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||
2537 | if (d->ignoreNextActivationEvent
| 0 | ||||||||||||||||||||||||
2538 | d->ignoreNextActivationEvent = false; | - | ||||||||||||||||||||||||
2539 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2540 | } | - | ||||||||||||||||||||||||
2541 | d->isExplicitlyDeactivated = false; | - | ||||||||||||||||||||||||
2542 | d->setActive(true); | - | ||||||||||||||||||||||||
2543 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2544 | case never executed: QEvent::WindowDeactivate:case QEvent::WindowDeactivate: never executed: case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||
2545 | if (d->ignoreNextActivationEvent
| 0 | ||||||||||||||||||||||||
2546 | d->ignoreNextActivationEvent = false; | - | ||||||||||||||||||||||||
2547 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2548 | } | - | ||||||||||||||||||||||||
2549 | d->isExplicitlyDeactivated = true; | - | ||||||||||||||||||||||||
2550 | d->setActive(false); | - | ||||||||||||||||||||||||
2551 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2552 | case never executed: QEvent::WindowTitleChange:case QEvent::WindowTitleChange: never executed: case QEvent::WindowTitleChange: | 0 | ||||||||||||||||||||||||
2553 | if (!d->ignoreWindowTitleChange
| 0 | ||||||||||||||||||||||||
2554 | d->updateWindowTitle(false); never executed: d->updateWindowTitle(false); | 0 | ||||||||||||||||||||||||
2555 | d->updateInternalWindowTitle(); | - | ||||||||||||||||||||||||
2556 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2557 | case never executed: QEvent::ModifiedChange:case QEvent::ModifiedChange: never executed: case QEvent::ModifiedChange: | 0 | ||||||||||||||||||||||||
2558 | if (!windowTitle().contains(QLatin1String("[*]"))
| 0 | ||||||||||||||||||||||||
2559 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2560 | - | |||||||||||||||||||||||||
2561 | if (maximizedButtonsWidget()
| 0 | ||||||||||||||||||||||||
2562 | ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()
| 0 | ||||||||||||||||||||||||
2563 | window()->setWindowModified(isWindowModified()); | - | ||||||||||||||||||||||||
2564 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2565 | - | |||||||||||||||||||||||||
2566 | d->updateInternalWindowTitle(); | - | ||||||||||||||||||||||||
2567 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2568 | case never executed: QEvent::LayoutDirectionChange:case QEvent::LayoutDirectionChange: never executed: case QEvent::LayoutDirectionChange: | 0 | ||||||||||||||||||||||||
2569 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2570 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2571 | case never executed: QEvent::LayoutRequest:case QEvent::LayoutRequest: never executed: case QEvent::LayoutRequest: | 0 | ||||||||||||||||||||||||
2572 | d->updateGeometryConstraints(); | - | ||||||||||||||||||||||||
2573 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2574 | case never executed: QEvent::WindowIconChange:case QEvent::WindowIconChange: never executed: case QEvent::WindowIconChange: | 0 | ||||||||||||||||||||||||
2575 | d->menuIcon = windowIcon(); | - | ||||||||||||||||||||||||
2576 | if (d->menuIcon.isNull()
| 0 | ||||||||||||||||||||||||
2577 | d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this); never executed: d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this); | 0 | ||||||||||||||||||||||||
2578 | if (d->controlContainer
| 0 | ||||||||||||||||||||||||
2579 | d->controlContainer->updateWindowIcon(d->menuIcon); never executed: d->controlContainer->updateWindowIcon(d->menuIcon); | 0 | ||||||||||||||||||||||||
2580 | if (!maximizedSystemMenuIconWidget()
| 0 | ||||||||||||||||||||||||
2581 | update(0, 0, width(), d->titleBarHeight()); never executed: update(0, 0, width(), d->titleBarHeight()); | 0 | ||||||||||||||||||||||||
2582 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2583 | case never executed: QEvent::PaletteChange:case QEvent::PaletteChange: never executed: case QEvent::PaletteChange: | 0 | ||||||||||||||||||||||||
2584 | d->titleBarPalette = d->desktopPalette(); | - | ||||||||||||||||||||||||
2585 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2586 | case never executed: QEvent::FontChange:case QEvent::FontChange: never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||
2587 | d->font = font(); | - | ||||||||||||||||||||||||
2588 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2589 | - | |||||||||||||||||||||||||
2590 | case never executed: QEvent::ToolTip:case QEvent::ToolTip: never executed: case QEvent::ToolTip: | 0 | ||||||||||||||||||||||||
2591 | showToolTip(static_cast<QHelpEvent *>(event), this, d->titleBarOptions(), | - | ||||||||||||||||||||||||
2592 | QStyle::CC_TitleBar, d->hoveredSubControl); | - | ||||||||||||||||||||||||
2593 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2594 | - | |||||||||||||||||||||||||
2595 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2596 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2597 | } | - | ||||||||||||||||||||||||
2598 | return never executed: QWidget::event(event);return QWidget::event(event); never executed: return QWidget::event(event); | 0 | ||||||||||||||||||||||||
2599 | } | - | ||||||||||||||||||||||||
2600 | - | |||||||||||||||||||||||||
2601 | - | |||||||||||||||||||||||||
2602 | - | |||||||||||||||||||||||||
2603 | - | |||||||||||||||||||||||||
2604 | void QMdiSubWindow::showEvent(QShowEvent *showEvent) | - | ||||||||||||||||||||||||
2605 | { | - | ||||||||||||||||||||||||
2606 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2607 | if (!parent()
| 0 | ||||||||||||||||||||||||
2608 | QWidget::showEvent(showEvent); | - | ||||||||||||||||||||||||
2609 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2610 | } | - | ||||||||||||||||||||||||
2611 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2612 | - | |||||||||||||||||||||||||
2613 | - | |||||||||||||||||||||||||
2614 | - | |||||||||||||||||||||||||
2615 | if (d->controlContainer
| 0 | ||||||||||||||||||||||||
2616 | if (QMenuBar *menuBar = d->menuBar()
| 0 | ||||||||||||||||||||||||
2617 | if (menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget()
| 0 | ||||||||||||||||||||||||
2618 | d->showButtonsInMenuBar(menuBar); never executed: d->showButtonsInMenuBar(menuBar); | 0 | ||||||||||||||||||||||||
2619 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2620 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2621 | - | |||||||||||||||||||||||||
2622 | d->setActive(true); | - | ||||||||||||||||||||||||
2623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2624 | - | |||||||||||||||||||||||||
2625 | - | |||||||||||||||||||||||||
2626 | - | |||||||||||||||||||||||||
2627 | - | |||||||||||||||||||||||||
2628 | void QMdiSubWindow::hideEvent(QHideEvent * ) | - | ||||||||||||||||||||||||
2629 | { | - | ||||||||||||||||||||||||
2630 | - | |||||||||||||||||||||||||
2631 | d_func()->removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
2632 | - | |||||||||||||||||||||||||
2633 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2634 | - | |||||||||||||||||||||||||
2635 | - | |||||||||||||||||||||||||
2636 | - | |||||||||||||||||||||||||
2637 | - | |||||||||||||||||||||||||
2638 | void QMdiSubWindow::changeEvent(QEvent *changeEvent) | - | ||||||||||||||||||||||||
2639 | { | - | ||||||||||||||||||||||||
2640 | if (!parent()
| 0 | ||||||||||||||||||||||||
2641 | QWidget::changeEvent(changeEvent); | - | ||||||||||||||||||||||||
2642 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2643 | } | - | ||||||||||||||||||||||||
2644 | - | |||||||||||||||||||||||||
2645 | if (changeEvent->type() != QEvent::WindowStateChange
| 0 | ||||||||||||||||||||||||
2646 | QWidget::changeEvent(changeEvent); | - | ||||||||||||||||||||||||
2647 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2648 | } | - | ||||||||||||||||||||||||
2649 | - | |||||||||||||||||||||||||
2650 | QWindowStateChangeEvent *event = static_cast<QWindowStateChangeEvent *>(changeEvent); | - | ||||||||||||||||||||||||
2651 | if (event->isOverride()
| 0 | ||||||||||||||||||||||||
2652 | event->ignore(); | - | ||||||||||||||||||||||||
2653 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2654 | } | - | ||||||||||||||||||||||||
2655 | - | |||||||||||||||||||||||||
2656 | Qt::WindowStates oldState = event->oldState(); | - | ||||||||||||||||||||||||
2657 | Qt::WindowStates newState = windowState(); | - | ||||||||||||||||||||||||
2658 | if (oldState == newState
| 0 | ||||||||||||||||||||||||
2659 | changeEvent->ignore(); | - | ||||||||||||||||||||||||
2660 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2661 | } | - | ||||||||||||||||||||||||
2662 | - | |||||||||||||||||||||||||
2663 | - | |||||||||||||||||||||||||
2664 | - | |||||||||||||||||||||||||
2665 | - | |||||||||||||||||||||||||
2666 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2667 | if (!isVisible()
| 0 | ||||||||||||||||||||||||
2668 | d->ensureWindowState(Qt::WindowNoState); | - | ||||||||||||||||||||||||
2669 | setVisible(true); | - | ||||||||||||||||||||||||
2670 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2671 | - | |||||||||||||||||||||||||
2672 | if (!d->oldGeometry.isValid()
| 0 | ||||||||||||||||||||||||
2673 | d->oldGeometry = geometry(); never executed: d->oldGeometry = geometry(); | 0 | ||||||||||||||||||||||||
2674 | - | |||||||||||||||||||||||||
2675 | if ((
| 0 | ||||||||||||||||||||||||
2676 | d->currentOperation = QMdiSubWindowPrivate::None; never executed: d->currentOperation = QMdiSubWindowPrivate::None; | 0 | ||||||||||||||||||||||||
2677 | - | |||||||||||||||||||||||||
2678 | if (!(oldState & Qt::WindowMinimized)
| 0 | ||||||||||||||||||||||||
2679 | d->setMinimizeMode(); never executed: d->setMinimizeMode(); | 0 | ||||||||||||||||||||||||
2680 | else if (!(oldState & Qt::WindowMaximized)
| 0 | ||||||||||||||||||||||||
2681 | d->setMaximizeMode(); never executed: d->setMaximizeMode(); | 0 | ||||||||||||||||||||||||
2682 | else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized | Qt::WindowFullScreen))
| 0 | ||||||||||||||||||||||||
2683 | d->setNormalMode(); never executed: d->setNormalMode(); | 0 | ||||||||||||||||||||||||
2684 | - | |||||||||||||||||||||||||
2685 | if (d->isActive
| 0 | ||||||||||||||||||||||||
2686 | d->ensureWindowState(Qt::WindowActive); never executed: d->ensureWindowState(Qt::WindowActive); | 0 | ||||||||||||||||||||||||
2687 | if (d->activationEnabled
| 0 | ||||||||||||||||||||||||
2688 | windowStateChanged(oldState, windowState()); never executed: windowStateChanged(oldState, windowState()); | 0 | ||||||||||||||||||||||||
2689 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2690 | - | |||||||||||||||||||||||||
2691 | - | |||||||||||||||||||||||||
2692 | - | |||||||||||||||||||||||||
2693 | - | |||||||||||||||||||||||||
2694 | void QMdiSubWindow::closeEvent(QCloseEvent *closeEvent) | - | ||||||||||||||||||||||||
2695 | { | - | ||||||||||||||||||||||||
2696 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2697 | bool acceptClose = true; | - | ||||||||||||||||||||||||
2698 | if (d->baseWidget
| 0 | ||||||||||||||||||||||||
2699 | acceptClose = d->baseWidget->close(); never executed: acceptClose = d->baseWidget->close(); | 0 | ||||||||||||||||||||||||
2700 | if (!acceptClose
| 0 | ||||||||||||||||||||||||
2701 | closeEvent->ignore(); | - | ||||||||||||||||||||||||
2702 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2703 | } | - | ||||||||||||||||||||||||
2704 | - | |||||||||||||||||||||||||
2705 | d->removeButtonsFromMenuBar(); | - | ||||||||||||||||||||||||
2706 | - | |||||||||||||||||||||||||
2707 | d->setActive(false); | - | ||||||||||||||||||||||||
2708 | if (parentWidget()
| 0 | ||||||||||||||||||||||||
2709 | QChildEvent childRemoved(QEvent::ChildRemoved, this); | - | ||||||||||||||||||||||||
2710 | QApplication::sendEvent(parentWidget(), &childRemoved); | - | ||||||||||||||||||||||||
2711 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2712 | closeEvent->accept(); | - | ||||||||||||||||||||||||
2713 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2714 | - | |||||||||||||||||||||||||
2715 | - | |||||||||||||||||||||||||
2716 | - | |||||||||||||||||||||||||
2717 | - | |||||||||||||||||||||||||
2718 | void QMdiSubWindow::leaveEvent(QEvent * ) | - | ||||||||||||||||||||||||
2719 | { | - | ||||||||||||||||||||||||
2720 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2721 | if (d->hoveredSubControl != QStyle::SC_None
| 0 | ||||||||||||||||||||||||
2722 | d->hoveredSubControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
2723 | update(QRegion(0, 0, width(), d->titleBarHeight())); | - | ||||||||||||||||||||||||
2724 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2725 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2726 | - | |||||||||||||||||||||||||
2727 | - | |||||||||||||||||||||||||
2728 | - | |||||||||||||||||||||||||
2729 | - | |||||||||||||||||||||||||
2730 | - | |||||||||||||||||||||||||
2731 | - | |||||||||||||||||||||||||
2732 | - | |||||||||||||||||||||||||
2733 | void QMdiSubWindow::resizeEvent(QResizeEvent *resizeEvent) | - | ||||||||||||||||||||||||
2734 | { | - | ||||||||||||||||||||||||
2735 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2736 | - | |||||||||||||||||||||||||
2737 | if (d->sizeGrip
| 0 | ||||||||||||||||||||||||
2738 | d->sizeGrip->move(isLeftToRight() ? width() - d->sizeGrip->width() : 0, | - | ||||||||||||||||||||||||
2739 | height() - d->sizeGrip->height()); | - | ||||||||||||||||||||||||
2740 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2741 | - | |||||||||||||||||||||||||
2742 | - | |||||||||||||||||||||||||
2743 | if (!parent()
| 0 | ||||||||||||||||||||||||
2744 | QWidget::resizeEvent(resizeEvent); | - | ||||||||||||||||||||||||
2745 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2746 | } | - | ||||||||||||||||||||||||
2747 | - | |||||||||||||||||||||||||
2748 | if (d->isMaximizeMode
| 0 | ||||||||||||||||||||||||
2749 | d->ensureWindowState(Qt::WindowMaximized); never executed: d->ensureWindowState(Qt::WindowMaximized); | 0 | ||||||||||||||||||||||||
2750 | - | |||||||||||||||||||||||||
2751 | d->updateMask(); | - | ||||||||||||||||||||||||
2752 | if (!isVisible()
| 0 | ||||||||||||||||||||||||
2753 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2754 | - | |||||||||||||||||||||||||
2755 | if (d->resizeTimerId <= 0
| 0 | ||||||||||||||||||||||||
2756 | d->cachedStyleOptions = d->titleBarOptions(); never executed: d->cachedStyleOptions = d->titleBarOptions(); | 0 | ||||||||||||||||||||||||
2757 | else | - | ||||||||||||||||||||||||
2758 | killTimer(d->resizeTimerId); never executed: killTimer(d->resizeTimerId); | 0 | ||||||||||||||||||||||||
2759 | d->resizeTimerId = startTimer(200); | - | ||||||||||||||||||||||||
2760 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2761 | - | |||||||||||||||||||||||||
2762 | - | |||||||||||||||||||||||||
2763 | - | |||||||||||||||||||||||||
2764 | - | |||||||||||||||||||||||||
2765 | void QMdiSubWindow::timerEvent(QTimerEvent *timerEvent) | - | ||||||||||||||||||||||||
2766 | { | - | ||||||||||||||||||||||||
2767 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2768 | if (timerEvent->timerId() == d->resizeTimerId
| 0 | ||||||||||||||||||||||||
2769 | killTimer(d->resizeTimerId); | - | ||||||||||||||||||||||||
2770 | d->resizeTimerId = -1; | - | ||||||||||||||||||||||||
2771 | d->updateDirtyRegions(); | - | ||||||||||||||||||||||||
2772 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2773 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2774 | - | |||||||||||||||||||||||||
2775 | - | |||||||||||||||||||||||||
2776 | - | |||||||||||||||||||||||||
2777 | - | |||||||||||||||||||||||||
2778 | void QMdiSubWindow::moveEvent(QMoveEvent *moveEvent) | - | ||||||||||||||||||||||||
2779 | { | - | ||||||||||||||||||||||||
2780 | if (!parent()
| 0 | ||||||||||||||||||||||||
2781 | QWidget::moveEvent(moveEvent); | - | ||||||||||||||||||||||||
2782 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2783 | } | - | ||||||||||||||||||||||||
2784 | - | |||||||||||||||||||||||||
2785 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2786 | if (d->isMaximizeMode
| 0 | ||||||||||||||||||||||||
2787 | d->ensureWindowState(Qt::WindowMaximized); never executed: d->ensureWindowState(Qt::WindowMaximized); | 0 | ||||||||||||||||||||||||
2788 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2789 | - | |||||||||||||||||||||||||
2790 | - | |||||||||||||||||||||||||
2791 | - | |||||||||||||||||||||||||
2792 | - | |||||||||||||||||||||||||
2793 | void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) | - | ||||||||||||||||||||||||
2794 | { | - | ||||||||||||||||||||||||
2795 | if (!parent()
| 0 | ||||||||||||||||||||||||
2796 | QWidget::paintEvent(paintEvent); | - | ||||||||||||||||||||||||
2797 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2798 | } | - | ||||||||||||||||||||||||
2799 | - | |||||||||||||||||||||||||
2800 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2801 | if (isMaximized()
| 0 | ||||||||||||||||||||||||
2802 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2803 | - | |||||||||||||||||||||||||
2804 | if (d->resizeTimerId != -1
| 0 | ||||||||||||||||||||||||
2805 | - | |||||||||||||||||||||||||
2806 | int border = d->hasBorder(d->cachedStyleOptions)
| 0 | ||||||||||||||||||||||||
2807 | int titleBarHeight = d->titleBarHeight(d->cachedStyleOptions); | - | ||||||||||||||||||||||||
2808 | titleBarHeight -= isMinimized()
| 0 | ||||||||||||||||||||||||
2809 | d->cachedStyleOptions.rect = QRect(border, border, width() - 2 * border, titleBarHeight); | - | ||||||||||||||||||||||||
2810 | if (!d->windowTitle.isEmpty()
| 0 | ||||||||||||||||||||||||
2811 | int width = style()->subControlRect(QStyle::CC_TitleBar, &d->cachedStyleOptions, | - | ||||||||||||||||||||||||
2812 | QStyle::SC_TitleBarLabel, this).width(); | - | ||||||||||||||||||||||||
2813 | d->cachedStyleOptions.text = d->cachedStyleOptions.fontMetrics | - | ||||||||||||||||||||||||
2814 | .elidedText(d->windowTitle, Qt::ElideRight, width); | - | ||||||||||||||||||||||||
2815 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2816 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2817 | - | |||||||||||||||||||||||||
2818 | d->cachedStyleOptions = d->titleBarOptions(); | - | ||||||||||||||||||||||||
2819 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2820 | - | |||||||||||||||||||||||||
2821 | QStylePainter painter(this); | - | ||||||||||||||||||||||||
2822 | if (!d->windowTitle.isEmpty()
| 0 | ||||||||||||||||||||||||
2823 | painter.setFont(d->font); never executed: painter.setFont(d->font); | 0 | ||||||||||||||||||||||||
2824 | painter.drawComplexControl(QStyle::CC_TitleBar, d->cachedStyleOptions); | - | ||||||||||||||||||||||||
2825 | - | |||||||||||||||||||||||||
2826 | if (isMinimized()
| 0 | ||||||||||||||||||||||||
2827 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2828 | - | |||||||||||||||||||||||||
2829 | QStyleOptionFrame frameOptions; | - | ||||||||||||||||||||||||
2830 | frameOptions.initFrom(this); | - | ||||||||||||||||||||||||
2831 | frameOptions.lineWidth = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); | - | ||||||||||||||||||||||||
2832 | if (d->isActive
| 0 | ||||||||||||||||||||||||
2833 | frameOptions.state |= QStyle::State_Active; never executed: frameOptions.state |= QStyle::State_Active; | 0 | ||||||||||||||||||||||||
2834 | else | - | ||||||||||||||||||||||||
2835 | frameOptions.state &= ~QStyle::State_Active; never executed: frameOptions.state &= ~QStyle::State_Active; | 0 | ||||||||||||||||||||||||
2836 | - | |||||||||||||||||||||||||
2837 | - | |||||||||||||||||||||||||
2838 | if (!isMinimized()
| 0 | ||||||||||||||||||||||||
2839 | 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 | ||||||||||||||||||||||||
2840 | if (!isMinimized()
| 0 | ||||||||||||||||||||||||
2841 | painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions); never executed: painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions); | 0 | ||||||||||||||||||||||||
2842 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2843 | - | |||||||||||||||||||||||||
2844 | - | |||||||||||||||||||||||||
2845 | - | |||||||||||||||||||||||||
2846 | - | |||||||||||||||||||||||||
2847 | void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
2848 | { | - | ||||||||||||||||||||||||
2849 | if (!parent()
| 0 | ||||||||||||||||||||||||
2850 | QWidget::mousePressEvent(mouseEvent); | - | ||||||||||||||||||||||||
2851 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2852 | } | - | ||||||||||||||||||||||||
2853 | - | |||||||||||||||||||||||||
2854 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2855 | if (d->isInInteractiveMode
| 0 | ||||||||||||||||||||||||
2856 | d->leaveInteractiveMode(); never executed: d->leaveInteractiveMode(); | 0 | ||||||||||||||||||||||||
2857 | - | |||||||||||||||||||||||||
2858 | if (d->isInRubberBandMode
| 0 | ||||||||||||||||||||||||
2859 | d->leaveRubberBandMode(); never executed: d->leaveRubberBandMode(); | 0 | ||||||||||||||||||||||||
2860 | - | |||||||||||||||||||||||||
2861 | - | |||||||||||||||||||||||||
2862 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
2863 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
2864 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2865 | } | - | ||||||||||||||||||||||||
2866 | - | |||||||||||||||||||||||||
2867 | if (d->currentOperation != QMdiSubWindowPrivate::None
| 0 | ||||||||||||||||||||||||
2868 | d->updateCursor(); | - | ||||||||||||||||||||||||
2869 | d->mousePressPosition = mapToParent(mouseEvent->pos()); | - | ||||||||||||||||||||||||
2870 | if (d->resizeEnabled
| 0 | ||||||||||||||||||||||||
2871 | d->oldGeometry = geometry(); never executed: d->oldGeometry = geometry(); | 0 | ||||||||||||||||||||||||
2872 | - | |||||||||||||||||||||||||
2873 | if ((testOption(QMdiSubWindow::RubberBandResize)
| 0 | ||||||||||||||||||||||||
2874 | || (testOption(QMdiSubWindow::RubberBandMove)
| 0 | ||||||||||||||||||||||||
2875 | d->enterRubberBandMode(); | - | ||||||||||||||||||||||||
2876 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2877 | - | |||||||||||||||||||||||||
2878 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2879 | } | - | ||||||||||||||||||||||||
2880 | - | |||||||||||||||||||||||||
2881 | d->activeSubControl = d->hoveredSubControl; | - | ||||||||||||||||||||||||
2882 | - | |||||||||||||||||||||||||
2883 | if (d->activeSubControl == QStyle::SC_TitleBarSysMenu
| 0 | ||||||||||||||||||||||||
2884 | showSystemMenu(); never executed: showSystemMenu(); | 0 | ||||||||||||||||||||||||
2885 | else | - | ||||||||||||||||||||||||
2886 | - | |||||||||||||||||||||||||
2887 | update(QRegion(0, 0, width(), d->titleBarHeight())); never executed: update(QRegion(0, 0, width(), d->titleBarHeight())); | 0 | ||||||||||||||||||||||||
2888 | } | - | ||||||||||||||||||||||||
2889 | - | |||||||||||||||||||||||||
2890 | - | |||||||||||||||||||||||||
2891 | - | |||||||||||||||||||||||||
2892 | - | |||||||||||||||||||||||||
2893 | void QMdiSubWindow::mouseDoubleClickEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
2894 | { | - | ||||||||||||||||||||||||
2895 | if (!parent()
| 0 | ||||||||||||||||||||||||
2896 | QWidget::mouseDoubleClickEvent(mouseEvent); | - | ||||||||||||||||||||||||
2897 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2898 | } | - | ||||||||||||||||||||||||
2899 | - | |||||||||||||||||||||||||
2900 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
2901 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
2902 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2903 | } | - | ||||||||||||||||||||||||
2904 | - | |||||||||||||||||||||||||
2905 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2906 | if (!d->isMoveOperation()
| 0 | ||||||||||||||||||||||||
2907 | - | |||||||||||||||||||||||||
2908 | if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
| 0 | ||||||||||||||||||||||||
2909 | close(); never executed: close(); | 0 | ||||||||||||||||||||||||
2910 | - | |||||||||||||||||||||||||
2911 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2912 | } | - | ||||||||||||||||||||||||
2913 | - | |||||||||||||||||||||||||
2914 | Qt::WindowFlags flags = windowFlags(); | - | ||||||||||||||||||||||||
2915 | if (isMinimized()
| 0 | ||||||||||||||||||||||||
2916 | if ((isShaded()
| 0 | ||||||||||||||||||||||||
2917 | || (
| 0 | ||||||||||||||||||||||||
2918 | showNormal(); | - | ||||||||||||||||||||||||
2919 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2920 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2921 | } | - | ||||||||||||||||||||||||
2922 | - | |||||||||||||||||||||||||
2923 | if (isMaximized()
| 0 | ||||||||||||||||||||||||
2924 | if (flags & Qt::WindowMaximizeButtonHint
| 0 | ||||||||||||||||||||||||
2925 | showNormal(); never executed: showNormal(); | 0 | ||||||||||||||||||||||||
2926 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2927 | } | - | ||||||||||||||||||||||||
2928 | - | |||||||||||||||||||||||||
2929 | if (flags & Qt::WindowShadeButtonHint
| 0 | ||||||||||||||||||||||||
2930 | showShaded(); never executed: showShaded(); | 0 | ||||||||||||||||||||||||
2931 | else if (flags & Qt::WindowMaximizeButtonHint
| 0 | ||||||||||||||||||||||||
2932 | showMaximized(); never executed: showMaximized(); | 0 | ||||||||||||||||||||||||
2933 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2934 | - | |||||||||||||||||||||||||
2935 | - | |||||||||||||||||||||||||
2936 | - | |||||||||||||||||||||||||
2937 | - | |||||||||||||||||||||||||
2938 | void QMdiSubWindow::mouseReleaseEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
2939 | { | - | ||||||||||||||||||||||||
2940 | if (!parent()
| 0 | ||||||||||||||||||||||||
2941 | QWidget::mouseReleaseEvent(mouseEvent); | - | ||||||||||||||||||||||||
2942 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2943 | } | - | ||||||||||||||||||||||||
2944 | - | |||||||||||||||||||||||||
2945 | if (mouseEvent->button() != Qt::LeftButton
| 0 | ||||||||||||||||||||||||
2946 | mouseEvent->ignore(); | - | ||||||||||||||||||||||||
2947 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2948 | } | - | ||||||||||||||||||||||||
2949 | - | |||||||||||||||||||||||||
2950 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2951 | if (d->currentOperation != QMdiSubWindowPrivate::None
| 0 | ||||||||||||||||||||||||
2952 | - | |||||||||||||||||||||||||
2953 | if (d->isInRubberBandMode
| 0 | ||||||||||||||||||||||||
2954 | d->leaveRubberBandMode(); never executed: d->leaveRubberBandMode(); | 0 | ||||||||||||||||||||||||
2955 | - | |||||||||||||||||||||||||
2956 | if (d->resizeEnabled
| 0 | ||||||||||||||||||||||||
2957 | d->oldGeometry = geometry(); never executed: d->oldGeometry = geometry(); | 0 | ||||||||||||||||||||||||
2958 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2959 | - | |||||||||||||||||||||||||
2960 | d->currentOperation = d->getOperation(mouseEvent->pos()); | - | ||||||||||||||||||||||||
2961 | d->updateCursor(); | - | ||||||||||||||||||||||||
2962 | - | |||||||||||||||||||||||||
2963 | d->hoveredSubControl = d->getSubControl(mouseEvent->pos()); | - | ||||||||||||||||||||||||
2964 | if (d->activeSubControl != QStyle::SC_None
| 0 | ||||||||||||||||||||||||
2965 | && d->activeSubControl == d->hoveredSubControl
| 0 | ||||||||||||||||||||||||
2966 | d->processClickedSubControl(); | - | ||||||||||||||||||||||||
2967 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2968 | d->activeSubControl = QStyle::SC_None; | - | ||||||||||||||||||||||||
2969 | update(QRegion(0, 0, width(), d->titleBarHeight())); | - | ||||||||||||||||||||||||
2970 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2971 | - | |||||||||||||||||||||||||
2972 | - | |||||||||||||||||||||||||
2973 | - | |||||||||||||||||||||||||
2974 | - | |||||||||||||||||||||||||
2975 | void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||||||||
2976 | { | - | ||||||||||||||||||||||||
2977 | if (!parent()
| 0 | ||||||||||||||||||||||||
2978 | QWidget::mouseMoveEvent(mouseEvent); | - | ||||||||||||||||||||||||
2979 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2980 | } | - | ||||||||||||||||||||||||
2981 | - | |||||||||||||||||||||||||
2982 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2983 | - | |||||||||||||||||||||||||
2984 | if (!d->isMoveOperation()
| 0 | ||||||||||||||||||||||||
2985 | - | |||||||||||||||||||||||||
2986 | const QStyleOptionTitleBar options = d->titleBarOptions(); | - | ||||||||||||||||||||||||
2987 | QStyle::SubControl oldHover = d->hoveredSubControl; | - | ||||||||||||||||||||||||
2988 | d->hoveredSubControl = d->getSubControl(mouseEvent->pos()); | - | ||||||||||||||||||||||||
2989 | QRegion hoverRegion; | - | ||||||||||||||||||||||||
2990 | if (isHoverControl(oldHover)
| 0 | ||||||||||||||||||||||||
2991 | hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this); never executed: hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, oldHover, this); | 0 | ||||||||||||||||||||||||
2992 | if (isHoverControl(d->hoveredSubControl)
| 0 | ||||||||||||||||||||||||
2993 | hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, | - | ||||||||||||||||||||||||
2994 | d->hoveredSubControl, this); | - | ||||||||||||||||||||||||
2995 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2996 | - | |||||||||||||||||||||||||
2997 | - | |||||||||||||||||||||||||
2998 | - | |||||||||||||||||||||||||
2999 | - | |||||||||||||||||||||||||
3000 | if (!hoverRegion.isEmpty()
| 0 | ||||||||||||||||||||||||
3001 | update(hoverRegion); never executed: update(hoverRegion); | 0 | ||||||||||||||||||||||||
3002 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3003 | - | |||||||||||||||||||||||||
3004 | if ((
| 0 | ||||||||||||||||||||||||
3005 | if ((d->isResizeOperation()
| 0 | ||||||||||||||||||||||||
3006 | d->setNewGeometry(mapToParent(mouseEvent->pos())); never executed: d->setNewGeometry(mapToParent(mouseEvent->pos())); | 0 | ||||||||||||||||||||||||
3007 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3008 | } | - | ||||||||||||||||||||||||
3009 | - | |||||||||||||||||||||||||
3010 | - | |||||||||||||||||||||||||
3011 | d->currentOperation = d->getOperation(mouseEvent->pos()); | - | ||||||||||||||||||||||||
3012 | if ((d->isResizeOperation()
| 0 | ||||||||||||||||||||||||
3013 | d->currentOperation = QMdiSubWindowPrivate::None; never executed: d->currentOperation = QMdiSubWindowPrivate::None; | 0 | ||||||||||||||||||||||||
3014 | d->updateCursor(); | - | ||||||||||||||||||||||||
3015 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3016 | - | |||||||||||||||||||||||||
3017 | - | |||||||||||||||||||||||||
3018 | - | |||||||||||||||||||||||||
3019 | - | |||||||||||||||||||||||||
3020 | void QMdiSubWindow::keyPressEvent(QKeyEvent *keyEvent) | - | ||||||||||||||||||||||||
3021 | { | - | ||||||||||||||||||||||||
3022 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
3023 | if (!d->isInInteractiveMode
| 0 | ||||||||||||||||||||||||
3024 | keyEvent->ignore(); | - | ||||||||||||||||||||||||
3025 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3026 | } | - | ||||||||||||||||||||||||
3027 | - | |||||||||||||||||||||||||
3028 | QPoint delta; | - | ||||||||||||||||||||||||
3029 | switch (keyEvent->key()) { | - | ||||||||||||||||||||||||
3030 | case never executed: Qt::Key_Right:case Qt::Key_Right: never executed: case Qt::Key_Right: | 0 | ||||||||||||||||||||||||
3031 | if (keyEvent->modifiers() & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||
3032 | delta = QPoint(d->keyboardPageStep, 0); never executed: delta = QPoint(d->keyboardPageStep, 0); | 0 | ||||||||||||||||||||||||
3033 | else | - | ||||||||||||||||||||||||
3034 | delta = QPoint(d->keyboardSingleStep, 0); never executed: delta = QPoint(d->keyboardSingleStep, 0); | 0 | ||||||||||||||||||||||||
3035 | break; never executed: break; | 0 | ||||||||||||||||||||||||
3036 | case never executed: Qt::Key_Up:case Qt::Key_Up: never executed: case Qt::Key_Up: | 0 | ||||||||||||||||||||||||
3037 | if (keyEvent->modifiers() & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||
3038 | delta = QPoint(0, -d->keyboardPageStep); never executed: delta = QPoint(0, -d->keyboardPageStep); | 0 | ||||||||||||||||||||||||
3039 | else | - | ||||||||||||||||||||||||
3040 | delta = QPoint(0, -d->keyboardSingleStep); never executed: delta = QPoint(0, -d->keyboardSingleStep); | 0 | ||||||||||||||||||||||||
3041 | break; never executed: break; | 0 | ||||||||||||||||||||||||
3042 | case never executed: Qt::Key_Left:case Qt::Key_Left: never executed: case Qt::Key_Left: | 0 | ||||||||||||||||||||||||
3043 | if (keyEvent->modifiers() & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||
3044 | delta = QPoint(-d->keyboardPageStep, 0); never executed: delta = QPoint(-d->keyboardPageStep, 0); | 0 | ||||||||||||||||||||||||
3045 | else | - | ||||||||||||||||||||||||
3046 | delta = QPoint(-d->keyboardSingleStep, 0); never executed: delta = QPoint(-d->keyboardSingleStep, 0); | 0 | ||||||||||||||||||||||||
3047 | break; never executed: break; | 0 | ||||||||||||||||||||||||
3048 | case never executed: Qt::Key_Down:case Qt::Key_Down: never executed: case Qt::Key_Down: | 0 | ||||||||||||||||||||||||
3049 | if (keyEvent->modifiers() & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||
3050 | delta = QPoint(0, d->keyboardPageStep); never executed: delta = QPoint(0, d->keyboardPageStep); | 0 | ||||||||||||||||||||||||
3051 | else | - | ||||||||||||||||||||||||
3052 | delta = QPoint(0, d->keyboardSingleStep); never executed: delta = QPoint(0, d->keyboardSingleStep); | 0 | ||||||||||||||||||||||||
3053 | break; never executed: break; | 0 | ||||||||||||||||||||||||
3054 | case never executed: Qt::Key_Escape:case Qt::Key_Escape: never executed: case Qt::Key_Escape: | 0 | ||||||||||||||||||||||||
3055 | case never executed: Qt::Key_Return:case Qt::Key_Return: never executed: case Qt::Key_Return: | 0 | ||||||||||||||||||||||||
3056 | case never executed: Qt::Key_Enter:case Qt::Key_Enter: never executed: case Qt::Key_Enter: | 0 | ||||||||||||||||||||||||
3057 | d->leaveInteractiveMode(); | - | ||||||||||||||||||||||||
3058 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3059 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
3060 | keyEvent->ignore(); | - | ||||||||||||||||||||||||
3061 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3062 | } | - | ||||||||||||||||||||||||
3063 | - | |||||||||||||||||||||||||
3064 | - | |||||||||||||||||||||||||
3065 | QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta); | - | ||||||||||||||||||||||||
3066 | QRect oldGeometry = | - | ||||||||||||||||||||||||
3067 | - | |||||||||||||||||||||||||
3068 | d->isInRubberBandMode
| 0 | ||||||||||||||||||||||||
3069 | - | |||||||||||||||||||||||||
3070 | geometry(); | - | ||||||||||||||||||||||||
3071 | d->setNewGeometry(newPosition); | - | ||||||||||||||||||||||||
3072 | QRect currentGeometry = | - | ||||||||||||||||||||||||
3073 | - | |||||||||||||||||||||||||
3074 | d->isInRubberBandMode
| 0 | ||||||||||||||||||||||||
3075 | - | |||||||||||||||||||||||||
3076 | geometry(); | - | ||||||||||||||||||||||||
3077 | if (currentGeometry == oldGeometry
| 0 | ||||||||||||||||||||||||
3078 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3079 | - | |||||||||||||||||||||||||
3080 | - | |||||||||||||||||||||||||
3081 | - | |||||||||||||||||||||||||
3082 | QPoint actualDelta; | - | ||||||||||||||||||||||||
3083 | if (d->isMoveOperation()
| 0 | ||||||||||||||||||||||||
3084 | actualDelta = QPoint(currentGeometry.x() - oldGeometry.x(), | - | ||||||||||||||||||||||||
3085 | currentGeometry.y() - oldGeometry.y()); | - | ||||||||||||||||||||||||
3086 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
3087 | int dx = isLeftToRight()
| 0 | ||||||||||||||||||||||||
3088 | : currentGeometry.x() - oldGeometry.x(); | - | ||||||||||||||||||||||||
3089 | actualDelta = QPoint(dx, currentGeometry.height() - oldGeometry.height()); | - | ||||||||||||||||||||||||
3090 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3091 | - | |||||||||||||||||||||||||
3092 | - | |||||||||||||||||||||||||
3093 | if (actualDelta != delta
| 0 | ||||||||||||||||||||||||
3094 | newPosition += (actualDelta - delta); never executed: newPosition += (actualDelta - delta); | 0 | ||||||||||||||||||||||||
3095 | cursor().setPos(parentWidget()->mapToGlobal(newPosition)); | - | ||||||||||||||||||||||||
3096 | - | |||||||||||||||||||||||||
3097 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3098 | - | |||||||||||||||||||||||||
3099 | - | |||||||||||||||||||||||||
3100 | - | |||||||||||||||||||||||||
3101 | - | |||||||||||||||||||||||||
3102 | - | |||||||||||||||||||||||||
3103 | void QMdiSubWindow::contextMenuEvent(QContextMenuEvent *contextMenuEvent) | - | ||||||||||||||||||||||||
3104 | { | - | ||||||||||||||||||||||||
3105 | QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
3106 | if (!d->systemMenu
| 0 | ||||||||||||||||||||||||
3107 | contextMenuEvent->ignore(); | - | ||||||||||||||||||||||||
3108 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3109 | } | - | ||||||||||||||||||||||||
3110 | - | |||||||||||||||||||||||||
3111 | if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu
| 0 | ||||||||||||||||||||||||
3112 | || d->getRegion(QMdiSubWindowPrivate::Move).contains(contextMenuEvent->pos())
| 0 | ||||||||||||||||||||||||
3113 | d->systemMenu->exec(contextMenuEvent->globalPos()); | - | ||||||||||||||||||||||||
3114 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
3115 | contextMenuEvent->ignore(); | - | ||||||||||||||||||||||||
3116 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3117 | } | - | ||||||||||||||||||||||||
3118 | - | |||||||||||||||||||||||||
3119 | - | |||||||||||||||||||||||||
3120 | - | |||||||||||||||||||||||||
3121 | - | |||||||||||||||||||||||||
3122 | - | |||||||||||||||||||||||||
3123 | void QMdiSubWindow::focusInEvent(QFocusEvent *focusInEvent) | - | ||||||||||||||||||||||||
3124 | { | - | ||||||||||||||||||||||||
3125 | d_func()->focusInReason = focusInEvent->reason(); | - | ||||||||||||||||||||||||
3126 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3127 | - | |||||||||||||||||||||||||
3128 | - | |||||||||||||||||||||||||
3129 | - | |||||||||||||||||||||||||
3130 | - | |||||||||||||||||||||||||
3131 | void QMdiSubWindow::focusOutEvent(QFocusEvent * ) | - | ||||||||||||||||||||||||
3132 | { | - | ||||||||||||||||||||||||
3133 | - | |||||||||||||||||||||||||
3134 | } | - | ||||||||||||||||||||||||
3135 | - | |||||||||||||||||||||||||
3136 | - | |||||||||||||||||||||||||
3137 | - | |||||||||||||||||||||||||
3138 | - | |||||||||||||||||||||||||
3139 | void QMdiSubWindow::childEvent(QChildEvent *childEvent) | - | ||||||||||||||||||||||||
3140 | { | - | ||||||||||||||||||||||||
3141 | if (childEvent->type() != QEvent::ChildPolished
| 0 | ||||||||||||||||||||||||
3142 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3143 | - | |||||||||||||||||||||||||
3144 | if (QSizeGrip *sizeGrip = qobject_cast<QSizeGrip *>(childEvent->child())
| 0 | ||||||||||||||||||||||||
3145 | d_func()->setSizeGrip(sizeGrip); never executed: d_func()->setSizeGrip(sizeGrip); | 0 | ||||||||||||||||||||||||
3146 | - | |||||||||||||||||||||||||
3147 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3148 | - | |||||||||||||||||||||||||
3149 | - | |||||||||||||||||||||||||
3150 | - | |||||||||||||||||||||||||
3151 | - | |||||||||||||||||||||||||
3152 | QSize QMdiSubWindow::sizeHint() const | - | ||||||||||||||||||||||||
3153 | { | - | ||||||||||||||||||||||||
3154 | const QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
3155 | int margin, minWidth; | - | ||||||||||||||||||||||||
3156 | d->sizeParameters(&margin, &minWidth); | - | ||||||||||||||||||||||||
3157 | QSize size(2 * margin, d->titleBarHeight() + margin); | - | ||||||||||||||||||||||||
3158 | if (d->baseWidget
| 0 | ||||||||||||||||||||||||
3159 | size += d->baseWidget->sizeHint(); never executed: size += d->baseWidget->sizeHint(); | 0 | ||||||||||||||||||||||||
3160 | return never executed: size.expandedTo(minimumSizeHint());return size.expandedTo(minimumSizeHint()); never executed: return size.expandedTo(minimumSizeHint()); | 0 | ||||||||||||||||||||||||
3161 | } | - | ||||||||||||||||||||||||
3162 | - | |||||||||||||||||||||||||
3163 | - | |||||||||||||||||||||||||
3164 | - | |||||||||||||||||||||||||
3165 | - | |||||||||||||||||||||||||
3166 | QSize QMdiSubWindow::minimumSizeHint() const | - | ||||||||||||||||||||||||
3167 | { | - | ||||||||||||||||||||||||
3168 | const QMdiSubWindowPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
3169 | if (isVisible()
| 0 | ||||||||||||||||||||||||
3170 | ensurePolished(); never executed: ensurePolished(); | 0 | ||||||||||||||||||||||||
3171 | - | |||||||||||||||||||||||||
3172 | - | |||||||||||||||||||||||||
3173 | if (parent()
| 0 | ||||||||||||||||||||||||
3174 | return never executed: d->iconSize();return d->iconSize(); never executed: return d->iconSize(); | 0 | ||||||||||||||||||||||||
3175 | - | |||||||||||||||||||||||||
3176 | - | |||||||||||||||||||||||||
3177 | int margin, minWidth; | - | ||||||||||||||||||||||||
3178 | d->sizeParameters(&margin, &minWidth); | - | ||||||||||||||||||||||||
3179 | int decorationHeight = margin + d->titleBarHeight(); | - | ||||||||||||||||||||||||
3180 | int minHeight = decorationHeight; | - | ||||||||||||||||||||||||
3181 | - | |||||||||||||||||||||||||
3182 | - | |||||||||||||||||||||||||
3183 | if (parent()
| 0 | ||||||||||||||||||||||||
3184 | return never executed: QSize(qMax(minWidth, width()), d->titleBarHeight());return QSize(qMax(minWidth, width()), d->titleBarHeight()); never executed: return QSize(qMax(minWidth, width()), d->titleBarHeight()); | 0 | ||||||||||||||||||||||||
3185 | - | |||||||||||||||||||||||||
3186 | - | |||||||||||||||||||||||||
3187 | if (layout()
| 0 | ||||||||||||||||||||||||
3188 | QSize minLayoutSize = layout()->minimumSize(); | - | ||||||||||||||||||||||||
3189 | if (minLayoutSize.isValid()
| 0 | ||||||||||||||||||||||||
3190 | minWidth = qMax(minWidth, minLayoutSize.width() + 2 * margin); | - | ||||||||||||||||||||||||
3191 | minHeight += minLayoutSize.height(); | - | ||||||||||||||||||||||||
3192 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3193 | } never executed: else if (d->baseWidgetend of block
| 0 | ||||||||||||||||||||||||
3194 | QSize minBaseWidgetSize = d->baseWidget->minimumSizeHint(); | - | ||||||||||||||||||||||||
3195 | if (minBaseWidgetSize.isValid()
| 0 | ||||||||||||||||||||||||
3196 | minWidth = qMax(minWidth, minBaseWidgetSize.width() + 2 * margin); | - | ||||||||||||||||||||||||
3197 | minHeight += minBaseWidgetSize.height(); | - | ||||||||||||||||||||||||
3198 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3199 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3200 | - | |||||||||||||||||||||||||
3201 | - | |||||||||||||||||||||||||
3202 | - | |||||||||||||||||||||||||
3203 | int sizeGripHeight = 0; | - | ||||||||||||||||||||||||
3204 | if (d->sizeGrip
| 0 | ||||||||||||||||||||||||
3205 | sizeGripHeight = d->sizeGrip->height(); never executed: sizeGripHeight = d->sizeGrip->height(); | 0 | ||||||||||||||||||||||||
3206 | - | |||||||||||||||||||||||||
3207 | - | |||||||||||||||||||||||||
3208 | - | |||||||||||||||||||||||||
3209 | - | |||||||||||||||||||||||||
3210 | minHeight = qMax(minHeight, decorationHeight + sizeGripHeight); | - | ||||||||||||||||||||||||
3211 | - | |||||||||||||||||||||||||
3212 | - | |||||||||||||||||||||||||
3213 | return never executed: QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut());return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut()); never executed: return QSize(minWidth, minHeight).expandedTo(QApplication::globalStrut()); | 0 | ||||||||||||||||||||||||
3214 | } | - | ||||||||||||||||||||||||
3215 | - | |||||||||||||||||||||||||
3216 | - | |||||||||||||||||||||||||
3217 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |