diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-02-19 12:27:44 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2010-02-19 12:27:44 (GMT) |
commit | 0ce2313b897fdd5d0a3529df9b5a9b3bd434e120 (patch) | |
tree | 4fae44e75e53085fc7ec40d6e6f6f2b28e01edbd /src/gui/kernel/qt_cocoa_helpers_mac.mm | |
parent | da1d0f7d34b7acdd4e38a8940279d9255eb15dc5 (diff) | |
parent | 8c1dc03e611cea5bc942cbef0ca94c86efe91426 (diff) | |
download | Qt-0ce2313b897fdd5d0a3529df9b5a9b3bd434e120.zip Qt-0ce2313b897fdd5d0a3529df9b5a9b3bd434e120.tar.gz Qt-0ce2313b897fdd5d0a3529df9b5a9b3bd434e120.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1
Diffstat (limited to 'src/gui/kernel/qt_cocoa_helpers_mac.mm')
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 71d6ff8..b400d25 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -648,6 +648,21 @@ bool qt_dispatchKeyEventWithCocoa(void * /*NSEvent * */ keyEvent, QWidget *widge } #endif +Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) +{ + if (buttonNum == 0) + return Qt::LeftButton; + if (buttonNum == 1) + return Qt::RightButton; + if (buttonNum == 2) + return Qt::MidButton; + if (buttonNum == 3) + return Qt::XButton1; + if (buttonNum == 4) + return Qt::XButton2; + return Qt::NoButton; +} + // Helper to share code between QCocoaWindow and QCocoaView bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent) { |