qsizegrip.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qsizegrip.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtWidgets module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qsizegrip.h"-
35-
36#ifndef QT_NO_SIZEGRIP-
37-
38#include "qapplication.h"-
39#include "qevent.h"-
40#include "qpainter.h"-
41#include "qwindow.h"-
42#include <qpa/qplatformwindow.h>-
43#include "qstyle.h"-
44#include "qstyleoption.h"-
45#include "qlayout.h"-
46#include "qdebug.h"-
47#include <QDesktopWidget>-
48-
49#ifdef Q_DEAD_CODE_FROM_QT4_MAC-
50#include <private/qt_mac_p.h>-
51#endif-
52-
53#include <private/qwidget_p.h>-
54#include <QtWidgets/qabstractscrollarea.h>-
55-
56QT_BEGIN_NAMESPACE-
57-
58static QWidget *qt_sizegrip_topLevelWidget(QWidget* w)-
59{-
60 while (w && !w->isWindow() && w->windowType() != Qt::SubWindow)
wDescription
TRUEnever evaluated
FALSEnever evaluated
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
w->windowType(... Qt::SubWindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
61 w = w->parentWidget();
never executed: w = w->parentWidget();
0
62 return w;
never executed: return w;
0
63}-
64-
65class QSizeGripPrivate : public QWidgetPrivate-
66{-
67 Q_DECLARE_PUBLIC(QSizeGrip)-
68public:-
69 QSizeGripPrivate();-
70 void init();-
71 QPoint p;-
72 QRect r;-
73 int d;-
74 int dxMax;-
75 int dyMax;-
76 Qt::Corner m_corner;-
77 bool gotMousePress;-
78 QPointer<QWidget> tlw;-
79#ifdef Q_DEAD_CODE_FROM_QT4_MAC-
80 void updateMacSizer(bool hide) const;-
81#endif-
82 Qt::Corner corner() const;-
83 inline bool atBottom() const-
84 {-
85 return m_corner == Qt::BottomRightCorner || m_corner == Qt::BottomLeftCorner;
never executed: return m_corner == Qt::BottomRightCorner || m_corner == Qt::BottomLeftCorner;
m_corner == Qt...tomRightCornerDescription
TRUEnever evaluated
FALSEnever evaluated
m_corner == Qt...ttomLeftCornerDescription
TRUEnever evaluated
FALSEnever evaluated
0
86 }-
87-
88 inline bool atLeft() const-
89 {-
90 return m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner;
never executed: return m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner;
m_corner == Qt...ttomLeftCornerDescription
TRUEnever evaluated
FALSEnever evaluated
m_corner == Qt::TopLeftCornerDescription
TRUEnever evaluated
FALSEnever evaluated
0
91 }-
92-
93 void updateTopLevelWidget()-
94 {-
95 Q_Q(QSizeGrip);-
96 QWidget *w = qt_sizegrip_topLevelWidget(q);-
97 if (tlw == w)
tlw == wDescription
TRUEnever evaluated
FALSEnever evaluated
0
98 return;
never executed: return;
0
99 if (tlw)
tlwDescription
TRUEnever evaluated
FALSEnever evaluated
0
100 tlw->removeEventFilter(q);
never executed: tlw->removeEventFilter(q);
0
101 tlw = w;-
102 if (tlw)
tlwDescription
TRUEnever evaluated
FALSEnever evaluated
0
103 tlw->installEventFilter(q);
never executed: tlw->installEventFilter(q);
0
104 }
never executed: end of block
0
105-
106 // This slot is invoked by QLayout when the size grip is added to-
107 // a layout or reparented after the tlw is shown. This re-implementation is basically-
108 // the same as QWidgetPrivate::_q_showIfNotHidden except that it checks-
109 // for Qt::WindowFullScreen and Qt::WindowMaximized as well.-
110 void _q_showIfNotHidden()-
111 {-
112 Q_Q(QSizeGrip);-
113 bool showSizeGrip = !(q->isHidden() && q->testAttribute(Qt::WA_WState_ExplicitShowHide));
q->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
q->testAttribu...licitShowHide)Description
TRUEnever evaluated
FALSEnever evaluated
0
114 updateTopLevelWidget();-
115 if (tlw && showSizeGrip) {
tlwDescription
TRUEnever evaluated
FALSEnever evaluated
showSizeGripDescription
TRUEnever evaluated
FALSEnever evaluated
0
116 Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;-
117#ifndef Q_DEAD_CODE_FROM_QT4_MAC-
118 sizeGripNotVisibleState |= Qt::WindowMaximized;-
119#endif-
120 // Don't show the size grip if the tlw is maximized or in full screen mode.-
121 showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState);-
122 }
never executed: end of block
0
123 if (showSizeGrip)
showSizeGripDescription
TRUEnever evaluated
FALSEnever evaluated
0
124 q->setVisible(true);
never executed: q->setVisible(true);
0
125 }
never executed: end of block
0
126-
127 bool m_platformSizeGrip;-
128};-
129-
130QSizeGripPrivate::QSizeGripPrivate()-
131 : dxMax(0)-
132 , dyMax(0)-
133 , gotMousePress(false)-
134 , tlw(0)-
135 , m_platformSizeGrip(false)-
136{-
137}
never executed: end of block
0
138-
139#ifdef Q_DEAD_CODE_FROM_QT4_MAC-
140void QSizeGripPrivate::updateMacSizer(bool hide) const-
141{-
142 Q_Q(const QSizeGrip);-
143 if (QApplication::closingDown() || !parent)-
144 return;-
145 QWidget *topLevelWindow = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q));-
146 if(topLevelWindow && topLevelWindow->isWindow())-
147 QWidgetPrivate::qt_mac_update_sizer(topLevelWindow, hide ? -1 : 1);-
148}-
149#endif-
150-
151Qt::Corner QSizeGripPrivate::corner() const-
152{-
153 Q_Q(const QSizeGrip);-
154 QWidget *tlw = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q));-
155 const QPoint sizeGripPos = q->mapTo(tlw, QPoint(0, 0));-
156 bool isAtBottom = sizeGripPos.y() >= tlw->height() / 2;-
157 bool isAtLeft = sizeGripPos.x() <= tlw->width() / 2;-
158 if (isAtLeft)
isAtLeftDescription
TRUEnever evaluated
FALSEnever evaluated
0
159 return isAtBottom ? Qt::BottomLeftCorner : Qt::TopLeftCorner;
never executed: return isAtBottom ? Qt::BottomLeftCorner : Qt::TopLeftCorner;
isAtBottomDescription
TRUEnever evaluated
FALSEnever evaluated
0
160 else-
161 return isAtBottom ? Qt::BottomRightCorner : Qt::TopRightCorner;
never executed: return isAtBottom ? Qt::BottomRightCorner : Qt::TopRightCorner;
isAtBottomDescription
TRUEnever evaluated
FALSEnever evaluated
0
162}-
163-
164/*!-
165 \class QSizeGrip-
166-
167 \brief The QSizeGrip class provides a resize handle for resizing top-level windows.-
168-
169 \ingroup mainwindow-classes-
170 \ingroup basicwidgets-
171 \inmodule QtWidgets-
172-
173 This widget works like the standard Windows resize handle. In the-
174 X11 version this resize handle generally works differently from-
175 the one provided by the system if the X11 window manager does not-
176 support necessary modern post-ICCCM specifications.-
177-
178 Put this widget anywhere in a widget tree and the user can use it-
179 to resize the top-level window or any widget with the Qt::SubWindow-
180 flag set. Generally, this should be in the lower right-hand corner.-
181-
182 Note that QStatusBar already uses this widget, so if you have a-
183 status bar (e.g., you are using QMainWindow), then you don't need-
184 to use this widget explicitly. The same goes for QDialog, for which-
185 you can just call \l {QDialog::setSizeGripEnabled()}-
186 {QDialog::setSizeGripEnabled()}.-
187-
188 On some platforms the size grip automatically hides itself when the-
189 window is shown full screen or maximised.-
190-
191 \table 50%-
192 \row \li \inlineimage fusion-statusbar-sizegrip.png Screenshot of a Fusion style size grip-
193 \li A size grip widget at the bottom-right corner of a main window, shown in the-
194 \l{Fusion Style Widget Gallery}{Fusion widget style}.-
195 \endtable-
196-
197 The QSizeGrip class inherits QWidget and reimplements the \l-
198 {QWidget::mousePressEvent()}{mousePressEvent()} and \l-
199 {QWidget::mouseMoveEvent()}{mouseMoveEvent()} functions to feature-
200 the resize functionality, and the \l-
201 {QWidget::paintEvent()}{paintEvent()} function to render the-
202 size grip widget.-
203-
204 \sa QStatusBar, QWidget::windowState()-
205*/-
206-
207-
208/*!-
209 Constructs a resize corner as a child widget of the given \a-
210 parent.-
211*/-
212QSizeGrip::QSizeGrip(QWidget * parent)-
213 : QWidget(*new QSizeGripPrivate, parent, 0)-
214{-
215 Q_D(QSizeGrip);-
216 d->init();-
217}
never executed: end of block
0
218-
219-
220void QSizeGripPrivate::init()-
221{-
222 Q_Q(QSizeGrip);-
223 m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner;
q->isLeftToRight()Description
TRUEnever evaluated
FALSEnever evaluated
0
224-
225#if !defined(QT_NO_CURSOR) && !defined(Q_DEAD_CODE_FROM_QT4_MAC)-
226 q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner-
227 ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor);-
228#endif-
229 q->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));-
230 updateTopLevelWidget();-
231}
never executed: end of block
0
232-
233-
234/*!-
235 Destroys this size grip.-
236*/-
237QSizeGrip::~QSizeGrip()-
238{-
239}-
240-
241/*!-
242 \reimp-
243*/-
244QSize QSizeGrip::sizeHint() const-
245{-
246 QStyleOption opt(0);-
247 opt.init(this);-
248 return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this).
never executed: return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this). expandedTo(QApplication::globalStrut()));
0
249 expandedTo(QApplication::globalStrut()));
never executed: return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this). expandedTo(QApplication::globalStrut()));
0
250}-
251-
252/*!-
253 Paints the resize grip.-
254-
255 Resize grips are usually rendered as small diagonal textured lines-
256 in the lower-right corner. The paint event is passed in the \a-
257 event parameter.-
258*/-
259void QSizeGrip::paintEvent(QPaintEvent *event)-
260{-
261 Q_UNUSED(event);-
262 Q_D(QSizeGrip);-
263 QPainter painter(this);-
264 QStyleOptionSizeGrip opt;-
265 opt.init(this);-
266 opt.corner = d->m_corner;-
267 style()->drawControl(QStyle::CE_SizeGrip, &opt, &painter, this);-
268}
never executed: end of block
0
269-
270/*!-
271 \fn void QSizeGrip::mousePressEvent(QMouseEvent * event)-
272-
273 Receives the mouse press events for the widget, and primes the-
274 resize operation. The mouse press event is passed in the \a event-
275 parameter.-
276*/-
277-
278void QSizeGrip::mousePressEvent(QMouseEvent * e)-
279{-
280 if (e->button() != Qt::LeftButton) {
e->button() != Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
0
281 QWidget::mousePressEvent(e);-
282 return;
never executed: return;
0
283 }-
284-
285 Q_D(QSizeGrip);-
286 QWidget *tlw = qt_sizegrip_topLevelWidget(this);-
287 d->p = e->globalPos();-
288 d->gotMousePress = true;-
289 d->r = tlw->geometry();-
290-
291 // Does the platform provide size grip support?-
292 d->m_platformSizeGrip = false;-
293 if (tlw->isWindow()
tlw->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
294 && tlw->windowHandle()
tlw->windowHandle()Description
TRUEnever evaluated
FALSEnever evaluated
0
295 && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
!(tlw->windowF...owManagerHint)Description
TRUEnever evaluated
FALSEnever evaluated
0
296 && !tlw->testAttribute(Qt::WA_DontShowOnScreen)
!tlw->testAttr...tShowOnScreen)Description
TRUEnever evaluated
FALSEnever evaluated
0
297 && !tlw->hasHeightForWidth()) {
!tlw->hasHeightForWidth()Description
TRUEnever evaluated
FALSEnever evaluated
0
298 QPlatformWindow *platformWindow = tlw->windowHandle()->handle();-
299 const QPoint topLevelPos = mapTo(tlw, e->pos());-
300 d->m_platformSizeGrip = platformWindow && platformWindow->startSystemResize(topLevelPos, d->m_corner);
platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
platformWindow..., d->m_corner)Description
TRUEnever evaluated
FALSEnever evaluated
0
301 }
never executed: end of block
0
302-
303 if (d->m_platformSizeGrip)
d->m_platformSizeGripDescription
TRUEnever evaluated
FALSEnever evaluated
0
304 return;
never executed: return;
0
305-
306 // Find available desktop/workspace geometry.-
307 QRect availableGeometry;-
308 bool hasVerticalSizeConstraint = true;-
309 bool hasHorizontalSizeConstraint = true;-
310 if (tlw->isWindow())
tlw->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
311 availableGeometry = QApplication::desktop()->availableGeometry(tlw);
never executed: availableGeometry = QApplication::desktop()->availableGeometry(tlw);
0
312 else {-
313 const QWidget *tlwParent = tlw->parentWidget();-
314 // Check if tlw is inside QAbstractScrollArea/QScrollArea.-
315 // If that's the case tlw->parentWidget() will return the viewport-
316 // and tlw->parentWidget()->parentWidget() will return the scroll area.-
317#ifndef QT_NO_SCROLLAREA-
318 QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(tlwParent->parentWidget());-
319 if (scrollArea) {
scrollAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
320 hasHorizontalSizeConstraint = scrollArea->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff;-
321 hasVerticalSizeConstraint = scrollArea->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff;-
322 }
never executed: end of block
0
323#endif // QT_NO_SCROLLAREA-
324 availableGeometry = tlwParent->contentsRect();-
325 }
never executed: end of block
0
326-
327 // Find frame geometries, title bar height, and decoration sizes.-
328 const QRect frameGeometry = tlw->frameGeometry();-
329 const int titleBarHeight = qMax(tlw->geometry().y() - frameGeometry.y(), 0);-
330 const int bottomDecoration = qMax(frameGeometry.height() - tlw->height() - titleBarHeight, 0);-
331 const int leftRightDecoration = qMax((frameGeometry.width() - tlw->width()) / 2, 0);-
332-
333 // Determine dyMax depending on whether the sizegrip is at the bottom-
334 // of the widget or not.-
335 if (d->atBottom()) {
d->atBottom()Description
TRUEnever evaluated
FALSEnever evaluated
0
336 if (hasVerticalSizeConstraint)
hasVerticalSizeConstraintDescription
TRUEnever evaluated
FALSEnever evaluated
0
337 d->dyMax = availableGeometry.bottom() - d->r.bottom() - bottomDecoration;
never executed: d->dyMax = availableGeometry.bottom() - d->r.bottom() - bottomDecoration;
0
338 else-
339 d->dyMax = INT_MAX;
never executed: d->dyMax = 2147483647;
0
340 } else {-
341 if (hasVerticalSizeConstraint)
hasVerticalSizeConstraintDescription
TRUEnever evaluated
FALSEnever evaluated
0
342 d->dyMax = availableGeometry.y() - d->r.y() + titleBarHeight;
never executed: d->dyMax = availableGeometry.y() - d->r.y() + titleBarHeight;
0
343 else-
344 d->dyMax = -INT_MAX;
never executed: d->dyMax = -2147483647;
0
345 }-
346-
347 // In RTL mode, the size grip is to the left; find dxMax from the desktop/workspace-
348 // geometry, the size grip geometry and the width of the decoration.-
349 if (d->atLeft()) {
d->atLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
350 if (hasHorizontalSizeConstraint)
hasHorizontalSizeConstraintDescription
TRUEnever evaluated
FALSEnever evaluated
0
351 d->dxMax = availableGeometry.x() - d->r.x() + leftRightDecoration;
never executed: d->dxMax = availableGeometry.x() - d->r.x() + leftRightDecoration;
0
352 else-
353 d->dxMax = -INT_MAX;
never executed: d->dxMax = -2147483647;
0
354 } else {-
355 if (hasHorizontalSizeConstraint)
hasHorizontalSizeConstraintDescription
TRUEnever evaluated
FALSEnever evaluated
0
356 d->dxMax = availableGeometry.right() - d->r.right() - leftRightDecoration;
never executed: d->dxMax = availableGeometry.right() - d->r.right() - leftRightDecoration;
0
357 else-
358 d->dxMax = INT_MAX;
never executed: d->dxMax = 2147483647;
0
359 }-
360}-
361-
362-
363/*!-
364 \fn void QSizeGrip::mouseMoveEvent(QMouseEvent * event)-
365 Resizes the top-level widget containing this widget. The mouse-
366 move event is passed in the \a event parameter.-
367*/-
368void QSizeGrip::mouseMoveEvent(QMouseEvent * e)-
369{-
370 Q_D(QSizeGrip);-
371 if (e->buttons() != Qt::LeftButton || d->m_platformSizeGrip) {
e->buttons() != Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
d->m_platformSizeGripDescription
TRUEnever evaluated
FALSEnever evaluated
0
372 QWidget::mouseMoveEvent(e);-
373 return;
never executed: return;
0
374 }-
375-
376 QWidget* tlw = qt_sizegrip_topLevelWidget(this);-
377 if (!d->gotMousePress || tlw->testAttribute(Qt::WA_WState_ConfigPending))
!d->gotMousePressDescription
TRUEnever evaluated
FALSEnever evaluated
tlw->testAttri...ConfigPending)Description
TRUEnever evaluated
FALSEnever evaluated
0
378 return;
never executed: return;
0
379-
380 QPoint np(e->globalPos());-
381-
382 // Don't extend beyond the available geometry; bound to dyMax and dxMax.-
383 QSize ns;-
384 if (d->atBottom())
d->atBottom()Description
TRUEnever evaluated
FALSEnever evaluated
0
385 ns.rheight() = d->r.height() + qMin(np.y() - d->p.y(), d->dyMax);
never executed: ns.rheight() = d->r.height() + qMin(np.y() - d->p.y(), d->dyMax);
0
386 else-
387 ns.rheight() = d->r.height() - qMax(np.y() - d->p.y(), d->dyMax);
never executed: ns.rheight() = d->r.height() - qMax(np.y() - d->p.y(), d->dyMax);
0
388-
389 if (d->atLeft())
d->atLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
390 ns.rwidth() = d->r.width() - qMax(np.x() - d->p.x(), d->dxMax);
never executed: ns.rwidth() = d->r.width() - qMax(np.x() - d->p.x(), d->dxMax);
0
391 else-
392 ns.rwidth() = d->r.width() + qMin(np.x() - d->p.x(), d->dxMax);
never executed: ns.rwidth() = d->r.width() + qMin(np.x() - d->p.x(), d->dxMax);
0
393-
394 ns = QLayout::closestAcceptableSize(tlw, ns);-
395-
396 QPoint p;-
397 QRect nr(p, ns);-
398 if (d->atBottom()) {
d->atBottom()Description
TRUEnever evaluated
FALSEnever evaluated
0
399 if (d->atLeft())
d->atLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
400 nr.moveTopRight(d->r.topRight());
never executed: nr.moveTopRight(d->r.topRight());
0
401 else-
402 nr.moveTopLeft(d->r.topLeft());
never executed: nr.moveTopLeft(d->r.topLeft());
0
403 } else {-
404 if (d->atLeft())
d->atLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
405 nr.moveBottomRight(d->r.bottomRight());
never executed: nr.moveBottomRight(d->r.bottomRight());
0
406 else-
407 nr.moveBottomLeft(d->r.bottomLeft());
never executed: nr.moveBottomLeft(d->r.bottomLeft());
0
408 }-
409-
410 tlw->setGeometry(nr);-
411}
never executed: end of block
0
412-
413/*!-
414 \reimp-
415*/-
416void QSizeGrip::mouseReleaseEvent(QMouseEvent *mouseEvent)-
417{-
418 if (mouseEvent->button() == Qt::LeftButton) {
mouseEvent->bu...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
0
419 Q_D(QSizeGrip);-
420 d->gotMousePress = false;-
421 d->p = QPoint();-
422 } else {
never executed: end of block
0
423 QWidget::mouseReleaseEvent(mouseEvent);-
424 }
never executed: end of block
0
425}-
426-
427/*!-
428 \reimp-
429*/-
430void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/)-
431{-
432 Q_D(QSizeGrip);-
433 // We're inside a resize operation; no update necessary.-
434 if (!d->p.isNull())
!d->p.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0
435 return;
never executed: return;
0
436-
437 d->m_corner = d->corner();-
438#if !defined(QT_NO_CURSOR) && !defined(Q_DEAD_CODE_FROM_QT4_MAC)-
439 setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner-
440 ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor);-
441#endif-
442}
never executed: end of block
0
443-
444/*!-
445 \reimp-
446*/-
447void QSizeGrip::showEvent(QShowEvent *showEvent)-
448{-
449#ifdef Q_DEAD_CODE_FROM_QT4_MAC-
450 d_func()->updateMacSizer(false);-
451#endif-
452 QWidget::showEvent(showEvent);-
453}
never executed: end of block
0
454-
455/*!-
456 \reimp-
457*/-
458void QSizeGrip::hideEvent(QHideEvent *hideEvent)-
459{-
460#ifdef Q_DEAD_CODE_FROM_QT4_MAC-
461 d_func()->updateMacSizer(true);-
462#endif-
463 QWidget::hideEvent(hideEvent);-
464}
never executed: end of block
0
465-
466/*!-
467 \reimp-
468*/-
469void QSizeGrip::setVisible(bool visible)-
470{-
471 QWidget::setVisible(visible);-
472}
never executed: end of block
0
473-
474/*! \reimp */-
475bool QSizeGrip::eventFilter(QObject *o, QEvent *e)-
476{-
477 Q_D(QSizeGrip);-
478 if ((isHidden() && testAttribute(Qt::WA_WState_ExplicitShowHide))
isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
testAttribute(...licitShowHide)Description
TRUEnever evaluated
FALSEnever evaluated
0
479 || e->type() != QEvent::WindowStateChange
e->type() != Q...dowStateChangeDescription
TRUEnever evaluated
FALSEnever evaluated
0
480 || o != d->tlw) {
o != d->tlwDescription
TRUEnever evaluated
FALSEnever evaluated
0
481 return QWidget::eventFilter(o, e);
never executed: return QWidget::eventFilter(o, e);
0
482 }-
483 Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;-
484#ifndef Q_DEAD_CODE_FROM_QT4_MAC-
485 sizeGripNotVisibleState |= Qt::WindowMaximized;-
486#endif-
487 // Don't show the size grip if the tlw is maximized or in full screen mode.-
488 setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState));-
489 setAttribute(Qt::WA_WState_ExplicitShowHide, false);-
490 return QWidget::eventFilter(o, e);
never executed: return QWidget::eventFilter(o, e);
0
491}-
492-
493/*!-
494 \reimp-
495*/-
496bool QSizeGrip::event(QEvent *event)-
497{-
498 return QWidget::event(event);
never executed: return QWidget::event(event);
0
499}-
500-
501QT_END_NAMESPACE-
502-
503#include "moc_qsizegrip.cpp"-
504-
505#endif //QT_NO_SIZEGRIP-
Source codeSwitch to Preprocessed file

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