summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-04-26 09:55:10 +0200
committerLiang Qi <liang.qi@qt.io>2018-04-26 09:55:10 +0200
commit866b47916dfcf2823b8fc4df719f1ebf15acef70 (patch)
treea4eef09d00d407dec26b99b9f094bf1f5093dcb8 /src/plugins/platforms
parenta9fc91466c2c143bea422d98af24755f43c2b97b (diff)
parent4bab1b0d7c2462ee9c5369c949b45bc4dedc1194 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm7
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm6
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp7
3 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 29aaaae683..33b102f3eb 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -73,8 +73,6 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
return newFont;
}
-@class QT_MANGLE_NAMESPACE(QNSFontPanelDelegate);
-
@interface QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) : NSObject<NSWindowDelegate, QNSPanelDelegate>
- (void)restoreOriginalContentView;
- (void)updateQtFont;
@@ -109,7 +107,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
[mFontPanel setRestorable:NO];
[mFontPanel setDelegate:self];
- [[NSFontManager sharedFontManager] setDelegate:self];
+
+ [NSFontManager sharedFontManager].target = self; // Action is changeFont:
[mFontPanel retain];
}
@@ -120,7 +119,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
{
[mStolenContentView release];
[mFontPanel setDelegate:nil];
- [[NSFontManager sharedFontManager] setDelegate:nil];
+ [NSFontManager sharedFontManager].target = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 0ef06ccea7..20358e7269 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -394,8 +394,10 @@ void QCocoaWindow::setVisible(bool visible)
removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
+ const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
- cocoaButton2QtButton([e buttonNumber]));
+ Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)),
+ cocoaButton2QtButton(e.buttonNumber), eventType);
}];
}
}
@@ -1331,7 +1333,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
void QCocoaWindow::requestUpdate()
{
qCDebug(lcQpaDrawing) << "QCocoaWindow::requestUpdate" << window();
- [qnsview_cast(m_view) requestUpdate];
+ QPlatformWindow::requestUpdate();
}
void QCocoaWindow::deliverUpdateRequest()
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 2e44626112..35f81f0165 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -102,6 +102,7 @@ QWindowsKeyMapper::QWindowsKeyMapper()
QGuiApplication *app = static_cast<QGuiApplication *>(QGuiApplication::instance());
QObject::connect(app, &QGuiApplication::applicationStateChanged,
app, clearKeyRecorderOnApplicationInActive);
+ changeKeyboard();
}
QWindowsKeyMapper::~QWindowsKeyMapper()
@@ -317,9 +318,9 @@ static const uint KeyTbl[] = { // Keyboard mapping table
Qt::Key_9, // 105 0x69 VK_NUMPAD9 | Numeric keypad 9 key
Qt::Key_Asterisk, // 106 0x6A VK_MULTIPLY | Multiply key
Qt::Key_Plus, // 107 0x6B VK_ADD | Add key
- Qt::Key_Comma, // 108 0x6C VK_SEPARATOR | Separator key
+ Qt::Key_unknown, // 108 0x6C VK_SEPARATOR | Separator key (locale-dependent)
Qt::Key_Minus, // 109 0x6D VK_SUBTRACT | Subtract key
- Qt::Key_Period, // 110 0x6E VK_DECIMAL | Decimal key
+ Qt::Key_unknown, // 110 0x6E VK_DECIMAL | Decimal key (locale-dependent)
Qt::Key_Slash, // 111 0x6F VK_DIVIDE | Divide key
Qt::Key_F1, // 112 0x70 VK_F1 | F1 key
Qt::Key_F2, // 113 0x71 VK_F2 | F2 key
@@ -810,7 +811,7 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd,
// Reset layout map when system keyboard layout is changed
if (msg.message == WM_INPUTLANGCHANGE) {
- deleteLayouts();
+ changeKeyboard();
return true;
}