From dbc1c790431aab1d45ca8c77886dbd6438c139de Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 7 Nov 2017 14:05:21 +0700 Subject: QMacStyle: Remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6e71871b19ce12daddd4cfbbe7c1d9beede13a9b Reviewed-by: Morten Johan Sørvig --- src/plugins/styles/mac/qmacstyle_mac.mm | 66 ------------------------------ src/plugins/styles/mac/qmacstyle_mac_p.h | 4 -- src/plugins/styles/mac/qmacstyle_mac_p_p.h | 4 -- 3 files changed, 74 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 9c5ede6d47..3ae13c3282 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -569,7 +569,6 @@ static inline ThemeTabDirection getTabDirection(QTabBar::Shape shape) case QTabBar::TriangularSouth: ttd = kThemeTabSouth; break; - default: // Added to remove the warning, since all values are taken care of, really! case QTabBar::RoundedNorth: case QTabBar::TriangularNorth: ttd = kThemeTabNorth; @@ -622,47 +621,6 @@ static QString qt_mac_removeMnemonics(const QString &original) return returnText; } -OSStatus qt_mac_shape2QRegionHelper(int inMessage, HIShapeRef, const CGRect *inRect, void *inRefcon) -{ - QRegion *region = static_cast(inRefcon); - if (!region) - return paramErr; - - switch (inMessage) { - case kHIShapeEnumerateRect: - *region += QRect(inRect->origin.x, inRect->origin.y, - inRect->size.width, inRect->size.height); - break; - case kHIShapeEnumerateInit: - // Assume the region is already setup correctly - case kHIShapeEnumerateTerminate: - default: - break; - } - return noErr; -} - -/*! - \internal - Create's a mutable shape, it's the caller's responsibility to release. - WARNING: this function clamps the coordinates to SHRT_MIN/MAX on 10.4 and below. -*/ -HIMutableShapeRef qt_mac_toHIMutableShape(const QRegion ®ion) -{ - HIMutableShapeRef shape = HIShapeCreateMutable(); - if (region.rectCount() < 2 ) { - QRect qtRect = region.boundingRect(); - CGRect cgRect = CGRectMake(qtRect.x(), qtRect.y(), qtRect.width(), qtRect.height()); - HIShapeUnionWithRect(shape, &cgRect); - } else { - for (const QRect &qtRect : region) { - CGRect cgRect = CGRectMake(qtRect.x(), qtRect.y(), qtRect.width(), qtRect.height()); - HIShapeUnionWithRect(shape, &cgRect); - } - } - return shape; -} - bool qt_macWindowIsTextured(const QWidget *window) { if (QWindow *w = window->windowHandle()) @@ -1518,18 +1476,6 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn, } } -#if QT_CONFIG(pushbutton) -bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option) -{ - QMacStyle *macStyle = qobject_cast(pushButton->style()); - if (!macStyle) - return false; - HIThemeButtonDrawInfo bdi; - macStyle->d_func()->initHIThemePushButton(option, pushButton, kThemeStateActive, &bdi); - return bdi.kind == kThemeBevelButton; -} -#endif - /** Creates a HIThemeButtonDrawInfo structure that specifies the correct button kind and other details to use for drawing the given combobox. Which button @@ -6817,16 +6763,4 @@ int QMacStyle::layoutSpacing(QSizePolicy::ControlType control1, return_SIZE(10, 8, 6); // guess } -/* -FontHash::FontHash() -{ - QHash::operator=(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFonts()); -} - -Q_GLOBAL_STATIC(FontHash, app_fonts) -FontHash *qt_app_fonts_hash() -{ - return app_fonts(); -} -*/ QT_END_NAMESPACE diff --git a/src/plugins/styles/mac/qmacstyle_mac_p.h b/src/plugins/styles/mac/qmacstyle_mac_p.h index 6011baeea2..d6874001d3 100644 --- a/src/plugins/styles/mac/qmacstyle_mac_p.h +++ b/src/plugins/styles/mac/qmacstyle_mac_p.h @@ -117,10 +117,6 @@ public: private: Q_DISABLE_COPY(QMacStyle) Q_DECLARE_PRIVATE(QMacStyle) - -#if QT_CONFIG(pushbutton) - friend bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option); -#endif }; QT_END_NAMESPACE diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h index 9c38831c0a..b893e851fd 100644 --- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h +++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h @@ -177,10 +177,6 @@ QT_BEGIN_NAMESPACE return sizes[controlSize]; \ } while (false) -#if QT_CONFIG(pushbutton) -bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option); -#endif - class QMacStylePrivate : public QCommonStylePrivate { Q_DECLARE_PUBLIC(QMacStyle) -- cgit v1.2.3