summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-05 08:58:48 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-05 08:58:48 +0200
commit69ef0481fc22ec3f0d7fa220a47a27fecf76a710 (patch)
treef6d96cc257fcb27e12151f079c583251df4c4720 /src/plugins/platforms
parentdbfd7f304c4d91096e104ec2383d92a37502d836 (diff)
parent91a2c8630b2204831566ab8e523c747f9d8ec927 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I6f3878b204464313aa2f9d988d3b35121d4d9867
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.cpp3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h1
4 files changed, 35 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
index 0667a9073f..a14271c8f5 100644
--- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
+++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
@@ -60,7 +60,8 @@ void QAndroidPlatformFontDatabase::populateFontDatabase()
QStringList nameFilters;
nameFilters << QLatin1String("*.ttf")
- << QLatin1String("*.otf");
+ << QLatin1String("*.otf")
+ << QLatin1String("*.ttc");
const auto entries = dir.entryInfoList(nameFilters, QDir::Files);
for (const QFileInfo &fi : entries) {
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
index 363fce2214..4e811a1dfe 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
@@ -93,9 +93,23 @@ void QEglFSBrcmIntegration::platformInit()
bcm_host_init();
}
+static int getDisplayId()
+{
+ // As defined in vc_dispmanx_types.h
+ // DISPMANX_ID_MAIN_LCD 0
+ // DISPMANX_ID_AUX_LCD 1
+ // DISPMANX_ID_HDMI 2
+ // DISPMANX_ID_SDTV 3
+ // DISPMANX_ID_FORCE_LCD 4
+ // DISPMANX_ID_FORCE_TV 5
+ // DISPMANX_ID_FORCE_OTHER 6 /* non-default display */
+ static const int dispmanxId = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISPMANX_ID");
+ return (dispmanxId >= 0 && dispmanxId <= 6) ? dispmanxId : 0;
+}
+
EGLNativeDisplayType QEglFSBrcmIntegration::platformDisplay() const
{
- dispman_display = vc_dispmanx_display_open(0/* LCD */);
+ dispman_display = vc_dispmanx_display_open(getDisplayId());
return EGL_DEFAULT_DISPLAY;
}
@@ -107,7 +121,7 @@ void QEglFSBrcmIntegration::platformDestroy()
QSize QEglFSBrcmIntegration::screenSize() const
{
uint32_t width, height;
- graphics_get_display_size(0 /* LCD */, &width, &height);
+ graphics_get_display_size(getDisplayId(), &width, &height);
return QSize(width, height);
}
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 5b2370b69d..ae3c477399 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -43,6 +43,7 @@
#include "qwindowswindow.h"
#include "qwindowsinputcontext.h"
+#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
#include <private/qguiapplication_p.h>
@@ -1078,6 +1079,21 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
if (PeekMessage(&wm_char, 0, charType, charType, PM_REMOVE)) {
// Found a ?_CHAR
uch = QChar(ushort(wm_char.wParam));
+ if (uch.isHighSurrogate()) {
+ m_lastHighSurrogate = uch;
+ return true;
+ } else if (uch.isLowSurrogate() && !m_lastHighSurrogate.isNull()) {
+ if (QObject *focusObject = QGuiApplication::focusObject()) {
+ const QChar chars[2] = {m_lastHighSurrogate, uch};
+ QInputMethodEvent event;
+ event.setCommitString(QString(chars, 2));
+ QCoreApplication::sendEvent(focusObject, &event);
+ }
+ m_lastHighSurrogate = QChar();
+ return true;
+ } else {
+ m_lastHighSurrogate = QChar();
+ }
if (msgType == WM_SYSKEYDOWN && uch.isLetter() && (msg.lParam & KF_ALTDOWN))
uch = uch.toLower(); // (See doc of WM_SYSCHAR) Alt-letter
if (!code && !uch.row())
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index e21c913156..1e32ddabcc 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -103,6 +103,7 @@ private:
void deleteLayouts();
QWindow *m_keyGrabber;
+ QChar m_lastHighSurrogate;
static const size_t NumKeyboardLayoutItems = 256;
KeyboardLayoutItem keyLayout[NumKeyboardLayoutItems];
};