diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-06-22 11:43:56 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-06-22 11:43:56 (GMT) |
commit | c46031639094f41d7b345dcab1c02eda283e9fdd (patch) | |
tree | 1360a39a5b429c0180fba3e56218bdd26e030e7a /src/gui/kernel/qmultitouch_mac.mm | |
parent | 627a3b8928157bb7f25af406f61a2f9c5cb41e06 (diff) | |
download | Qt-c46031639094f41d7b345dcab1c02eda283e9fdd.zip Qt-c46031639094f41d7b345dcab1c02eda283e9fdd.tar.gz Qt-c46031639094f41d7b345dcab1c02eda283e9fdd.tar.bz2 |
Multitouch, Cocoa: clean up the code a bit
Diffstat (limited to 'src/gui/kernel/qmultitouch_mac.mm')
-rw-r--r-- | src/gui/kernel/qmultitouch_mac.mm | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gui/kernel/qmultitouch_mac.mm b/src/gui/kernel/qmultitouch_mac.mm index 0f43299..15fa60d 100644 --- a/src/gui/kernel/qmultitouch_mac.mm +++ b/src/gui/kernel/qmultitouch_mac.mm @@ -57,20 +57,12 @@ bool QCocoaTouch::_maskMouseHover = true; QCocoaTouch::QCocoaTouch(NSTouch *nstouch) { - // Keep the identity that Cocoa assigns the - // touches, and use it as key in the touch hash: - _identity = int([nstouch identity]); - - if (_currentTouches.size() == 0){ - // The first touch should always have - // 0 as id that we use in Qt: - _touchPoint.setId(0); + if (_currentTouches.size() == 0) _idAssignmentCount = 0; - } else { - _touchPoint.setId(++_idAssignmentCount); - } + _touchPoint.setId(_idAssignmentCount++); _touchPoint.setPressure(1.0); + _identity = int([nstouch identity]); _currentTouches.insert(_identity, this); updateTouchData(nstouch, NSTouchPhaseBegan); } @@ -212,7 +204,7 @@ QList<QTouchEvent::TouchPoint> QCocoaTouch::getCurrentTouchPointList(NSEvent *ev // touch (if the user adds a second finger without lifting // the first), we promote it to be the primary touch: qcocoaTouch->_touchPoint.setId(0); - _idAssignmentCount = 0; + _idAssignmentCount = 1; } return touchPoints; |