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/util/qflickgesture.cpp | 15 ------- src/widgets/util/qscroller_mac.mm | 72 -------------------------------- src/widgets/util/qscrollerproperties.cpp | 7 ---- src/widgets/util/qsystemtrayicon.cpp | 11 ----- src/widgets/util/util.pri | 4 -- 5 files changed, 109 deletions(-) delete mode 100644 src/widgets/util/qscroller_mac.mm (limited to 'src/widgets/util') diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index 55ec93c7d3..14a30ce7cf 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -462,21 +462,6 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, } break; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // the only way to distinguish between real mouse wheels and wheel - // events generated by the native 2 finger swipe gesture is to listen - // for these events (according to Apple's Cocoa Event-Handling Guide) - - case QEvent::NativeGesture: { - QNativeGestureEvent *nge = static_cast(event); - if (nge->gestureType == QNativeGestureEvent::GestureBegin) - d->macIgnoreWheel = true; - else if (nge->gestureType == QNativeGestureEvent::GestureEnd) - d->macIgnoreWheel = false; - break; - } -#endif - // consume all wheel events if the scroller is active case QEvent::Wheel: if (d->macIgnoreWheel || (scroller->state() != QScroller::Inactive)) diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm deleted file mode 100644 index 6dbb483089..0000000000 --- a/src/widgets/util/qscroller_mac.mm +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWidgets module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#if 0 // Used to be included in Qt4 for Q_WS_MAC - -#import - -#include "qscroller_p.h" - -QT_BEGIN_NAMESPACE - -QPointF QScrollerPrivate::realDpi(int screen) const -{ - QMacAutoReleasePool pool; - NSArray *nsscreens = [NSScreen screens]; - - if (screen < 0 || screen >= int([nsscreens count])) - screen = 0; - - NSScreen *nsscreen = [nsscreens objectAtIndex:screen]; - CGDirectDisplayID display = [[[nsscreen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; - - CGSize mmsize = CGDisplayScreenSize(display); - if (mmsize.width > 0 && mmsize.height > 0) { - return QPointF(CGDisplayPixelsWide(display) / mmsize.width, - CGDisplayPixelsHigh(display) / mmsize.height) * qreal(25.4); - } else { - return QPointF(); - } -} - -QT_END_NAMESPACE - -#endif diff --git a/src/widgets/util/qscrollerproperties.cpp b/src/widgets/util/qscrollerproperties.cpp index c26fba2cd3..df6b899fe4 100644 --- a/src/widgets/util/qscrollerproperties.cpp +++ b/src/widgets/util/qscrollerproperties.cpp @@ -40,9 +40,6 @@ #include #include #include -#if 0 // Used to be included in Qt4 for Q_WS_WIN -# include -#endif #include "qscrollerproperties.h" #include "private/qscrollerproperties_p.h" @@ -73,10 +70,6 @@ QScrollerPropertiesPrivate *QScrollerPropertiesPrivate::defaults() spp.overshootDragDistanceFactor = qreal(1); spp.overshootScrollDistanceFactor = qreal(0.5); spp.overshootScrollTime = qreal(0.7); -# if 0 // Used to be included in Qt4 for Q_WS_WIN - if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback")) - spp.overshootScrollTime = qreal(0.35); -# endif spp.hOvershootPolicy = QScrollerProperties::OvershootWhenScrollable; spp.vOvershootPolicy = QScrollerProperties::OvershootWhenScrollable; spp.frameRate = QScrollerProperties::Standard; diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index a38a50d3df..fd18888870 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -626,16 +626,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) } QPainterPath path; -#if defined(QT_NO_XSHAPE) && 0 /* Used to be included in Qt4 for Q_WS_X11 */ - // XShape is required for setting the mask, so we just - // draw an ugly square when its not available - path.moveTo(0, 0); - path.lineTo(sz.width() - 1, 0); - path.lineTo(sz.width() - 1, sz.height() - 1); - path.lineTo(0, sz.height() - 1); - path.lineTo(0, 0); - move(qMax(pos.x() - sz.width(), scr.left()), pos.y()); -#else path.moveTo(ml + rc, mt); if (arrowAtTop && arrowAtLeft) { if (showArrow) { @@ -685,7 +675,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) painter1.setBrush(QBrush(Qt::color1)); painter1.drawPath(path); setMask(bitmap); -#endif // Draw the border pixmap = QPixmap(sz); diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index a3bd8897f1..363291528e 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -54,7 +54,3 @@ qtConfig(xcb) { } else { SOURCES += util/qsystemtrayicon_qpa.cpp } - -mac { - OBJECTIVE_SOURCES += util/qscroller_mac.mm -} -- cgit v1.2.3