macOS: Clean up some more Objective-C usage in QNSView implementation

- Format selectors consistently
  - Use proper style for init methods

Follow-up to ba871065e0

Change-Id: I5742e248b83d5955b1d110038dd1b4d79d701fbb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-03-15 17:00:37 +01:00
parent 83a1203c3b
commit bbe9bda106
2 changed files with 45 additions and 48 deletions

View File

@ -92,10 +92,9 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
- (instancetype)initWithView:(QNSView *)theView - (instancetype)initWithView:(QNSView *)theView
{ {
self = [super init]; if ((self = [super init]))
if (self) {
view = theView; view = theView;
}
return self; return self;
} }
@ -157,7 +156,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
- (instancetype)init - (instancetype)init
{ {
if (self = [super initWithFrame:NSZeroRect]) { if ((self = [super initWithFrame:NSZeroRect])) {
m_buttons = Qt::NoButton; m_buttons = Qt::NoButton;
m_acceptedMouseDowns = Qt::NoButton; m_acceptedMouseDowns = Qt::NoButton;
m_frameStrutButtons = Qt::NoButton; m_frameStrutButtons = Qt::NoButton;
@ -200,10 +199,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
- (instancetype)initWithCocoaWindow:(QCocoaWindow *)platformWindow - (instancetype)initWithCocoaWindow:(QCocoaWindow *)platformWindow
{ {
self = [self init]; if ((self = [self init])) {
if (!self)
return 0;
m_platformWindow = platformWindow; m_platformWindow = platformWindow;
m_sendKeyEvent = false; m_sendKeyEvent = false;
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(), "_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB"); m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(), "_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
@ -230,6 +226,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
selector:@selector(textInputContextKeyboardSelectionDidChangeNotification:) selector:@selector(textInputContextKeyboardSelectionDidChangeNotification:)
name:NSTextInputContextKeyboardSelectionDidChangeNotification name:NSTextInputContextKeyboardSelectionDidChangeNotification
object:nil]; object:nil];
}
return self; return self;
} }