diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-04-05 07:01:49 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-04-05 07:01:49 +0000 |
commit | a2970719c26c946fd6fea7d902aad6706a4ca6ea (patch) | |
tree | 53072d5736c493e5bf3e2ac6ba1406d4561e1f82 /src/plugins/platforms | |
parent | f68c62cdfc4d66def52aa73fbc2ad58acc32af62 (diff) | |
parent | 216f57ef8682f74b72ae4e39cf1fd23abddf6a51 (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/plugins/platforms')
8 files changed, 41 insertions, 7 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp index f4383efd1f..ac966d23ee 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp @@ -70,6 +70,12 @@ QEglFSKmsCursor::QEglFSKmsCursor(QEglFSKmsScreen *screen) , m_cursorImage(0, 0, 0, 0, 0, 0) , m_visible(true) { + QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR"); + if (!hideCursorVal.isEmpty()) + m_visible = hideCursorVal.toInt() == 0; + if (!m_visible) + return; + uint64_t width, height; if ((drmGetCap(m_screen->device()->fd(), DRM_CAP_CURSOR_WIDTH, &width) == 0) && (drmGetCap(m_screen->device()->fd(), DRM_CAP_CURSOR_HEIGHT, &height) == 0)) { diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 0eab37aed2..d5e5f87e5c 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1331,7 +1331,7 @@ void QWindowsNativeFileDialogBase::setLabelText(QFileDialogOptions::DialogLabel static inline bool isClsid(const QString &s) { // detect "374DE290-123F-4565-9164-39C4925E467B". - static const QRegularExpression pattern(QLatin1String("[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{8}")); + static const QRegularExpression pattern(QLatin1String("\\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\z")); Q_ASSERT(pattern.isValid()); return pattern.match(s).hasMatch(); } @@ -2179,6 +2179,7 @@ namespace QWindowsDialogs { // QWindowsDialogHelperBase creation functions bool useHelper(QPlatformTheme::DialogType type) { +#if !defined(_WIN32_WCE) || _WIN32_WCE < 0x800 if (QWindowsIntegration::instance()->options() & QWindowsIntegration::NoNativeDialogs) return false; switch (type) { @@ -2197,10 +2198,14 @@ bool useHelper(QPlatformTheme::DialogType type) break; } return false; +#else + return false; +#endif // !defined(_WIN32_WCE) || _WIN32_WCE < 0x800 } QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type) { +#if !defined(_WIN32_WCE) || _WIN32_WCE < 0x800 if (QWindowsIntegration::instance()->options() & QWindowsIntegration::NoNativeDialogs) return 0; switch (type) { @@ -2228,6 +2233,9 @@ QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type) break; } return 0; +#else + return 0; +#endif // !defined(_WIN32_WCE) || _WIN32_WCE < 0x800 } } // namespace QWindowsDialogs diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index a3e3870d90..806af6458b 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1260,6 +1260,11 @@ QFontEngine *QWindowsFontEngine::cloneWithSize(qreal pixelSize) const return fontEngine; } +Qt::HANDLE QWindowsFontEngine::handle() const +{ + return hfont; +} + void QWindowsFontEngine::initFontInfo(const QFontDef &request, int dpi) { diff --git a/src/plugins/platforms/windows/qwindowsfontengine.h b/src/plugins/platforms/windows/qwindowsfontengine.h index 7d85b7ef24..d4d98422a1 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.h +++ b/src/plugins/platforms/windows/qwindowsfontengine.h @@ -114,6 +114,7 @@ public: glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE; QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; + Qt::HANDLE handle() const Q_DECL_OVERRIDE; bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE; #ifndef Q_CC_MINGW diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index eeb9e5eb6e..9dbfac34ef 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -645,6 +645,11 @@ QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const return fontEngine; } +Qt::HANDLE QWindowsFontEngineDirectWrite::handle() const +{ + return m_directWriteFontFace; +} + void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request, int dpi) { diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h index 4558cfbdcc..0aa7e41500 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h @@ -98,6 +98,7 @@ public: QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE; QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE; + Qt::HANDLE handle() const Q_DECL_OVERRIDE; const QSharedPointer<QWindowsFontEngineData> &fontEngineData() const { return m_fontEngineData; } diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index d0c3b80707..ea68ba8cab 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -54,6 +54,8 @@ #include <QtGui/QPalette> #include <QtGui/QGuiApplication> +#include <private/qhighdpiscaling_p.h> + #include <algorithm> QT_BEGIN_NAMESPACE @@ -165,7 +167,8 @@ Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id); // from qlocale_win.cpp HIMC QWindowsInputContext::m_defaultContext = 0; QWindowsInputContext::CompositionContext::CompositionContext() : - hwnd(0), haveCaret(false), position(0), isComposing(false) + hwnd(0), haveCaret(false), position(0), isComposing(false), + factor(1) { } @@ -274,9 +277,12 @@ void QWindowsInputContext::cursorRectChanged() if (!m_compositionContext.hwnd) return; const QInputMethod *inputMethod = QGuiApplication::inputMethod(); - const QRect cursorRectangle = inputMethod->cursorRectangle().toRect(); - if (!cursorRectangle.isValid()) + const QRectF cursorRectangleF = inputMethod->cursorRectangle(); + if (!cursorRectangleF.isValid()) return; + const QRect cursorRectangle = + QRectF(cursorRectangleF.topLeft() * m_compositionContext.factor, + cursorRectangleF.size() * m_compositionContext.factor).toRect(); qCDebug(lcQpaInputMethods) << __FUNCTION__<< cursorRectangle; @@ -394,7 +400,7 @@ bool QWindowsInputContext::startComposition(HWND hwnd) qCDebug(lcQpaInputMethods) << __FUNCTION__ << fo << window << "language=" << m_languageId; if (!fo || QWindowsWindow::handleOf(window) != hwnd) return false; - initContext(hwnd, fo); + initContext(hwnd, QHighDpiScaling::factor(window), fo); startContextComposition(); return true; } @@ -526,12 +532,13 @@ bool QWindowsInputContext::endComposition(HWND hwnd) return true; } -void QWindowsInputContext::initContext(HWND hwnd, QObject *focusObject) +void QWindowsInputContext::initContext(HWND hwnd, qreal factor, QObject *focusObject) { if (m_compositionContext.hwnd) doneContext(); m_compositionContext.hwnd = hwnd; m_compositionContext.focusObject = focusObject; + m_compositionContext.factor = factor; // Create a hidden caret which is kept at the microfocus // position in update(). This is important for some // Chinese input methods. diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h index f8ff08aa7c..4c08fa0ef2 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.h +++ b/src/plugins/platforms/windows/qwindowsinputcontext.h @@ -65,6 +65,7 @@ class QWindowsInputContext : public QPlatformInputContext int position; bool isComposing; QPointer<QObject> focusObject; + qreal factor; }; public: explicit QWindowsInputContext(); @@ -94,7 +95,7 @@ private slots: void cursorRectChanged(); private: - void initContext(HWND hwnd, QObject *focusObject); + void initContext(HWND hwnd, qreal factor, QObject *focusObject); void doneContext(); void startContextComposition(); void endContextComposition(); |