![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <AppKit/AppKit.h>#include <qpa/qplatformtheme.h>#include "qcocoahelpers.h"#include "qnsview.h"#include <qpa/qplatformscreen.h>#include <private/qguiapplication_p.h>#include <private/qwindow_p.h>#include <QtGui/private/qcoregraphics_p.h>#include <algorithm>Go to the source code of this file.
Classes | |
| struct | dndenum_mapper |
Functions | |
| QT_BEGIN_NAMESPACE | Q_LOGGING_CATEGORY (lcQpaWindow, "qt.qpa.window") |
| Q_LOGGING_CATEGORY (lcQpaDrawing, "qt.qpa.drawing") | |
| Q_LOGGING_CATEGORY (lcQpaMouse, "qt.qpa.input.mouse", QtCriticalMsg) | |
| Q_LOGGING_CATEGORY (lcQpaKeys, "qt.qpa.input.keys", QtCriticalMsg) | |
| Q_LOGGING_CATEGORY (lcQpaTouch, "qt.qpa.input.touch", QtCriticalMsg) | |
| Q_LOGGING_CATEGORY (lcQpaScreen, "qt.qpa.screen", QtCriticalMsg) | |
| Q_LOGGING_CATEGORY (lcQpaApplication, "qt.qpa.application") | |
| QStringList | qt_mac_NSArrayToQStringList (NSArray< NSString * > *array) |
| NSMutableArray< NSString * > * | qt_mac_QStringListToNSMutableArray (const QStringList &list) |
| NSDragOperation | qt_mac_mapDropAction (Qt::DropAction action) |
| NSDragOperation | qt_mac_mapDropActions (Qt::DropActions actions) |
| Qt::DropAction | qt_mac_mapNSDragOperation (NSDragOperation nsActions) |
| Qt::DropActions | qt_mac_mapNSDragOperations (NSDragOperation nsActions) |
| QNSView * | qnsview_cast (NSView *view) |
| Returns the view cast to a QNSview if possible. | |
| void | qt_mac_transformProccessToForegroundApplication () |
| QString | qt_mac_applicationName () |
| QPointF | qt_mac_flip (const QPointF &pos, const QRectF &reference) |
| QRectF | qt_mac_flip (const QRectF &rect, const QRectF &reference) |
| Flips the Y coordinate of the point/rect between quadrant I and IV. | |
| Qt::MouseButton | cocoaButton2QtButton (NSInteger buttonNum) |
| Returns the Qt::Button that corresponds to an NSEvent.buttonNumber. | |
| Qt::MouseButton | cocoaButton2QtButton (NSEvent *event) |
| Returns the Qt::Button that corresponds to an NSEvent.buttonNumber. | |
| QEvent::Type | cocoaEvent2QtMouseEvent (NSEvent *event) |
| Returns the QEvent::Type that corresponds to an NSEvent.type. | |
| bool | qt_mac_isMouseEvent (NSEvent *event) |
| Qt::MouseButtons | cocoaMouseButtons2QtMouseButtons (NSInteger pressedMouseButtons) |
| Returns the Qt::MouseButtons that corresponds to an NSEvent.pressedMouseButtons. | |
| Qt::MouseButtons | currentlyPressedMouseButtons () |
| Returns the Qt::MouseButtons that corresponds to an NSEvent.pressedMouseButtons. | |
| QString | qt_mac_removeAmpersandEscapes (QString s) |
| NSString * | qt_mac_AppKitString (NSString *table, NSString *key) |
| QT_BEGIN_NAMESPACE InputMethodQueryResult | queryInputMethod (QObject *object, Qt::InputMethodQueries queries) |
| QDebug | operator<< (QDebug debug, const NSRange &range) |
| QDebug | operator<< (QDebug debug, SEL selector) |
Variables | |
| static dndenum_mapper | dnd_enums [] |
| NSButton * | _cancelButton |
| NSView * | _panelContents |
| NSEdgeInsets | _panelContentsMargins |
| Qt::MouseButton cocoaButton2QtButton | ( | NSEvent * | event | ) |
Returns the Qt::Button that corresponds to an NSEvent.buttonNumber.
Definition at line 264 of file qcocoahelpers.mm.
| Qt::MouseButton cocoaButton2QtButton | ( | NSInteger | buttonNum | ) |
Returns the Qt::Button that corresponds to an NSEvent.buttonNumber.
Definition at line 244 of file qcocoahelpers.mm.
| QEvent::Type cocoaEvent2QtMouseEvent | ( | NSEvent * | event | ) |
Returns the QEvent::Type that corresponds to an NSEvent.type.
Definition at line 286 of file qcocoahelpers.mm.
| Qt::MouseButtons cocoaMouseButtons2QtMouseButtons | ( | NSInteger | pressedMouseButtons | ) |
Returns the Qt::MouseButtons that corresponds to an NSEvent.pressedMouseButtons.
Definition at line 324 of file qcocoahelpers.mm.
| Qt::MouseButtons currentlyPressedMouseButtons | ( | ) |
Returns the Qt::MouseButtons that corresponds to an NSEvent.pressedMouseButtons.
Definition at line 334 of file qcocoahelpers.mm.
Definition at line 506 of file qcocoahelpers.mm.
Definition at line 517 of file qcocoahelpers.mm.
| QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY | ( | lcQpaApplication | , |
| "qt.qpa.application" | ) |
| Q_LOGGING_CATEGORY | ( | lcQpaDrawing | , |
| "qt.qpa.drawing" | ) |
| Q_LOGGING_CATEGORY | ( | lcQpaKeys | , |
| "qt.qpa.input.keys" | , | ||
| QtCriticalMsg | ) |
| Q_LOGGING_CATEGORY | ( | lcQpaMouse | , |
| "qt.qpa.input.mouse" | , | ||
| QtCriticalMsg | ) |
| Q_LOGGING_CATEGORY | ( | lcQpaScreen | , |
| "qt.qpa.screen" | , | ||
| QtCriticalMsg | ) |
| Q_LOGGING_CATEGORY | ( | lcQpaTouch | , |
| "qt.qpa.input.touch" | , | ||
| QtCriticalMsg | ) |
| QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY | ( | lcQpaWindow | , |
| "qt.qpa.window" | ) |
| QNSView * qnsview_cast | ( | NSView * | view | ) |
Returns the view cast to a QNSview if possible.
If the view is not a QNSView, nil is returned, which is safe to send messages to, effectivly making [qnsview_cast(view) message] a no-op.
For extra verbosity and clearer code, please consider checking that the platform window is not a foreign window before using this cast, via QPlatformWindow::isForeignWindow().
Do not use this method solely to check for foreign windows, as that will make the code harder to read for people not working primarily on macOS, who do not know the difference between the NSView and QNSView cases.
Definition at line 131 of file qcocoahelpers.mm.
| NSString * qt_mac_AppKitString | ( | NSString * | table, |
| NSString * | key ) |
Definition at line 344 of file qcocoahelpers.mm.
| QString qt_mac_applicationName | ( | ) |
Definition at line 184 of file qcocoahelpers.mm.
Definition at line 222 of file qcocoahelpers.mm.
Flips the Y coordinate of the point/rect between quadrant I and IV.
The native coordinate system on macOS uses quadrant I, with origin in bottom left, and Qt uses quadrant IV, with origin in top left.
By flipping the Y coordinate, we can map the point/rect between the two coordinate systems.
The flip is always in relation to a reference rectangle, e.g. the frame of the parent view, or the screen geometry. In the latter case the specialized QCocoaScreen::mapFrom/To functions should be used instead.
Definition at line 227 of file qcocoahelpers.mm.
| bool qt_mac_isMouseEvent | ( | NSEvent * | event | ) |
Definition at line 314 of file qcocoahelpers.mm.
| NSDragOperation qt_mac_mapDropAction | ( | Qt::DropAction | action | ) |
Definition at line 71 of file qcocoahelpers.mm.
References dnd_enums, and dndenum_mapper::Qt2Mac.
| NSDragOperation qt_mac_mapDropActions | ( | Qt::DropActions | actions | ) |
Definition at line 81 of file qcocoahelpers.mm.
References dnd_enums, and dndenum_mapper::Qt2Mac.
| Qt::DropAction qt_mac_mapNSDragOperation | ( | NSDragOperation | nsActions | ) |
Definition at line 91 of file qcocoahelpers.mm.
References dnd_enums.
| Qt::DropActions qt_mac_mapNSDragOperations | ( | NSDragOperation | nsActions | ) |
Definition at line 101 of file qcocoahelpers.mm.
References dnd_enums.
| QStringList qt_mac_NSArrayToQStringList | ( | NSArray< NSString * > * | array | ) |
Definition at line 38 of file qcocoahelpers.mm.
| NSMutableArray< NSString * > * qt_mac_QStringListToNSMutableArray | ( | const QStringList & | list | ) |
Definition at line 46 of file qcocoahelpers.mm.
Definition at line 339 of file qcocoahelpers.mm.
| void qt_mac_transformProccessToForegroundApplication | ( | ) |
Definition at line 142 of file qcocoahelpers.mm.
| QT_BEGIN_NAMESPACE InputMethodQueryResult queryInputMethod | ( | QObject * | object, |
| Qt::InputMethodQueries | queries ) |
Definition at line 484 of file qcocoahelpers.mm.
| NSButton* _cancelButton |
Definition at line 366 of file qcocoahelpers.mm.
| NSView* _panelContents |
Definition at line 367 of file qcocoahelpers.mm.
| NSEdgeInsets _panelContentsMargins |
Definition at line 368 of file qcocoahelpers.mm.
|
static |
Definition at line 61 of file qcocoahelpers.mm.
Referenced by qt_mac_mapDropAction(), qt_mac_mapDropActions(), qt_mac_mapNSDragOperation(), and qt_mac_mapNSDragOperations().