| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qsizegrip.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | static QWidget *qt_sizegrip_topLevelWidget(QWidget* w) | - | ||||||||||||||||||
| 13 | { | - | ||||||||||||||||||
| 14 | while (w
| 0 | ||||||||||||||||||
| 15 | w = w->parentWidget(); never executed: w = w->parentWidget(); | 0 | ||||||||||||||||||
| 16 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||||||||
| 17 | } | - | ||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | class QSizeGripPrivate : public QWidgetPrivate | - | ||||||||||||||||||
| 20 | { | - | ||||||||||||||||||
| 21 | inline QSizeGrip* q_func() { return static_cast<QSizeGrip *>(q_ptr); } inline const QSizeGrip* q_func() const { return static_cast<const QSizeGrip *>(q_ptr); } friend class QSizeGrip; | - | ||||||||||||||||||
| 22 | public: | - | ||||||||||||||||||
| 23 | QSizeGripPrivate(); | - | ||||||||||||||||||
| 24 | void init(); | - | ||||||||||||||||||
| 25 | QPoint p; | - | ||||||||||||||||||
| 26 | QRect r; | - | ||||||||||||||||||
| 27 | int d; | - | ||||||||||||||||||
| 28 | int dxMax; | - | ||||||||||||||||||
| 29 | int dyMax; | - | ||||||||||||||||||
| 30 | Qt::Corner m_corner; | - | ||||||||||||||||||
| 31 | bool gotMousePress; | - | ||||||||||||||||||
| 32 | QPointer<QWidget> tlw; | - | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | Qt::Corner corner() const; | - | ||||||||||||||||||
| 37 | inline bool atBottom() const | - | ||||||||||||||||||
| 38 | { | - | ||||||||||||||||||
| 39 | return never executed: m_corner == Qt::BottomRightCorner || m_corner == Qt::BottomLeftCorner;return m_corner == Qt::BottomRightCorner || m_corner == Qt::BottomLeftCorner;never executed: return m_corner == Qt::BottomRightCorner || m_corner == Qt::BottomLeftCorner; | 0 | ||||||||||||||||||
| 40 | } | - | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | inline bool atLeft() const | - | ||||||||||||||||||
| 43 | { | - | ||||||||||||||||||
| 44 | return never executed: m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner;return m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner;never executed: return m_corner == Qt::BottomLeftCorner || m_corner == Qt::TopLeftCorner; | 0 | ||||||||||||||||||
| 45 | } | - | ||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | void updateTopLevelWidget() | - | ||||||||||||||||||
| 48 | { | - | ||||||||||||||||||
| 49 | QSizeGrip * const q = q_func(); | - | ||||||||||||||||||
| 50 | QWidget *w = qt_sizegrip_topLevelWidget(q); | - | ||||||||||||||||||
| 51 | if (tlw == w
| 0 | ||||||||||||||||||
| 52 | return; never executed: return; | 0 | ||||||||||||||||||
| 53 | if (tlw
| 0 | ||||||||||||||||||
| 54 | tlw->removeEventFilter(q); never executed: tlw->removeEventFilter(q); | 0 | ||||||||||||||||||
| 55 | tlw = w; | - | ||||||||||||||||||
| 56 | if (tlw
| 0 | ||||||||||||||||||
| 57 | tlw->installEventFilter(q); never executed: tlw->installEventFilter(q); | 0 | ||||||||||||||||||
| 58 | } never executed: end of block | 0 | ||||||||||||||||||
| 59 | - | |||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | - | |||||||||||||||||||
| 62 | - | |||||||||||||||||||
| 63 | - | |||||||||||||||||||
| 64 | void _q_showIfNotHidden() | - | ||||||||||||||||||
| 65 | { | - | ||||||||||||||||||
| 66 | QSizeGrip * const q = q_func(); | - | ||||||||||||||||||
| 67 | bool showSizeGrip = !(q->isHidden()
| 0 | ||||||||||||||||||
| 68 | updateTopLevelWidget(); | - | ||||||||||||||||||
| 69 | if (tlw
| 0 | ||||||||||||||||||
| 70 | Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; | - | ||||||||||||||||||
| 71 | - | |||||||||||||||||||
| 72 | sizeGripNotVisibleState |= Qt::WindowMaximized; | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState); | - | ||||||||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||||||||
| 77 | if (showSizeGrip
| 0 | ||||||||||||||||||
| 78 | q->setVisible(true); never executed: q->setVisible(true); | 0 | ||||||||||||||||||
| 79 | } never executed: end of block | 0 | ||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | bool m_platformSizeGrip; | - | ||||||||||||||||||
| 82 | }; | - | ||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | QSizeGripPrivate::QSizeGripPrivate() | - | ||||||||||||||||||
| 85 | : dxMax(0) | - | ||||||||||||||||||
| 86 | , dyMax(0) | - | ||||||||||||||||||
| 87 | , gotMousePress(false) | - | ||||||||||||||||||
| 88 | , tlw(0) | - | ||||||||||||||||||
| 89 | , m_platformSizeGrip(false) | - | ||||||||||||||||||
| 90 | { | - | ||||||||||||||||||
| 91 | } never executed: end of block | 0 | ||||||||||||||||||
| 92 | Qt::Corner QSizeGripPrivate::corner() const | - | ||||||||||||||||||
| 93 | { | - | ||||||||||||||||||
| 94 | const QSizeGrip * const q = q_func(); | - | ||||||||||||||||||
| 95 | QWidget *tlw = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q)); | - | ||||||||||||||||||
| 96 | const QPoint sizeGripPos = q->mapTo(tlw, QPoint(0, 0)); | - | ||||||||||||||||||
| 97 | bool isAtBottom = sizeGripPos.y() >= tlw->height() / 2; | - | ||||||||||||||||||
| 98 | bool isAtLeft = sizeGripPos.x() <= tlw->width() / 2; | - | ||||||||||||||||||
| 99 | if (isAtLeft
| 0 | ||||||||||||||||||
| 100 | return never executed: isAtBottom ? Qt::BottomLeftCorner : Qt::TopLeftCorner;return isAtBottom ? Qt::BottomLeftCorner : Qt::TopLeftCorner;never executed: return isAtBottom ? Qt::BottomLeftCorner : Qt::TopLeftCorner; | 0 | ||||||||||||||||||
| 101 | else | - | ||||||||||||||||||
| 102 | return never executed: isAtBottom ? Qt::BottomRightCorner : Qt::TopRightCorner;return isAtBottom ? Qt::BottomRightCorner : Qt::TopRightCorner;never executed: return isAtBottom ? Qt::BottomRightCorner : Qt::TopRightCorner; | 0 | ||||||||||||||||||
| 103 | } | - | ||||||||||||||||||
| 104 | QSizeGrip::QSizeGrip(QWidget * parent) | - | ||||||||||||||||||
| 105 | : QWidget(*new QSizeGripPrivate, parent, 0) | - | ||||||||||||||||||
| 106 | { | - | ||||||||||||||||||
| 107 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 108 | d->init(); | - | ||||||||||||||||||
| 109 | } never executed: end of block | 0 | ||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | void QSizeGripPrivate::init() | - | ||||||||||||||||||
| 113 | { | - | ||||||||||||||||||
| 114 | QSizeGrip * const q = q_func(); | - | ||||||||||||||||||
| 115 | m_corner = q->isLeftToRight()
| 0 | ||||||||||||||||||
| 116 | - | |||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner | - | ||||||||||||||||||
| 119 | ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); | - | ||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | q->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); | - | ||||||||||||||||||
| 122 | updateTopLevelWidget(); | - | ||||||||||||||||||
| 123 | } never executed: end of block | 0 | ||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | - | |||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | - | |||||||||||||||||||
| 129 | QSizeGrip::~QSizeGrip() | - | ||||||||||||||||||
| 130 | { | - | ||||||||||||||||||
| 131 | } | - | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | - | |||||||||||||||||||
| 134 | - | |||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | QSize QSizeGrip::sizeHint() const | - | ||||||||||||||||||
| 137 | { | - | ||||||||||||||||||
| 138 | QStyleOption opt(0); | - | ||||||||||||||||||
| 139 | opt.init(this); | - | ||||||||||||||||||
| 140 | return never executed: (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this).return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this). expandedTo(QApplication::globalStrut()));never executed: return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this). expandedTo(QApplication::globalStrut())); | 0 | ||||||||||||||||||
| 141 | expandedTo(QApplication::globalStrut())); never executed: return (style()->sizeFromContents(QStyle::CT_SizeGrip, &opt, QSize(13, 13), this). expandedTo(QApplication::globalStrut())); | 0 | ||||||||||||||||||
| 142 | } | - | ||||||||||||||||||
| 143 | void QSizeGrip::paintEvent(QPaintEvent *event) | - | ||||||||||||||||||
| 144 | { | - | ||||||||||||||||||
| 145 | (void)event;; | - | ||||||||||||||||||
| 146 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 147 | QPainter painter(this); | - | ||||||||||||||||||
| 148 | QStyleOptionSizeGrip opt; | - | ||||||||||||||||||
| 149 | opt.init(this); | - | ||||||||||||||||||
| 150 | opt.corner = d->m_corner; | - | ||||||||||||||||||
| 151 | style()->drawControl(QStyle::CE_SizeGrip, &opt, &painter, this); | - | ||||||||||||||||||
| 152 | } never executed: end of block | 0 | ||||||||||||||||||
| 153 | void QSizeGrip::mousePressEvent(QMouseEvent * e) | - | ||||||||||||||||||
| 154 | { | - | ||||||||||||||||||
| 155 | if (e->button() != Qt::LeftButton
| 0 | ||||||||||||||||||
| 156 | QWidget::mousePressEvent(e); | - | ||||||||||||||||||
| 157 | return; never executed: return; | 0 | ||||||||||||||||||
| 158 | } | - | ||||||||||||||||||
| 159 | - | |||||||||||||||||||
| 160 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 161 | QWidget *tlw = qt_sizegrip_topLevelWidget(this); | - | ||||||||||||||||||
| 162 | d->p = e->globalPos(); | - | ||||||||||||||||||
| 163 | d->gotMousePress = true; | - | ||||||||||||||||||
| 164 | d->r = tlw->geometry(); | - | ||||||||||||||||||
| 165 | - | |||||||||||||||||||
| 166 | - | |||||||||||||||||||
| 167 | d->m_platformSizeGrip = false; | - | ||||||||||||||||||
| 168 | if (tlw->isWindow()
| 0 | ||||||||||||||||||
| 169 | && tlw->windowHandle()
| 0 | ||||||||||||||||||
| 170 | && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
| 0 | ||||||||||||||||||
| 171 | && !tlw->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||
| 172 | && !tlw->hasHeightForWidth()
| 0 | ||||||||||||||||||
| 173 | QPlatformWindow *platformWindow = tlw->windowHandle()->handle(); | - | ||||||||||||||||||
| 174 | const QPoint topLevelPos = mapTo(tlw, e->pos()); | - | ||||||||||||||||||
| 175 | d->m_platformSizeGrip = platformWindow
| 0 | ||||||||||||||||||
| 176 | } never executed: end of block | 0 | ||||||||||||||||||
| 177 | - | |||||||||||||||||||
| 178 | if (d->m_platformSizeGrip
| 0 | ||||||||||||||||||
| 179 | return; never executed: return; | 0 | ||||||||||||||||||
| 180 | - | |||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | QRect availableGeometry; | - | ||||||||||||||||||
| 183 | bool hasVerticalSizeConstraint = true; | - | ||||||||||||||||||
| 184 | bool hasHorizontalSizeConstraint = true; | - | ||||||||||||||||||
| 185 | if (tlw->isWindow()
| 0 | ||||||||||||||||||
| 186 | availableGeometry = QApplication::desktop()->availableGeometry(tlw); never executed: availableGeometry = QApplication::desktop()->availableGeometry(tlw); | 0 | ||||||||||||||||||
| 187 | else { | - | ||||||||||||||||||
| 188 | const QWidget *tlwParent = tlw->parentWidget(); | - | ||||||||||||||||||
| 189 | - | |||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | - | |||||||||||||||||||
| 192 | - | |||||||||||||||||||
| 193 | QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(tlwParent->parentWidget()); | - | ||||||||||||||||||
| 194 | if (scrollArea
| 0 | ||||||||||||||||||
| 195 | hasHorizontalSizeConstraint = scrollArea->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff; | - | ||||||||||||||||||
| 196 | hasVerticalSizeConstraint = scrollArea->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff; | - | ||||||||||||||||||
| 197 | } never executed: end of block | 0 | ||||||||||||||||||
| 198 | - | |||||||||||||||||||
| 199 | availableGeometry = tlwParent->contentsRect(); | - | ||||||||||||||||||
| 200 | } never executed: end of block | 0 | ||||||||||||||||||
| 201 | - | |||||||||||||||||||
| 202 | - | |||||||||||||||||||
| 203 | const QRect frameGeometry = tlw->frameGeometry(); | - | ||||||||||||||||||
| 204 | const int titleBarHeight = qMax(tlw->geometry().y() - frameGeometry.y(), 0); | - | ||||||||||||||||||
| 205 | const int bottomDecoration = qMax(frameGeometry.height() - tlw->height() - titleBarHeight, 0); | - | ||||||||||||||||||
| 206 | const int leftRightDecoration = qMax((frameGeometry.width() - tlw->width()) / 2, 0); | - | ||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | if (d->atBottom()
| 0 | ||||||||||||||||||
| 211 | if (hasVerticalSizeConstraint
| 0 | ||||||||||||||||||
| 212 | d->dyMax = availableGeometry.bottom() - d->r.bottom() - bottomDecoration; never executed: d->dyMax = availableGeometry.bottom() - d->r.bottom() - bottomDecoration; | 0 | ||||||||||||||||||
| 213 | else | - | ||||||||||||||||||
| 214 | d->dyMax = 2147483647; never executed: d->dyMax = 2147483647; | 0 | ||||||||||||||||||
| 215 | } else { | - | ||||||||||||||||||
| 216 | if (hasVerticalSizeConstraint
| 0 | ||||||||||||||||||
| 217 | d->dyMax = availableGeometry.y() - d->r.y() + titleBarHeight; never executed: d->dyMax = availableGeometry.y() - d->r.y() + titleBarHeight; | 0 | ||||||||||||||||||
| 218 | else | - | ||||||||||||||||||
| 219 | d->dyMax = -2147483647; never executed: d->dyMax = -2147483647; | 0 | ||||||||||||||||||
| 220 | } | - | ||||||||||||||||||
| 221 | - | |||||||||||||||||||
| 222 | - | |||||||||||||||||||
| 223 | - | |||||||||||||||||||
| 224 | if (d->atLeft()
| 0 | ||||||||||||||||||
| 225 | if (hasHorizontalSizeConstraint
| 0 | ||||||||||||||||||
| 226 | d->dxMax = availableGeometry.x() - d->r.x() + leftRightDecoration; never executed: d->dxMax = availableGeometry.x() - d->r.x() + leftRightDecoration; | 0 | ||||||||||||||||||
| 227 | else | - | ||||||||||||||||||
| 228 | d->dxMax = -2147483647; never executed: d->dxMax = -2147483647; | 0 | ||||||||||||||||||
| 229 | } else { | - | ||||||||||||||||||
| 230 | if (hasHorizontalSizeConstraint
| 0 | ||||||||||||||||||
| 231 | d->dxMax = availableGeometry.right() - d->r.right() - leftRightDecoration; never executed: d->dxMax = availableGeometry.right() - d->r.right() - leftRightDecoration; | 0 | ||||||||||||||||||
| 232 | else | - | ||||||||||||||||||
| 233 | d->dxMax = 2147483647; never executed: d->dxMax = 2147483647; | 0 | ||||||||||||||||||
| 234 | } | - | ||||||||||||||||||
| 235 | } | - | ||||||||||||||||||
| 236 | - | |||||||||||||||||||
| 237 | - | |||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | - | |||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | - | |||||||||||||||||||
| 242 | - | |||||||||||||||||||
| 243 | void QSizeGrip::mouseMoveEvent(QMouseEvent * e) | - | ||||||||||||||||||
| 244 | { | - | ||||||||||||||||||
| 245 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 246 | if (e->buttons() != Qt::LeftButton
| 0 | ||||||||||||||||||
| 247 | QWidget::mouseMoveEvent(e); | - | ||||||||||||||||||
| 248 | return; never executed: return; | 0 | ||||||||||||||||||
| 249 | } | - | ||||||||||||||||||
| 250 | - | |||||||||||||||||||
| 251 | QWidget* tlw = qt_sizegrip_topLevelWidget(this); | - | ||||||||||||||||||
| 252 | if (!d->gotMousePress
| 0 | ||||||||||||||||||
| 253 | return; never executed: return; | 0 | ||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | QPoint np(e->globalPos()); | - | ||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | - | |||||||||||||||||||
| 258 | QSize ns; | - | ||||||||||||||||||
| 259 | if (d->atBottom()
| 0 | ||||||||||||||||||
| 260 | 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 | ||||||||||||||||||
| 261 | else | - | ||||||||||||||||||
| 262 | 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 | ||||||||||||||||||
| 263 | - | |||||||||||||||||||
| 264 | if (d->atLeft()
| 0 | ||||||||||||||||||
| 265 | 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 | ||||||||||||||||||
| 266 | else | - | ||||||||||||||||||
| 267 | 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 | ||||||||||||||||||
| 268 | - | |||||||||||||||||||
| 269 | ns = QLayout::closestAcceptableSize(tlw, ns); | - | ||||||||||||||||||
| 270 | - | |||||||||||||||||||
| 271 | QPoint p; | - | ||||||||||||||||||
| 272 | QRect nr(p, ns); | - | ||||||||||||||||||
| 273 | if (d->atBottom()
| 0 | ||||||||||||||||||
| 274 | if (d->atLeft()
| 0 | ||||||||||||||||||
| 275 | nr.moveTopRight(d->r.topRight()); never executed: nr.moveTopRight(d->r.topRight()); | 0 | ||||||||||||||||||
| 276 | else | - | ||||||||||||||||||
| 277 | nr.moveTopLeft(d->r.topLeft()); never executed: nr.moveTopLeft(d->r.topLeft()); | 0 | ||||||||||||||||||
| 278 | } else { | - | ||||||||||||||||||
| 279 | if (d->atLeft()
| 0 | ||||||||||||||||||
| 280 | nr.moveBottomRight(d->r.bottomRight()); never executed: nr.moveBottomRight(d->r.bottomRight()); | 0 | ||||||||||||||||||
| 281 | else | - | ||||||||||||||||||
| 282 | nr.moveBottomLeft(d->r.bottomLeft()); never executed: nr.moveBottomLeft(d->r.bottomLeft()); | 0 | ||||||||||||||||||
| 283 | } | - | ||||||||||||||||||
| 284 | - | |||||||||||||||||||
| 285 | tlw->setGeometry(nr); | - | ||||||||||||||||||
| 286 | } never executed: end of block | 0 | ||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | - | |||||||||||||||||||
| 289 | - | |||||||||||||||||||
| 290 | - | |||||||||||||||||||
| 291 | void QSizeGrip::mouseReleaseEvent(QMouseEvent *mouseEvent) | - | ||||||||||||||||||
| 292 | { | - | ||||||||||||||||||
| 293 | if (mouseEvent->button() == Qt::LeftButton
| 0 | ||||||||||||||||||
| 294 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 295 | d->gotMousePress = false; | - | ||||||||||||||||||
| 296 | d->p = QPoint(); | - | ||||||||||||||||||
| 297 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 298 | QWidget::mouseReleaseEvent(mouseEvent); | - | ||||||||||||||||||
| 299 | } never executed: end of block | 0 | ||||||||||||||||||
| 300 | } | - | ||||||||||||||||||
| 301 | - | |||||||||||||||||||
| 302 | - | |||||||||||||||||||
| 303 | - | |||||||||||||||||||
| 304 | - | |||||||||||||||||||
| 305 | void QSizeGrip::moveEvent(QMoveEvent * ) | - | ||||||||||||||||||
| 306 | { | - | ||||||||||||||||||
| 307 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 308 | - | |||||||||||||||||||
| 309 | if (!d->p.isNull()
| 0 | ||||||||||||||||||
| 310 | return; never executed: return; | 0 | ||||||||||||||||||
| 311 | - | |||||||||||||||||||
| 312 | d->m_corner = d->corner(); | - | ||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner | - | ||||||||||||||||||
| 315 | ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); | - | ||||||||||||||||||
| 316 | - | |||||||||||||||||||
| 317 | } never executed: end of block | 0 | ||||||||||||||||||
| 318 | - | |||||||||||||||||||
| 319 | - | |||||||||||||||||||
| 320 | - | |||||||||||||||||||
| 321 | - | |||||||||||||||||||
| 322 | void QSizeGrip::showEvent(QShowEvent *showEvent) | - | ||||||||||||||||||
| 323 | { | - | ||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | - | |||||||||||||||||||
| 326 | - | |||||||||||||||||||
| 327 | QWidget::showEvent(showEvent); | - | ||||||||||||||||||
| 328 | } never executed: end of block | 0 | ||||||||||||||||||
| 329 | - | |||||||||||||||||||
| 330 | - | |||||||||||||||||||
| 331 | - | |||||||||||||||||||
| 332 | - | |||||||||||||||||||
| 333 | void QSizeGrip::hideEvent(QHideEvent *hideEvent) | - | ||||||||||||||||||
| 334 | { | - | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | - | |||||||||||||||||||
| 337 | - | |||||||||||||||||||
| 338 | QWidget::hideEvent(hideEvent); | - | ||||||||||||||||||
| 339 | } never executed: end of block | 0 | ||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | - | |||||||||||||||||||
| 342 | - | |||||||||||||||||||
| 343 | - | |||||||||||||||||||
| 344 | void QSizeGrip::setVisible(bool visible) | - | ||||||||||||||||||
| 345 | { | - | ||||||||||||||||||
| 346 | QWidget::setVisible(visible); | - | ||||||||||||||||||
| 347 | } never executed: end of block | 0 | ||||||||||||||||||
| 348 | - | |||||||||||||||||||
| 349 | - | |||||||||||||||||||
| 350 | bool QSizeGrip::eventFilter(QObject *o, QEvent *e) | - | ||||||||||||||||||
| 351 | { | - | ||||||||||||||||||
| 352 | QSizeGripPrivate * const d = d_func(); | - | ||||||||||||||||||
| 353 | if ((isHidden()
| 0 | ||||||||||||||||||
| 354 | || e->type() != QEvent::WindowStateChange
| 0 | ||||||||||||||||||
| 355 | || o != d->tlw
| 0 | ||||||||||||||||||
| 356 | return never executed: QWidget::eventFilter(o, e);return QWidget::eventFilter(o, e);never executed: return QWidget::eventFilter(o, e); | 0 | ||||||||||||||||||
| 357 | } | - | ||||||||||||||||||
| 358 | Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; | - | ||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | sizeGripNotVisibleState |= Qt::WindowMaximized; | - | ||||||||||||||||||
| 361 | - | |||||||||||||||||||
| 362 | - | |||||||||||||||||||
| 363 | setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState)); | - | ||||||||||||||||||
| 364 | setAttribute(Qt::WA_WState_ExplicitShowHide, false); | - | ||||||||||||||||||
| 365 | return never executed: QWidget::eventFilter(o, e);return QWidget::eventFilter(o, e);never executed: return QWidget::eventFilter(o, e); | 0 | ||||||||||||||||||
| 366 | } | - | ||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | bool QSizeGrip::event(QEvent *event) | - | ||||||||||||||||||
| 372 | { | - | ||||||||||||||||||
| 373 | return never executed: QWidget::event(event);return QWidget::event(event);never executed: return QWidget::event(event); | 0 | ||||||||||||||||||
| 374 | } | - | ||||||||||||||||||
| 375 | - | |||||||||||||||||||
| 376 | - | |||||||||||||||||||
| 377 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |