diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-07 19:25:13 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-08 14:39:52 +0000 |
commit | b0c895fa7aa7f4d47dc9fc9ab3a65fbfb69f89ed (patch) | |
tree | 99bf53d6660d37d4aed2542128a421ed7d24cd58 /src/plugins/platforms/cocoa/qcocoahelpers.h | |
parent | f8807b82207d7f4f41536f777473c8870673c186 (diff) |
macOS: Simplify helpers for flipping between quadrant I and IV
The different flip-functions have been replaced by a single function,
qt_mac_flip, with overloads for points and rects. This function is
primarily used to implement QCocoaScreen::map(To|From)Native, which
most clients of qt_flip* have been moved to. This makes it clearer
what kind of reference geometry we're flipping in relation to, and
simplifies call-sites.
Change-Id: I8a0862f94bb2c64a83a1c3168f984a195c0af6db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index bc0cd547cf..6c75db9bdb 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -85,13 +85,8 @@ QT_MANGLE_NAMESPACE(QNSView) *qnsview_cast(NSView *view); void qt_mac_transformProccessToForegroundApplication(); QString qt_mac_applicationName(); -int qt_mac_flipYCoordinate(int y); -qreal qt_mac_flipYCoordinate(qreal y); -QPointF qt_mac_flipPoint(const NSPoint &p); -NSPoint qt_mac_flipPoint(const QPoint &p); -NSPoint qt_mac_flipPoint(const QPointF &p); - -NSRect qt_mac_flipRect(const QRect &rect); +QPointF qt_mac_flip(const QPointF &pos, const QRectF &reference); +QRectF qt_mac_flip(const QRectF &rect, const QRectF &reference); Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); |