qdockwidget.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qdockwidget.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*);-
14-
15-
16extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);-
17-
18static inline QMainWindowLayout *qt_mainwindow_layout_from_dock(const QDockWidget *dock)-
19{-
20 const QWidget *p = dock->parentWidget();-
21 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
22 const QMainWindow *window = qobject_cast<const QMainWindow*>(p);-
23 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 return
never executed: return qt_mainwindow_layout(window);
qt_mainwindow_layout(window);
never executed: return qt_mainwindow_layout(window);
0
25 p = p->parentWidget();-
26 }
never executed: end of block
0
27 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
28}-
29-
30static inline bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)-
31{ return
never executed: return (priv->features & feature) == feature;
(priv->features & feature) == feature;
never executed: return (priv->features & feature) == feature;
}
0
32-
33static inline bool hasFeature(const QDockWidget *dockwidget, QDockWidget::DockWidgetFeature feature)-
34{ return
never executed: return (dockwidget->features() & feature) == feature;
(dockwidget->features() & feature) == feature;
never executed: return (dockwidget->features() & feature) == feature;
}
0
35class QDockWidgetTitleButton : public QAbstractButton-
36{-
37 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; }-
38#pragma GCC diagnostic push-
39 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 **);-
40#pragma GCC diagnostic pop-
41 struct QPrivateSignal {};-
42-
43public:-
44 QDockWidgetTitleButton(QDockWidget *dockWidget);-
45-
46 QSize sizeHint() const override;-
47 QSize minimumSizeHint() const override-
48 { return
never executed: return sizeHint();
sizeHint();
never executed: return sizeHint();
}
0
49-
50 void enterEvent(QEvent *event) override;-
51 void leaveEvent(QEvent *event) override;-
52 void paintEvent(QPaintEvent *event) override;-
53};-
54-
55-
56QDockWidgetTitleButton::QDockWidgetTitleButton(QDockWidget *dockWidget)-
57 : QAbstractButton(dockWidget)-
58{-
59 setFocusPolicy(Qt::NoFocus);-
60}
never executed: end of block
0
61-
62QSize QDockWidgetTitleButton::sizeHint() const-
63{-
64 ensurePolished();-
65-
66 int size = 2*style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin, 0, this);-
67 if (!icon().isNull()
!icon().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
68 int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);-
69 QSize sz = icon().actualSize(QSize(iconSize, iconSize));-
70 size += qMax(sz.width(), sz.height());-
71 }
never executed: end of block
0
72-
73 return
never executed: return QSize(size, size);
QSize(size, size);
never executed: return QSize(size, size);
0
74}-
75-
76void QDockWidgetTitleButton::enterEvent(QEvent *event)-
77{-
78 if (isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) update();
never executed: update();
0
79 QAbstractButton::enterEvent(event);-
80}
never executed: end of block
0
81-
82void QDockWidgetTitleButton::leaveEvent(QEvent *event)-
83{-
84 if (isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) update();
never executed: update();
0
85 QAbstractButton::leaveEvent(event);-
86}
never executed: end of block
0
87-
88void QDockWidgetTitleButton::paintEvent(QPaintEvent *)-
89{-
90 QPainter p(this);-
91-
92 QStyleOptionToolButton opt;-
93 opt.init(this);-
94 opt.state |= QStyle::State_AutoRaise;-
95-
96 if (style()->styleHint(QStyle::SH_DockWidget_ButtonsHaveFrame, 0, this)
style()->style...rame, 0, this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
97 {-
98 if (isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& underMouse()
underMouse()Description
TRUEnever evaluated
FALSEnever evaluated
&& !isChecked()
!isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
&& !isDown()
!isDown()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
99 opt.state |= QStyle::State_Raised;
never executed: opt.state |= QStyle::State_Raised;
0
100 if (isChecked()
isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
101 opt.state |= QStyle::State_On;
never executed: opt.state |= QStyle::State_On;
0
102 if (isDown()
isDown()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
103 opt.state |= QStyle::State_Sunken;
never executed: opt.state |= QStyle::State_Sunken;
0
104 style()->drawPrimitive(QStyle::PE_PanelButtonTool, &opt, &p, this);-
105 }
never executed: end of block
0
106-
107 opt.icon = icon();-
108 opt.subControls = 0;-
109 opt.activeSubControls = 0;-
110 opt.features = QStyleOptionToolButton::None;-
111 opt.arrowType = Qt::NoArrow;-
112 int size = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);-
113 opt.iconSize = QSize(size, size);-
114 style()->drawComplexControl(QStyle::CC_ToolButton, &opt, &p, this);-
115}
never executed: end of block
0
116-
117-
118-
119-
120-
121QDockWidgetLayout::QDockWidgetLayout(QWidget *parent)-
122 : QLayout(parent), verticalTitleBar(false), item_list(RoleCount, 0)-
123{-
124}
never executed: end of block
0
125-
126QDockWidgetLayout::~QDockWidgetLayout()-
127{-
128 qDeleteAll(item_list);-
129}
never executed: end of block
0
130-
131-
132-
133-
134-
135bool QDockWidgetLayout::nativeWindowDeco() const-
136{-
137 bool floating = parentWidget()->isWindow();-
138 if (!floating
!floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& qobject_cast<QDockWidgetGroupWindow*>(parentWidget()->parentWidget())
qobject_cast<Q...arentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
139 return
never executed: return wmSupportsNativeWindowDeco();
wmSupportsNativeWindowDeco();
never executed: return wmSupportsNativeWindowDeco();
0
140 return
never executed: return nativeWindowDeco(floating);
nativeWindowDeco(floating);
never executed: return nativeWindowDeco(floating);
0
141}-
142-
143-
144-
145-
146-
147bool QDockWidgetLayout::wmSupportsNativeWindowDeco()-
148{-
149-
150-
151-
152 static const bool xcb = !QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive);-
153 return
never executed: return !xcb;
!xcb;
never executed: return !xcb;
0
154-
155}-
156-
157-
158-
159-
160-
161-
162bool QDockWidgetLayout::nativeWindowDeco(bool floating) const-
163{-
164 return
never executed: return wmSupportsNativeWindowDeco() && floating && item_list.at(QDockWidgetLayout::TitleBar) == 0;
wmSupportsNativeWindowDeco() && floating && item_list.at(QDockWidgetLayout::TitleBar) == 0;
never executed: return wmSupportsNativeWindowDeco() && floating && item_list.at(QDockWidgetLayout::TitleBar) == 0;
0
165}-
166-
167-
168void QDockWidgetLayout::addItem(QLayoutItem*)-
169{-
170 QMessageLogger(__FILE__, 254, __PRETTY_FUNCTION__).warning("QDockWidgetLayout::addItem(): please use QDockWidgetLayout::setWidget()");-
171 return;
never executed: return;
0
172}-
173-
174QLayoutItem *QDockWidgetLayout::itemAt(int index) const-
175{-
176 int cnt = 0;-
177 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
178 QLayoutItem *item = item_list.at(i);-
179 if (item == 0
item == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
180 continue;
never executed: continue;
0
181 if (index == cnt++
index == cnt++Description
TRUEnever evaluated
FALSEnever evaluated
)
0
182 return
never executed: return item;
item;
never executed: return item;
0
183 }
never executed: end of block
0
184 return
never executed: return 0;
0;
never executed: return 0;
0
185}-
186-
187QLayoutItem *QDockWidgetLayout::takeAt(int index)-
188{-
189 int j = 0;-
190 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
191 QLayoutItem *item = item_list.at(i);-
192 if (item == 0
item == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
193 continue;
never executed: continue;
0
194 if (index == j
index == jDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
195 item_list[i] = 0;-
196 invalidate();-
197 return
never executed: return item;
item;
never executed: return item;
0
198 }-
199 ++j;-
200 }
never executed: end of block
0
201 return
never executed: return 0;
0;
never executed: return 0;
0
202}-
203-
204int QDockWidgetLayout::count() const-
205{-
206 int result = 0;-
207 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
208 if (item_list.at(i)
item_list.at(i)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
209 ++
never executed: ++result;
result;
never executed: ++result;
0
210 }
never executed: end of block
0
211 return
never executed: return result;
result;
never executed: return result;
0
212}-
213-
214QSize QDockWidgetLayout::sizeFromContent(const QSize &content, bool floating) const-
215{-
216 QSize result = content;-
217-
218 if (verticalTitleBar
verticalTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
219 result.setHeight(qMax(result.height(), minimumTitleWidth()));-
220 result.setWidth(qMax(content.width(), 0));-
221 }
never executed: end of block
else {
0
222 result.setHeight(qMax(result.height(), 0));-
223 result.setWidth(qMax(content.width(), minimumTitleWidth()));-
224 }
never executed: end of block
0
225-
226 QDockWidget *w = qobject_cast<QDockWidget*>(parentWidget());-
227 const bool nativeDeco = nativeWindowDeco(floating);-
228-
229 int fw = floating
floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& !nativeDeco
!nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
0
230 ? w->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, w)-
231 : 0;-
232-
233 const int th = titleHeight();-
234 if (!nativeDeco
!nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
235 if (verticalTitleBar
verticalTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
236 result += QSize(th + 2*fw, 2*fw);
never executed: result += QSize(th + 2*fw, 2*fw);
0
237 else-
238 result += QSize(2*fw, th + 2*fw);
never executed: result += QSize(2*fw, th + 2*fw);
0
239 }-
240-
241 result.setHeight(qMin(result.height(), (int) ((1<<24)-1)));-
242 result.setWidth(qMin(result.width(), (int) ((1<<24)-1)));-
243-
244 if (content.width() < 0
content.width() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
245 result.setWidth(-1);
never executed: result.setWidth(-1);
0
246 if (content.height() < 0
content.height() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
247 result.setHeight(-1);
never executed: result.setHeight(-1);
0
248-
249 int left, top, right, bottom;-
250 w->getContentsMargins(&left, &top, &right, &bottom);-
251-
252 QSize min = w->minimumSize() - QSize(left + right, top + bottom);-
253 QSize max = w->maximumSize() - QSize(left + right, top + bottom);-
254-
255-
256-
257-
258-
259-
260-
261 uint explicitMin = 0;-
262 uint explicitMax = 0;-
263 if (w->d_func()->extra != 0
w->d_func()->extra != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
264 explicitMin = w->d_func()->extra->explicitMinSize;-
265 explicitMax = w->d_func()->extra->explicitMaxSize;-
266 }
never executed: end of block
0
267-
268 if (!(explicitMin & Qt::Horizontal)
!(explicitMin ...t::Horizontal)Description
TRUEnever evaluated
FALSEnever evaluated
|| min.width() == 0
min.width() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
269 min.setWidth(-1);
never executed: min.setWidth(-1);
0
270 if (!(explicitMin & Qt::Vertical)
!(explicitMin & Qt::Vertical)Description
TRUEnever evaluated
FALSEnever evaluated
|| min.height() == 0
min.height() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
271 min.setHeight(-1);
never executed: min.setHeight(-1);
0
272-
273 if (!(explicitMax & Qt::Horizontal)
!(explicitMax ...t::Horizontal)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
274 max.setWidth(((1<<24)-1));
never executed: max.setWidth(((1<<24)-1));
0
275 if (!(explicitMax & Qt::Vertical)
!(explicitMax & Qt::Vertical)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
276 max.setHeight(((1<<24)-1));
never executed: max.setHeight(((1<<24)-1));
0
277-
278 return
never executed: return result.boundedTo(max).expandedTo(min);
result.boundedTo(max).expandedTo(min);
never executed: return result.boundedTo(max).expandedTo(min);
0
279}-
280-
281QSize QDockWidgetLayout::sizeHint() const-
282{-
283 QDockWidget *w = qobject_cast<QDockWidget*>(parentWidget());-
284-
285 QSize content(-1, -1);-
286 if (item_list[Content] != 0
item_list[Content] != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
287 content = item_list[Content]->sizeHint();
never executed: content = item_list[Content]->sizeHint();
0
288-
289 return
never executed: return sizeFromContent(content, w->isFloating());
sizeFromContent(content, w->isFloating());
never executed: return sizeFromContent(content, w->isFloating());
0
290}-
291-
292QSize QDockWidgetLayout::maximumSize() const-
293{-
294 if (item_list[Content] != 0
item_list[Content] != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
295 const QSize content = item_list[Content]->maximumSize();-
296 return
never executed: return sizeFromContent(content, parentWidget()->isWindow());
sizeFromContent(content, parentWidget()->isWindow());
never executed: return sizeFromContent(content, parentWidget()->isWindow());
0
297 } else {-
298 return
never executed: return parentWidget()->maximumSize();
parentWidget()->maximumSize();
never executed: return parentWidget()->maximumSize();
0
299 }-
300-
301}-
302-
303QSize QDockWidgetLayout::minimumSize() const-
304{-
305 QDockWidget *w = qobject_cast<QDockWidget*>(parentWidget());-
306-
307 QSize content(0, 0);-
308 if (item_list[Content] != 0
item_list[Content] != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
309 content = item_list[Content]->minimumSize();
never executed: content = item_list[Content]->minimumSize();
0
310-
311 return
never executed: return sizeFromContent(content, w->isFloating());
sizeFromContent(content, w->isFloating());
never executed: return sizeFromContent(content, w->isFloating());
0
312}-
313-
314QWidget *QDockWidgetLayout::widgetForRole(Role r) const-
315{-
316 QLayoutItem *item = item_list.at(r);-
317 return
never executed: return item == 0 ? 0 : item->widget();
item == 0 ? 0 : item->widget();
never executed: return item == 0 ? 0 : item->widget();
0
318}-
319-
320QLayoutItem *QDockWidgetLayout::itemForRole(Role r) const-
321{-
322 return
never executed: return item_list.at(r);
item_list.at(r);
never executed: return item_list.at(r);
0
323}-
324-
325void QDockWidgetLayout::setWidgetForRole(Role r, QWidget *w)-
326{-
327 QWidget *old = widgetForRole(r);-
328 if (old != 0
old != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
329 old->hide();-
330 removeWidget(old);-
331 }
never executed: end of block
0
332-
333 if (w != 0
w != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
334 addChildWidget(w);-
335 item_list[r] = new QWidgetItemV2(w);-
336 w->show();-
337 }
never executed: end of block
else {
0
338 item_list[r] = 0;-
339 }
never executed: end of block
0
340-
341 invalidate();-
342}
never executed: end of block
0
343-
344static inline int pick(bool vertical, const QSize &size)-
345{-
346 return
never executed: return vertical ? size.height() : size.width();
vertical ? size.height() : size.width();
never executed: return vertical ? size.height() : size.width();
0
347}-
348-
349static inline int perp(bool vertical, const QSize &size)-
350{-
351 return
never executed: return vertical ? size.width() : size.height();
vertical ? size.width() : size.height();
never executed: return vertical ? size.width() : size.height();
0
352}-
353-
354int QDockWidgetLayout::minimumTitleWidth() const-
355{-
356 QDockWidget *q = qobject_cast<QDockWidget*>(parentWidget());-
357-
358 if (QWidget *title = widgetForRole(TitleBar)
QWidget *title...Role(TitleBar)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
359 return
never executed: return pick(verticalTitleBar, title->minimumSizeHint());
pick(verticalTitleBar, title->minimumSizeHint());
never executed: return pick(verticalTitleBar, title->minimumSizeHint());
0
360-
361 QSize closeSize(0, 0);-
362 QSize floatSize(0, 0);-
363 if (hasFeature(q, QDockWidget::DockWidgetClosable)
hasFeature(q, ...idgetClosable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
364 if (QLayoutItem *item = item_list[CloseButton]
QLayoutItem *i...t[CloseButton]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
365 closeSize = item->widget()->sizeHint();
never executed: closeSize = item->widget()->sizeHint();
0
366 }
never executed: end of block
0
367 if (hasFeature(q, QDockWidget::DockWidgetFloatable)
hasFeature(q, ...dgetFloatable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
368 if (QLayoutItem *item = item_list[FloatButton]
QLayoutItem *i...t[FloatButton]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
369 floatSize = item->widget()->sizeHint();
never executed: floatSize = item->widget()->sizeHint();
0
370 }
never executed: end of block
0
371-
372 int titleHeight = this->titleHeight();-
373-
374 int mw = q->style()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, 0, q);-
375 int fw = q->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, q);-
376-
377 return
never executed: return pick(verticalTitleBar, closeSize) + pick(verticalTitleBar, floatSize) + titleHeight + 2*fw + 3*mw;
pick(verticalTitleBar, closeSize)
never executed: return pick(verticalTitleBar, closeSize) + pick(verticalTitleBar, floatSize) + titleHeight + 2*fw + 3*mw;
0
378 + pick(verticalTitleBar, floatSize)
never executed: return pick(verticalTitleBar, closeSize) + pick(verticalTitleBar, floatSize) + titleHeight + 2*fw + 3*mw;
0
379 + titleHeight + 2*fw + 3*mw;
never executed: return pick(verticalTitleBar, closeSize) + pick(verticalTitleBar, floatSize) + titleHeight + 2*fw + 3*mw;
0
380}-
381-
382int QDockWidgetLayout::titleHeight() const-
383{-
384 QDockWidget *q = qobject_cast<QDockWidget*>(parentWidget());-
385-
386 if (QWidget *title = widgetForRole(TitleBar)
QWidget *title...Role(TitleBar)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
387 return
never executed: return perp(verticalTitleBar, title->sizeHint());
perp(verticalTitleBar, title->sizeHint());
never executed: return perp(verticalTitleBar, title->sizeHint());
0
388-
389 QSize closeSize(0, 0);-
390 QSize floatSize(0, 0);-
391 if (QLayoutItem *item = item_list[CloseButton]
QLayoutItem *i...t[CloseButton]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
392 closeSize = item->widget()->sizeHint();
never executed: closeSize = item->widget()->sizeHint();
0
393 if (QLayoutItem *item = item_list[FloatButton]
QLayoutItem *i...t[FloatButton]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
394 floatSize = item->widget()->sizeHint();
never executed: floatSize = item->widget()->sizeHint();
0
395-
396 int buttonHeight = qMax(perp(verticalTitleBar, closeSize),-
397 perp(verticalTitleBar, floatSize));-
398-
399 QFontMetrics titleFontMetrics = q->fontMetrics();-
400 int mw = q->style()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, 0, q);-
401-
402 return
never executed: return qMax(buttonHeight + 2, titleFontMetrics.height() + 2*mw);
qMax(buttonHeight + 2, titleFontMetrics.height() + 2*mw);
never executed: return qMax(buttonHeight + 2, titleFontMetrics.height() + 2*mw);
0
403}-
404-
405void QDockWidgetLayout::setGeometry(const QRect &geometry)-
406{-
407 QDockWidget *q = qobject_cast<QDockWidget*>(parentWidget());-
408-
409 bool nativeDeco = nativeWindowDeco();-
410-
411 int fw = q->isFloating()
q->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
&& !nativeDeco
!nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
0
412 ? q->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, q)-
413 : 0;-
414-
415 if (nativeDeco
nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
416 if (QLayoutItem *item = item_list[Content]
QLayoutItem *i..._list[Content]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
417 item->setGeometry(geometry);
never executed: item->setGeometry(geometry);
0
418 }
never executed: end of block
else {
0
419 int titleHeight = this->titleHeight();-
420-
421 if (verticalTitleBar
verticalTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
422 _titleArea = QRect(QPoint(fw, fw),-
423 QSize(titleHeight, geometry.height() - (fw * 2)));-
424 }
never executed: end of block
else {
0
425 _titleArea = QRect(QPoint(fw, fw),-
426 QSize(geometry.width() - (fw * 2), titleHeight));-
427 }
never executed: end of block
0
428-
429 if (QLayoutItem *item = item_list[TitleBar]
QLayoutItem *i...list[TitleBar]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
430 item->setGeometry(_titleArea);-
431 }
never executed: end of block
else {
0
432 QStyleOptionDockWidget opt;-
433 q->initStyleOption(&opt);-
434-
435 if (QLayoutItem *item = item_list[CloseButton]
QLayoutItem *i...t[CloseButton]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
436 if (!item->isEmpty()
!item->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
437 QRect r = q->style()-
438 ->subElementRect(QStyle::SE_DockWidgetCloseButton,-
439 &opt, q);-
440 if (!r.isNull()
!r.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
441 item->setGeometry(r);
never executed: item->setGeometry(r);
0
442 }
never executed: end of block
0
443 }
never executed: end of block
0
444-
445 if (QLayoutItem *item = item_list[FloatButton]
QLayoutItem *i...t[FloatButton]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
446 if (!item->isEmpty()
!item->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
447 QRect r = q->style()-
448 ->subElementRect(QStyle::SE_DockWidgetFloatButton,-
449 &opt, q);-
450 if (!r.isNull()
!r.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
451 item->setGeometry(r);
never executed: item->setGeometry(r);
0
452 }
never executed: end of block
0
453 }
never executed: end of block
0
454 }
never executed: end of block
0
455-
456 if (QLayoutItem *item = item_list[Content]
QLayoutItem *i..._list[Content]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
457 QRect r = geometry;-
458 if (verticalTitleBar
verticalTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
459 r.setLeft(_titleArea.right() + 1);-
460 r.adjust(0, fw, -fw, -fw);-
461 }
never executed: end of block
else {
0
462 r.setTop(_titleArea.bottom() + 1);-
463 r.adjust(fw, 0, -fw, -fw);-
464 }
never executed: end of block
0
465 item->setGeometry(r);-
466 }
never executed: end of block
0
467 }
never executed: end of block
0
468}-
469-
470void QDockWidgetLayout::setVerticalTitleBar(bool b)-
471{-
472 if (b == verticalTitleBar
b == verticalTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
473 return;
never executed: return;
0
474 verticalTitleBar = b;-
475 invalidate();-
476 parentWidget()->update();-
477}
never executed: end of block
0
478-
479-
480-
481-
482-
483QDockWidgetItem::QDockWidgetItem(QDockWidget *dockWidget)-
484 : QWidgetItem(dockWidget)-
485{-
486}
never executed: end of block
0
487-
488QSize QDockWidgetItem::minimumSize() const-
489{-
490 QSize widgetMin(0, 0);-
491 if (QLayoutItem *item = dockWidgetChildItem()
QLayoutItem *i...getChildItem()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
492 widgetMin = item->minimumSize();
never executed: widgetMin = item->minimumSize();
0
493 return
never executed: return dockWidgetLayout()->sizeFromContent(widgetMin, false);
dockWidgetLayout()->sizeFromContent(widgetMin, false);
never executed: return dockWidgetLayout()->sizeFromContent(widgetMin, false);
0
494}-
495-
496QSize QDockWidgetItem::maximumSize() const-
497{-
498 if (QLayoutItem *item = dockWidgetChildItem()
QLayoutItem *i...getChildItem()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
499 return
never executed: return dockWidgetLayout()->sizeFromContent(item->maximumSize(), false);
dockWidgetLayout()->sizeFromContent(item->maximumSize(), false);
never executed: return dockWidgetLayout()->sizeFromContent(item->maximumSize(), false);
0
500 } else {-
501 return
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
QSize(((1<<24)-1), ((1<<24)-1));
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
0
502 }-
503}-
504-
505-
506QSize QDockWidgetItem::sizeHint() const-
507{-
508 if (QLayoutItem *item = dockWidgetChildItem()
QLayoutItem *i...getChildItem()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
509 return
never executed: return dockWidgetLayout()->sizeFromContent(item->sizeHint(), false);
dockWidgetLayout()->sizeFromContent(item->sizeHint(), false);
never executed: return dockWidgetLayout()->sizeFromContent(item->sizeHint(), false);
0
510 } else {-
511 return
never executed: return QWidgetItem::sizeHint();
QWidgetItem::sizeHint();
never executed: return QWidgetItem::sizeHint();
0
512 }-
513}-
514-
515-
516-
517-
518-
519void QDockWidgetPrivate::init()-
520{-
521 QDockWidget * const q = q_func();-
522-
523 QDockWidgetLayout *layout = new QDockWidgetLayout(q);-
524 layout->setSizeConstraint(QLayout::SetMinAndMaxSize);-
525-
526 QAbstractButton *button = new QDockWidgetTitleButton(q);-
527 button->setObjectName(QLatin1String("qt_dockwidget_floatbutton"));-
528 QObject::connect(button, qFlagLocation("2""clicked()" "\0" __FILE__ ":" "612"), q, qFlagLocation("1""_q_toggleTopLevel()" "\0" __FILE__ ":" "612"));-
529 layout->setWidgetForRole(QDockWidgetLayout::FloatButton, button);-
530-
531 button = new QDockWidgetTitleButton(q);-
532 button->setObjectName(QLatin1String("qt_dockwidget_closebutton"));-
533 QObject::connect(button, qFlagLocation("2""clicked()" "\0" __FILE__ ":" "617"), q, qFlagLocation("1""close()" "\0" __FILE__ ":" "617"));-
534 layout->setWidgetForRole(QDockWidgetLayout::CloseButton, button);-
535-
536-
537 toggleViewAction = new QAction(q);-
538 toggleViewAction->setCheckable(true);-
539 toggleViewAction->setMenuRole(QAction::NoRole);-
540 fixedWindowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q);-
541 toggleViewAction->setText(fixedWindowTitle);-
542 QObject::connect(toggleViewAction, qFlagLocation("2""triggered(bool)" "\0" __FILE__ ":" "626"),-
543 q, qFlagLocation("1""_q_toggleView(bool)" "\0" __FILE__ ":" "627"));-
544-
545-
546 updateButtons();-
547}
never executed: end of block
0
548void QDockWidget::initStyleOption(QStyleOptionDockWidget *option) const-
549{-
550 const QDockWidgetPrivate * const d = d_func();-
551-
552 if (!option
!optionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
553 return;
never executed: return;
0
554 QDockWidgetLayout *dwlayout = qobject_cast<QDockWidgetLayout*>(layout());-
555-
556 QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent());-
557-
558-
559 option->initFrom(floatingTab && !isFloating() ? parentWidget() : this);-
560 option->rect = dwlayout->titleArea();-
561 option->title = d->fixedWindowTitle;-
562 option->closable = hasFeature(this, QDockWidget::DockWidgetClosable);-
563 option->movable = hasFeature(this, QDockWidget::DockWidgetMovable);-
564 option->floatable = hasFeature(this, QDockWidget::DockWidgetFloatable);-
565-
566 QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(layout());-
567 option->verticalTitleBar = l->verticalTitleBar;-
568}
never executed: end of block
0
569-
570void QDockWidgetPrivate::_q_toggleView(bool b)-
571{-
572 QDockWidget * const q = q_func();-
573 if (b == q->isHidden()
b == q->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
574 if (b
bDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
575 q->show();
never executed: q->show();
0
576 else-
577 q->close();
never executed: q->close();
0
578 }-
579}
never executed: end of block
0
580-
581void QDockWidgetPrivate::updateButtons()-
582{-
583 QDockWidget * const q = q_func();-
584 QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);-
585-
586 QStyleOptionDockWidget opt;-
587 q->initStyleOption(&opt);-
588-
589 bool customTitleBar = dwLayout->widgetForRole(QDockWidgetLayout::TitleBar) != 0;-
590 bool nativeDeco = dwLayout->nativeWindowDeco();-
591 bool hideButtons = nativeDeco
nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
|| customTitleBar
customTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
592-
593 bool canClose = hasFeature(this, QDockWidget::DockWidgetClosable);-
594 bool canFloat = hasFeature(this, QDockWidget::DockWidgetFloatable);-
595-
596 QAbstractButton *button-
597 = qobject_cast<QAbstractButton*>(dwLayout->widgetForRole(QDockWidgetLayout::FloatButton));-
598 button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarNormalButton, &opt, q));-
599 button->setVisible(canFloat && !hideButtons);-
600-
601-
602 button->setAccessibleName(QDockWidget::tr("Float"));-
603 button->setAccessibleDescription(QDockWidget::tr("Undocks and re-attaches the dock widget"));-
604-
605 button-
606 = qobject_cast <QAbstractButton*>(dwLayout->widgetForRole(QDockWidgetLayout::CloseButton));-
607 button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarCloseButton, &opt, q));-
608 button->setVisible(canClose && !hideButtons);-
609-
610-
611 button->setAccessibleName(QDockWidget::tr("Close"));-
612 button->setAccessibleDescription(QDockWidget::tr("Closes the dock widget"));-
613-
614 q->setAttribute(Qt::WA_ContentsPropagated,-
615 (canFloat || canClose) && !hideButtons);-
616-
617 layout->invalidate();-
618}
never executed: end of block
0
619-
620void QDockWidgetPrivate::_q_toggleTopLevel()-
621{-
622 QDockWidget * const q = q_func();-
623 q->setFloating(!q->isFloating());-
624}
never executed: end of block
0
625-
626-
627-
628-
629-
630-
631-
632void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca)-
633{-
634 QDockWidget * const q = q_func();-
635-
636 if (state != 0
state != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
637 return;
never executed: return;
0
638-
639 QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);-
640 ((!(layout != 0)) ? qt_assert("layout != 0",__FILE__,732) : qt_noop());-
641 if (layout->pluggingWidget != 0
layout->pluggingWidget != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
642 return;
never executed: return;
0
643-
644 state = new QDockWidgetPrivate::DragState;-
645 state->pressPos = pos;-
646 state->dragging = false;-
647 state->widgetItem = 0;-
648 state->ownWidgetItem = false;-
649 state->nca = nca;-
650 state->ctrlDrag = false;-
651}
never executed: end of block
0
652-
653-
654-
655-
656-
657-
658-
659void QDockWidgetPrivate::startDrag(bool group)-
660{-
661 QDockWidget * const q = q_func();-
662-
663 if (state == 0
state == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| state->dragging
state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
664 return;
never executed: return;
0
665-
666 QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);-
667 ((!(layout != 0)) ? qt_assert("layout != 0",__FILE__,759) : qt_noop());-
668-
669 state->widgetItem = layout->unplug(q, group);-
670 if (state->widgetItem == 0
state->widgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
671-
672-
673-
674-
675 QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);-
676 if (floatingTab
floatingTabDescription
TRUEnever evaluated
FALSEnever evaluated
&& !q->isFloating()
!q->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
677 state->widgetItem = new QDockWidgetGroupWindowItem(floatingTab);
never executed: state->widgetItem = new QDockWidgetGroupWindowItem(floatingTab);
0
678 else-
679 state->widgetItem = new QDockWidgetItem(q);
never executed: state->widgetItem = new QDockWidgetItem(q);
0
680 state->ownWidgetItem = true;-
681 }
never executed: end of block
0
682-
683 if (state->ctrlDrag
state->ctrlDragDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
684 layout->restore();
never executed: layout->restore();
0
685-
686 state->dragging = true;-
687}
never executed: end of block
0
688-
689-
690-
691-
692-
693-
694void QDockWidgetPrivate::endDrag(bool abort)-
695{-
696 QDockWidget * const q = q_func();-
697 ((!(state != 0)) ? qt_assert("state != 0",__FILE__,789) : qt_noop());-
698-
699 q->releaseMouse();-
700-
701 if (state->dragging
state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
702 QMainWindowLayout *mwLayout = qt_mainwindow_layout_from_dock(q);-
703 ((!(mwLayout != 0)) ? qt_assert("mwLayout != 0",__FILE__,795) : qt_noop());-
704-
705 if (abort
abortDescription
TRUEnever evaluated
FALSEnever evaluated
|| !mwLayout->plug(state->widgetItem)
!mwLayout->plu...e->widgetItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
706 if (hasFeature(this, QDockWidget::DockWidgetFloatable)
hasFeature(thi...dgetFloatable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
707-
708 if (state->ownWidgetItem
state->ownWidgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
709 delete state->widgetItem;
never executed: delete state->widgetItem;
0
710 mwLayout->restore();-
711 QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);-
712 if (!dwLayout->nativeWindowDeco()
!dwLayout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
713-
714 Qt::WindowFlags flags = q->windowFlags();-
715 flags &= ~Qt::X11BypassWindowManagerHint;-
716 q->setWindowFlags(flags);-
717 setResizerActive(q->isFloating());-
718 q->show();-
719 }
never executed: end of block
else {
0
720 setResizerActive(false);-
721 }
never executed: end of block
0
722 if (q->isFloating()
q->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
723 undockedGeometry = q->geometry();
never executed: undockedGeometry = q->geometry();
0
724 q->activateWindow();-
725 }
never executed: end of block
else {
0
726-
727-
728 mwLayout->revert(state->widgetItem);-
729 }
never executed: end of block
0
730 }-
731 }
never executed: end of block
0
732 delete state;-
733 state = 0;-
734}
never executed: end of block
0
735-
736void QDockWidgetPrivate::setResizerActive(bool active)-
737{-
738 QDockWidget * const q = q_func();-
739 if (active
activeDescription
TRUEnever evaluated
FALSEnever evaluated
&& !resizer
!resizerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
740 resizer = new QWidgetResizeHandler(q);-
741 resizer->setMovingEnabled(false);-
742 }
never executed: end of block
0
743 if (resizer
resizerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
744 resizer->setActive(QWidgetResizeHandler::Resize, active);
never executed: resizer->setActive(QWidgetResizeHandler::Resize, active);
0
745}
never executed: end of block
0
746-
747bool QDockWidgetPrivate::isAnimating() const-
748{-
749 const QDockWidget * const q = q_func();-
750-
751 QMainWindowLayout *mainWinLayout = qt_mainwindow_layout_from_dock(q);-
752 if (mainWinLayout == 0
mainWinLayout == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
753 return
never executed: return false;
false;
never executed: return false;
0
754-
755 return
never executed: return (const void*)mainWinLayout->pluggingWidget == (const void*)q;
(const void*)mainWinLayout->pluggingWidget == (const void*)q;
never executed: return (const void*)mainWinLayout->pluggingWidget == (const void*)q;
0
756}-
757-
758bool QDockWidgetPrivate::mousePressEvent(QMouseEvent *event)-
759{-
760-
761 QDockWidget * const q = q_func();-
762-
763 QDockWidgetLayout *dwLayout-
764 = qobject_cast<QDockWidgetLayout*>(layout);-
765-
766 if (!dwLayout->nativeWindowDeco()
!dwLayout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
767 QRect titleArea = dwLayout->titleArea();-
768-
769 QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);-
770-
771 if (event->button() != Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
||
0
772 !titleArea.contains(event->pos())
!titleArea.con...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
||
0
773-
774-
775 (!hasFeature(this, QDockWidget::DockWidgetMovable)
!hasFeature(th...WidgetMovable)Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->isFloating()
!q->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
) ||
0
776 (qobject_cast<QMainWindow*>(parent) == 0
qobject_cast<Q...>(parent) == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& !floatingTab
!floatingTabDescription
TRUEnever evaluated
FALSEnever evaluated
) ||
0
777 isAnimating()
isAnimating()Description
TRUEnever evaluated
FALSEnever evaluated
|| state != 0
state != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
778 return
never executed: return false;
false;
never executed: return false;
0
779 }-
780-
781 initDrag(event->pos(), false);-
782-
783 if (state
stateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
784 state->ctrlDrag = hasFeature(this, QDockWidget::DockWidgetFloatable)
hasFeature(thi...dgetFloatable)Description
TRUEnever evaluated
FALSEnever evaluated
&& event->modifiers() & Qt::ControlModifier
event->modifie...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
;
never executed: state->ctrlDrag = hasFeature(this, QDockWidget::DockWidgetFloatable) && event->modifiers() & Qt::ControlModifier;
0
785-
786 return
never executed: return true;
true;
never executed: return true;
0
787 }-
788-
789-
790 return
never executed: return false;
false;
never executed: return false;
0
791}-
792-
793bool QDockWidgetPrivate::mouseDoubleClickEvent(QMouseEvent *event)-
794{-
795 QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);-
796-
797 if (!dwLayout->nativeWindowDeco()
!dwLayout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
798 QRect titleArea = dwLayout->titleArea();-
799-
800 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& titleArea.contains(event->pos())
titleArea.cont...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
801 hasFeature(this, QDockWidget::DockWidgetFloatable)
hasFeature(thi...dgetFloatable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
802 _q_toggleTopLevel();-
803 return
never executed: return true;
true;
never executed: return true;
0
804 }-
805 }
never executed: end of block
0
806 return
never executed: return false;
false;
never executed: return false;
0
807}-
808-
809bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)-
810{-
811 bool ret = false;-
812-
813 QDockWidget * const q = q_func();-
814-
815 if (!state
!stateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
816 return
never executed: return ret;
ret;
never executed: return ret;
0
817-
818 QDockWidgetLayout *dwlayout-
819 = qobject_cast<QDockWidgetLayout *>(layout);-
820 QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);-
821 if (!dwlayout->nativeWindowDeco()
!dwlayout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
822 if (!state->dragging
!state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
0
823 && mwlayout->pluggingWidget == 0
mwlayout->pluggingWidget == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
824 && (
(event->pos() ...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
event->pos() - state->pressPos).manhattanLength()
(event->pos() ...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
0
825 > QApplication::startDragDistance()
(event->pos() ...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
826 startDrag();-
827-
828-
829-
830 q->grabMouse();-
831-
832 ret = true;-
833 }
never executed: end of block
0
834 }
never executed: end of block
0
835-
836 if (state->dragging
state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
&& !state->nca
!state->ncaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
837 QPoint pos = event->globalPos() - state->pressPos;-
838-
839 QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);-
840 if (floatingTab
floatingTabDescription
TRUEnever evaluated
FALSEnever evaluated
&& !q->isFloating()
!q->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
841 floatingTab->move(pos);
never executed: floatingTab->move(pos);
0
842 else-
843 q->move(pos);
never executed: q->move(pos);
0
844-
845 if (state
stateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !state->ctrlDrag
!state->ctrlDragDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
846 mwlayout->hover(state->widgetItem, event->globalPos());
never executed: mwlayout->hover(state->widgetItem, event->globalPos());
0
847-
848 ret = true;-
849 }
never executed: end of block
0
850-
851-
852 return
never executed: return ret;
ret;
never executed: return ret;
0
853}-
854-
855bool QDockWidgetPrivate::mouseReleaseEvent(QMouseEvent *event)-
856{-
857-
858-
859 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& state
stateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !state->nca
!state->ncaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
860 endDrag();-
861 return
never executed: return true;
true;
never executed: return true;
0
862 }-
863-
864-
865 return
never executed: return false;
false;
never executed: return false;
0
866}-
867-
868void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event)-
869{-
870 QDockWidget * const q = q_func();-
871-
872 int fw = q->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, q);-
873-
874 QWidget *tl = q->topLevelWidget();-
875 QRect geo = tl->geometry();-
876 QRect titleRect = tl->frameGeometry();-
877-
878-
879-
880-
881-
882-
883-
884 {-
885 titleRect.setLeft(geo.left());-
886 titleRect.setRight(geo.right());-
887 titleRect.setBottom(geo.top() - 1);-
888 titleRect.adjust(0, fw, 0, 0);-
889 }-
890-
891 switch (event->type()) {-
892 case
never executed: case QEvent::NonClientAreaMouseButtonPress:
QEvent::NonClientAreaMouseButtonPress:
never executed: case QEvent::NonClientAreaMouseButtonPress:
0
893 if (!titleRect.contains(event->globalPos())
!titleRect.con...->globalPos())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
894 break;
never executed: break;
0
895 if (state != 0
state != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
896 break;
never executed: break;
0
897 if (qobject_cast<QMainWindow*>(parent) == 0
qobject_cast<Q...>(parent) == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& qobject_cast<QDockWidgetGroupWindow*>(parent) == 0
qobject_cast<Q...>(parent) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
898 break;
never executed: break;
0
899 if (isAnimating()
isAnimating()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
900 break;
never executed: break;
0
901 initDrag(event->pos(), true);-
902 if (state == 0
state == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
903 break;
never executed: break;
0
904 state->ctrlDrag = event->modifiers() & Qt::ControlModifier;-
905 startDrag();-
906 break;
never executed: break;
0
907 case
never executed: case QEvent::NonClientAreaMouseMove:
QEvent::NonClientAreaMouseMove:
never executed: case QEvent::NonClientAreaMouseMove:
0
908 if (state == 0
state == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !state->dragging
!state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
909 break;
never executed: break;
0
910-
911-
912 if (state->nca
state->ncaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
913 endDrag();-
914 }
never executed: end of block
0
915-
916 break;
never executed: break;
0
917 case
never executed: case QEvent::NonClientAreaMouseButtonRelease:
QEvent::NonClientAreaMouseButtonRelease:
never executed: case QEvent::NonClientAreaMouseButtonRelease:
0
918-
919-
920-
921-
922 break;
never executed: break;
0
923 case
never executed: case QEvent::NonClientAreaMouseButtonDblClick:
QEvent::NonClientAreaMouseButtonDblClick:
never executed: case QEvent::NonClientAreaMouseButtonDblClick:
0
924 _q_toggleTopLevel();-
925 break;
never executed: break;
0
926 default
never executed: default:
:
never executed: default:
0
927 break;
never executed: break;
0
928 }-
929}-
930-
931-
932-
933-
934void QDockWidgetPrivate::moveEvent(QMoveEvent *event)-
935{-
936 QDockWidget * const q = q_func();-
937-
938 if (state == 0
state == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !state->dragging
!state->draggingDescription
TRUEnever evaluated
FALSEnever evaluated
|| !state->nca
!state->ncaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
939 return;
never executed: return;
0
940-
941 if (!q->isWindow()
!q->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& qobject_cast<QDockWidgetGroupWindow*>(parent) == 0
qobject_cast<Q...>(parent) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
942 return;
never executed: return;
0
943-
944-
945-
946-
947 if (state->ctrlDrag
state->ctrlDragDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
948 return;
never executed: return;
0
949-
950 QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);-
951 ((!(layout != 0)) ? qt_assert("layout != 0",__FILE__,1043) : qt_noop());-
952-
953 QPoint globalMousePos = event->pos() + state->pressPos;-
954 layout->hover(state->widgetItem, globalMousePos);-
955}
never executed: end of block
0
956-
957void QDockWidgetPrivate::unplug(const QRect &rect)-
958{-
959 QDockWidget * const q = q_func();-
960 QRect r = rect;-
961 r.moveTopLeft(q->mapToGlobal(QPoint(0, 0)));-
962 QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);-
963 if (dwLayout->nativeWindowDeco(true)
dwLayout->nati...ndowDeco(true)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
964 r.adjust(0, dwLayout->titleHeight(), 0, 0);
never executed: r.adjust(0, dwLayout->titleHeight(), 0, 0);
0
965 setWindowState(true, true, r);-
966}
never executed: end of block
0
967-
968void QDockWidgetPrivate::plug(const QRect &rect)-
969{-
970 setWindowState(false, false, rect);-
971}
never executed: end of block
0
972-
973void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect &rect)-
974{-
975 QDockWidget * const q = q_func();-
976-
977 if (!floating
!floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
978 QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);-
979 if (mwlayout
mwlayoutDescription
TRUEnever evaluated
FALSEnever evaluated
&& mwlayout->dockWidgetArea(q) == Qt::NoDockWidgetArea
mwlayout->dock...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
980 && !qobject_cast<QDockWidgetGroupWindow *>(parent)
!qobject_cast<...dow *>(parent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
981 return;
never executed: return;
0
982 }
never executed: end of block
0
983-
984 bool wasFloating = q->isFloating();-
985 if (wasFloating
wasFloatingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
986 unplug = false;
never executed: unplug = false;
0
987 bool hidden = q->isHidden();-
988-
989 if (q->isVisible()
q->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
990 q->hide();
never executed: q->hide();
0
991-
992 Qt::WindowFlags flags = floating
floatingDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::Tool : Qt::Widget;
0
993-
994 QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);-
995 const bool nativeDeco = dwLayout->nativeWindowDeco(floating);-
996-
997 if (nativeDeco
nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
998 flags |= Qt::CustomizeWindowHint | Qt::WindowTitleHint;-
999 if (hasFeature(this, QDockWidget::DockWidgetClosable)
hasFeature(thi...idgetClosable)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1000 flags |= Qt::WindowCloseButtonHint;
never executed: flags |= Qt::WindowCloseButtonHint;
0
1001 }
never executed: end of block
else {
0
1002 flags |= Qt::FramelessWindowHint;-
1003 }
never executed: end of block
0
1004-
1005 if (unplug
unplugDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1006 flags |= Qt::X11BypassWindowManagerHint;
never executed: flags |= Qt::X11BypassWindowManagerHint;
0
1007-
1008 q->setWindowFlags(flags);-
1009-
1010-
1011 if (!rect.isNull()
!rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1012 q->setGeometry(rect);
never executed: q->setGeometry(rect);
0
1013-
1014 updateButtons();-
1015-
1016 if (!hidden
!hiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1017 q->show();
never executed: q->show();
0
1018-
1019 if (floating != wasFloating
floating != wasFloatingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1020 q->topLevelChanged(floating);-
1021 if (!floating
!floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1022 QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);-
1023 if (mwlayout
mwlayoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1024 q->dockLocationChanged(mwlayout->dockWidgetArea(q));
never executed: q->dockLocationChanged(mwlayout->dockWidgetArea(q));
0
1025 }
never executed: end of block
0
1026 }
never executed: end of block
0
1027-
1028 setResizerActive(!unplug && floating && !nativeDeco);-
1029}
never executed: end of block
0
1030QDockWidget::QDockWidget(QWidget *parent, Qt::WindowFlags flags)-
1031 : QWidget(*new QDockWidgetPrivate, parent, flags)-
1032{-
1033 QDockWidgetPrivate * const d = d_func();-
1034 d->init();-
1035}
never executed: end of block
0
1036QDockWidget::QDockWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)-
1037 : QWidget(*new QDockWidgetPrivate, parent, flags)-
1038{-
1039 QDockWidgetPrivate * const d = d_func();-
1040 d->init();-
1041 setWindowTitle(title);-
1042}
never executed: end of block
0
1043-
1044-
1045-
1046-
1047QDockWidget::~QDockWidget()-
1048{ }-
1049-
1050-
1051-
1052-
1053-
1054-
1055-
1056QWidget *QDockWidget::widget() const-
1057{-
1058 QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout());-
1059 return
never executed: return layout->widgetForRole(QDockWidgetLayout::Content);
layout->widgetForRole(QDockWidgetLayout::Content);
never executed: return layout->widgetForRole(QDockWidgetLayout::Content);
0
1060}-
1061void QDockWidget::setWidget(QWidget *widget)-
1062{-
1063 QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout());-
1064 layout->setWidgetForRole(QDockWidgetLayout::Content, widget);-
1065}
never executed: end of block
0
1066void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features)-
1067{-
1068 QDockWidgetPrivate * const d = d_func();-
1069 features &= DockWidgetFeatureMask;-
1070 if (d->features == features
d->features == featuresDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1071 return;
never executed: return;
0
1072 const bool closableChanged = (d->features ^ features) & DockWidgetClosable;-
1073 d->features = features;-
1074 QDockWidgetLayout *layout-
1075 = qobject_cast<QDockWidgetLayout*>(this->layout());-
1076 layout->setVerticalTitleBar(features & DockWidgetVerticalTitleBar);-
1077 d->updateButtons();-
1078 d->toggleViewAction->setEnabled((d->features & DockWidgetClosable) == DockWidgetClosable);-
1079 featuresChanged(d->features);-
1080 update();-
1081 if (closableChanged
closableChangedDescription
TRUEnever evaluated
FALSEnever evaluated
&& layout->nativeWindowDeco()
layout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1082 QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow *>(parent());-
1083 if (floatingTab
floatingTabDescription
TRUEnever evaluated
FALSEnever evaluated
&& !isFloating()
!isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1084 floatingTab->adjustFlags();
never executed: floatingTab->adjustFlags();
0
1085 else-
1086 d->setWindowState(true , true );
never executed: d->setWindowState(true , true );
0
1087 }-
1088}
never executed: end of block
0
1089-
1090QDockWidget::DockWidgetFeatures QDockWidget::features() const-
1091{-
1092 const QDockWidgetPrivate * const d = d_func();-
1093 return
never executed: return d->features;
d->features;
never executed: return d->features;
0
1094}-
1095void QDockWidget::setFloating(bool floating)-
1096{-
1097 QDockWidgetPrivate * const d = d_func();-
1098-
1099-
1100 if (d->state != 0
d->state != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1101 d->endDrag(true);
never executed: d->endDrag(true);
0
1102-
1103 QRect r = d->undockedGeometry;-
1104-
1105 if (floating
floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& !r.isValid()
!r.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1106 r = QRect(mapToGlobal(QPoint(0, 0)), size());
never executed: r = QRect(mapToGlobal(QPoint(0, 0)), size());
0
1107-
1108 d->setWindowState(floating, false, floating ? r : QRect());-
1109-
1110 if (floating
floatingDescription
TRUEnever evaluated
FALSEnever evaluated
&& r.isNull()
r.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1111 if (x() < 0
x() < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| y() < 0
y() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1112 move(QPoint());
never executed: move(QPoint());
0
1113 setAttribute(Qt::WA_Moved, false);-
1114 }
never executed: end of block
0
1115}
never executed: end of block
0
1116void QDockWidget::setAllowedAreas(Qt::DockWidgetAreas areas)-
1117{-
1118 QDockWidgetPrivate * const d = d_func();-
1119 areas &= Qt::DockWidgetArea_Mask;-
1120 if (areas == d->allowedAreas
areas == d->allowedAreasDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1121 return;
never executed: return;
0
1122 d->allowedAreas = areas;-
1123 allowedAreasChanged(d->allowedAreas);-
1124}
never executed: end of block
0
1125-
1126Qt::DockWidgetAreas QDockWidget::allowedAreas() const-
1127{-
1128 const QDockWidgetPrivate * const d = d_func();-
1129 return
never executed: return d->allowedAreas;
d->allowedAreas;
never executed: return d->allowedAreas;
0
1130}-
1131void QDockWidget::changeEvent(QEvent *event)-
1132{-
1133 QDockWidgetPrivate * const d = d_func();-
1134 QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout());-
1135-
1136 switch (event->type()) {-
1137 case
never executed: case QEvent::ModifiedChange:
QEvent::ModifiedChange:
never executed: case QEvent::ModifiedChange:
0
1138 case
never executed: case QEvent::WindowTitleChange:
QEvent::WindowTitleChange:
never executed: case QEvent::WindowTitleChange:
0
1139 update(layout->titleArea());-
1140-
1141 d->fixedWindowTitle = qt_setWindowTitle_helperHelper(windowTitle(), this);-
1142 d->toggleViewAction->setText(d->fixedWindowTitle);-
1143-
1144-
1145 {-
1146 if (QMainWindowLayout *winLayout = qt_mainwindow_layout_from_dock(this)
QMainWindowLay...rom_dock(this)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1147 if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this)
QDockAreaLayou...out.info(this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1148 info->updateTabBar();
never executed: info->updateTabBar();
0
1149 }
never executed: end of block
0
1150 }-
1151-
1152 break;
never executed: break;
0
1153 default
never executed: default:
:
never executed: default:
0
1154 break;
never executed: break;
0
1155 }-
1156 QWidget::changeEvent(event);-
1157}
never executed: end of block
0
1158-
1159-
1160void QDockWidget::closeEvent(QCloseEvent *event)-
1161{-
1162 QDockWidgetPrivate * const d = d_func();-
1163 if (d->state
d->stateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1164 d->endDrag(true);
never executed: d->endDrag(true);
0
1165 QWidget::closeEvent(event);-
1166}
never executed: end of block
0
1167-
1168-
1169void QDockWidget::paintEvent(QPaintEvent *event)-
1170{-
1171 (void)event;-
1172-
1173 QDockWidgetLayout *layout-
1174 = qobject_cast<QDockWidgetLayout*>(this->layout());-
1175 bool customTitleBar = layout->widgetForRole(QDockWidgetLayout::TitleBar) != 0;-
1176 bool nativeDeco = layout->nativeWindowDeco();-
1177-
1178 if (!nativeDeco
!nativeDecoDescription
TRUEnever evaluated
FALSEnever evaluated
&& !customTitleBar
!customTitleBarDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1179 QStylePainter p(this);-
1180-
1181-
1182 if (isFloating()
isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1183 QStyleOptionFrame framOpt;-
1184 framOpt.init(this);-
1185 p.drawPrimitive(QStyle::PE_FrameDockWidget, framOpt);-
1186 }
never executed: end of block
0
1187-
1188-
1189-
1190 QStyleOptionDockWidget titleOpt;-
1191 initStyleOption(&titleOpt);-
1192 p.drawControl(QStyle::CE_DockWidgetTitle, titleOpt);-
1193 }
never executed: end of block
0
1194}
never executed: end of block
0
1195-
1196-
1197bool QDockWidget::event(QEvent *event)-
1198{-
1199 QDockWidgetPrivate * const d = d_func();-
1200-
1201 QMainWindow *win = qobject_cast<QMainWindow*>(parentWidget());-
1202 QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(this);-
1203-
1204 switch (event->type()) {-
1205-
1206 case
never executed: case QEvent::Hide:
QEvent::Hide:
never executed: case QEvent::Hide:
0
1207 if (layout != 0
layout != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1208 layout->keepSize(this);
never executed: layout->keepSize(this);
0
1209 d->toggleViewAction->setChecked(false);-
1210 visibilityChanged(false);-
1211 break;
never executed: break;
0
1212 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
{
0
1213 d->toggleViewAction->setChecked(true);-
1214 QPoint parentTopLeft(0, 0);-
1215 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1216 if (const
const QWindow ...windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
QWindow *window = windowHandle()
const QWindow ...windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1217 parentTopLeft = window->screen()->availableVirtualGeometry().topLeft();
never executed: parentTopLeft = window->screen()->availableVirtualGeometry().topLeft();
0
1218 else-
1219 parentTopLeft = QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
never executed: parentTopLeft = QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
0
1220 }-
1221 visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y());-
1222}-
1223 break;
never executed: break;
0
1224-
1225 case
never executed: case QEvent::ApplicationLayoutDirectionChange:
QEvent::ApplicationLayoutDirectionChange:
never executed: case QEvent::ApplicationLayoutDirectionChange:
0
1226 case
never executed: case QEvent::LayoutDirectionChange:
QEvent::LayoutDirectionChange:
never executed: case QEvent::LayoutDirectionChange:
0
1227 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
1228 case
never executed: case QEvent::ParentChange:
QEvent::ParentChange:
never executed: case QEvent::ParentChange:
0
1229 d->updateButtons();-
1230 break;
never executed: break;
0
1231 case
never executed: case QEvent::ZOrderChange:
QEvent::ZOrderChange:
never executed: case QEvent::ZOrderChange:
{
0
1232 bool onTop = false;-
1233 if (win != 0
win != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1234 const QObjectList &siblings = win->children();-
1235 onTop = siblings.count() > 0
siblings.count() > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& siblings.last() == (QObject*)this
siblings.last(...(QObject*)thisDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1236 }
never executed: end of block
0
1237 if (!isFloating()
!isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
&& layout != 0
layout != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& onTop
onTopDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1238 layout->raise(this);
never executed: layout->raise(this);
0
1239 break;
never executed: break;
0
1240 }-
1241 case
never executed: case QEvent::WindowActivate:
QEvent::WindowActivate:
never executed: case QEvent::WindowActivate:
0
1242 case
never executed: case QEvent::WindowDeactivate:
QEvent::WindowDeactivate:
never executed: case QEvent::WindowDeactivate:
0
1243 update(qobject_cast<QDockWidgetLayout *>(this->layout())->titleArea());-
1244 break;
never executed: break;
0
1245 case
never executed: case QEvent::ContextMenu:
QEvent::ContextMenu:
never executed: case QEvent::ContextMenu:
0
1246 if (d->state
d->stateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1247 event->accept();-
1248 return
never executed: return true;
true;
never executed: return true;
0
1249 }-
1250 break;
never executed: break;
0
1251-
1252-
1253 case
never executed: case QEvent::MouseButtonPress:
QEvent::MouseButtonPress:
never executed: case QEvent::MouseButtonPress:
0
1254 if (d->mousePressEvent(static_cast<QMouseEvent *>(event))
d->mousePressE...ent *>(event))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1255 return
never executed: return true;
true;
never executed: return true;
0
1256 break;
never executed: break;
0
1257 case
never executed: case QEvent::MouseButtonDblClick:
QEvent::MouseButtonDblClick:
never executed: case QEvent::MouseButtonDblClick:
0
1258 if (d->mouseDoubleClickEvent(static_cast<QMouseEvent *>(event))
d->mouseDouble...ent *>(event))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1259 return
never executed: return true;
true;
never executed: return true;
0
1260 break;
never executed: break;
0
1261 case
never executed: case QEvent::MouseMove:
QEvent::MouseMove:
never executed: case QEvent::MouseMove:
0
1262 if (d->mouseMoveEvent(static_cast<QMouseEvent *>(event))
d->mouseMoveEv...ent *>(event))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1263 return
never executed: return true;
true;
never executed: return true;
0
1264 break;
never executed: break;
0
1265 case
never executed: case QEvent::MouseButtonRelease:
QEvent::MouseButtonRelease:
never executed: case QEvent::MouseButtonRelease:
0
1266 if (d->mouseReleaseEvent(static_cast<QMouseEvent *>(event))
d->mouseReleas...ent *>(event))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1267 return
never executed: return true;
true;
never executed: return true;
0
1268 break;
never executed: break;
0
1269 case
never executed: case QEvent::NonClientAreaMouseMove:
QEvent::NonClientAreaMouseMove:
never executed: case QEvent::NonClientAreaMouseMove:
0
1270 case
never executed: case QEvent::NonClientAreaMouseButtonPress:
QEvent::NonClientAreaMouseButtonPress:
never executed: case QEvent::NonClientAreaMouseButtonPress:
0
1271 case
never executed: case QEvent::NonClientAreaMouseButtonRelease:
QEvent::NonClientAreaMouseButtonRelease:
never executed: case QEvent::NonClientAreaMouseButtonRelease:
0
1272 case
never executed: case QEvent::NonClientAreaMouseButtonDblClick:
QEvent::NonClientAreaMouseButtonDblClick:
never executed: case QEvent::NonClientAreaMouseButtonDblClick:
0
1273 d->nonClientAreaMouseEvent(static_cast<QMouseEvent*>(event));-
1274 return
never executed: return true;
true;
never executed: return true;
0
1275 case
never executed: case QEvent::Move:
QEvent::Move:
never executed: case QEvent::Move:
0
1276 d->moveEvent(static_cast<QMoveEvent*>(event));-
1277 break;
never executed: break;
0
1278 case
never executed: case QEvent::Resize:
QEvent::Resize:
never executed: case QEvent::Resize:
0
1279-
1280 if (isFloating()
isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
&& layout != 0
layout != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& layout->pluggingWidget != this
layout->pluggingWidget != thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1281 d->undockedGeometry = geometry();
never executed: d->undockedGeometry = geometry();
0
1282 break;
never executed: break;
0
1283 default
never executed: default:
:
never executed: default:
0
1284 break;
never executed: break;
0
1285 }-
1286 return
never executed: return QWidget::event(event);
QWidget::event(event);
never executed: return QWidget::event(event);
0
1287}-
1288QAction * QDockWidget::toggleViewAction() const-
1289{-
1290 const QDockWidgetPrivate * const d = d_func();-
1291 return
never executed: return d->toggleViewAction;
d->toggleViewAction;
never executed: return d->toggleViewAction;
0
1292}-
1293void QDockWidget::setTitleBarWidget(QWidget *widget)-
1294{-
1295 QDockWidgetPrivate * const d = d_func();-
1296 QDockWidgetLayout *layout-
1297 = qobject_cast<QDockWidgetLayout*>(this->layout());-
1298 layout->setWidgetForRole(QDockWidgetLayout::TitleBar, widget);-
1299 d->updateButtons();-
1300 if (isWindow()
isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1301-
1302 d->setWindowState(true , true );-
1303 }
never executed: end of block
0
1304}
never executed: end of block
0
1305QWidget *QDockWidget::titleBarWidget() const-
1306{-
1307 QDockWidgetLayout *layout-
1308 = qobject_cast<QDockWidgetLayout*>(this->layout());-
1309 return
never executed: return layout->widgetForRole(QDockWidgetLayout::TitleBar);
layout->widgetForRole(QDockWidgetLayout::TitleBar);
never executed: return layout->widgetForRole(QDockWidgetLayout::TitleBar);
0
1310}-
1311-
1312-
1313-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9