macOS: Initialize QNSView mouse related members with other mouse logic

Change-Id: I4ff67028823d62ed67bf4303a58bee127bd76501
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-02-27 11:30:31 +01:00
parent f5850cb0da
commit a74b2b5f15
2 changed files with 13 additions and 9 deletions

View File

@ -137,22 +137,13 @@
{
if ((self = [super initWithFrame:NSZeroRect])) {
m_platformWindow = platformWindow;
m_buttons = Qt::NoButton;
m_acceptedMouseDowns = Qt::NoButton;
m_frameStrutButtons = Qt::NoButton;
m_sendKeyEvent = false;
m_sendUpAsRightButton = false;
m_inputSource = nil;
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
m_resendKeyEvent = false;
m_scrolling = false;
m_updatingDrag = false;
m_currentlyInterpretedKeyEvent = nil;
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
self.focusRingType = NSFocusRingTypeNone;
self.cursor = nil;
self.previousSuperview = nil;
self.previousWindow = nil;

View File

@ -153,6 +153,19 @@
- (void)initMouse
{
m_buttons = Qt::NoButton;
m_acceptedMouseDowns = Qt::NoButton;
m_frameStrutButtons = Qt::NoButton;
m_scrolling = false;
self.cursor = nil;
m_sendUpAsRightButton = false;
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, m_platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
NSUInteger trackingOptions = NSTrackingActiveInActiveApp
| NSTrackingMouseEnteredAndExited | NSTrackingCursorUpdate;