From ce73b4db62574fc966192e6a4f65b7e2b2280e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Aug 2019 14:26:05 +0200 Subject: Remove dead code from Qt 4 times MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø --- src/widgets/widgets/qsizegrip.cpp | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) (limited to 'src/widgets/widgets/qsizegrip.cpp') diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index dc5a7158dd..835af9c7b8 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -50,10 +50,6 @@ #include "qdebug.h" #include -#if 0 // Used to be included in Qt4 for Q_WS_MAC -#include -#endif - #include #include #include @@ -81,9 +77,7 @@ public: Qt::Corner m_corner; bool gotMousePress; QPointer tlw; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - void updateMacSizer(bool hide) const; -#endif + Qt::Corner corner() const; inline bool atBottom() const { @@ -119,9 +113,7 @@ public: updateTopLevelWidget(); if (tlw && showSizeGrip) { Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; -#endif // Don't show the size grip if the tlw is maximized or in full screen mode. showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState); } @@ -141,18 +133,6 @@ QSizeGripPrivate::QSizeGripPrivate() { } -#if 0 // Used to be included in Qt4 for Q_WS_MAC -void QSizeGripPrivate::updateMacSizer(bool hide) const -{ - Q_Q(const QSizeGrip); - if (QApplication::closingDown() || !parent) - return; - QWidget *topLevelWindow = qt_sizegrip_topLevelWidget(const_cast(q)); - if(topLevelWindow && topLevelWindow->isWindow()) - QWidgetPrivate::qt_mac_update_sizer(topLevelWindow, hide ? -1 : 1); -} -#endif - Qt::Corner QSizeGripPrivate::corner() const { Q_Q(const QSizeGrip); @@ -227,7 +207,7 @@ void QSizeGripPrivate::init() Q_Q(QSizeGrip); m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner; -#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if !defined(QT_NO_CURSOR) q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -440,7 +420,7 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) return; d->m_corner = d->corner(); -#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if !defined(QT_NO_CURSOR) setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -451,9 +431,6 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) */ void QSizeGrip::showEvent(QShowEvent *showEvent) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d_func()->updateMacSizer(false); -#endif QWidget::showEvent(showEvent); } @@ -462,9 +439,6 @@ void QSizeGrip::showEvent(QShowEvent *showEvent) */ void QSizeGrip::hideEvent(QHideEvent *hideEvent) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d_func()->updateMacSizer(true); -#endif QWidget::hideEvent(hideEvent); } @@ -486,9 +460,7 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e) return QWidget::eventFilter(o, e); } Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; -#endif // Don't show the size grip if the tlw is maximized or in full screen mode. setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState)); setAttribute(Qt::WA_WState_ExplicitShowHide, false); -- cgit v1.2.3