Windows: Allow for custom input context plugins.
Task-number: QTBUG-37556 Change-Id: I9719138e1b09026f0971f8d3eeae525fc8951c0d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Jonathan Liu <net147@gmail.com>
This commit is contained in:
parent
a4080e4719
commit
fc3a1fba45
@ -83,6 +83,7 @@
|
||||
# include "qwindowssessionmanager.h"
|
||||
#endif
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <QtGui/qpa/qplatforminputcontextfactory_p.h>
|
||||
|
||||
#include <QtCore/private/qeventdispatcher_win_p.h>
|
||||
#include <QtCore/QDebug>
|
||||
@ -158,7 +159,7 @@ struct QWindowsIntegrationPrivate
|
||||
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
|
||||
QOpenGLStaticContextPtr m_staticOpenGLContext;
|
||||
#endif
|
||||
QWindowsInputContext m_inputContext;
|
||||
QScopedPointer<QPlatformInputContext> m_inputContext;
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QWindowsAccessibility m_accessibility;
|
||||
#endif
|
||||
@ -224,6 +225,14 @@ QWindowsIntegration::~QWindowsIntegration()
|
||||
{
|
||||
}
|
||||
|
||||
void QWindowsIntegration::initialize()
|
||||
{
|
||||
if (QPlatformInputContext *pluginContext = QPlatformInputContextFactory::create())
|
||||
d->m_inputContext.reset(pluginContext);
|
||||
else
|
||||
d->m_inputContext.reset(new QWindowsInputContext);
|
||||
}
|
||||
|
||||
bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||
{
|
||||
switch (cap) {
|
||||
@ -441,7 +450,7 @@ QPlatformDrag *QWindowsIntegration::drag() const
|
||||
|
||||
QPlatformInputContext * QWindowsIntegration::inputContext() const
|
||||
{
|
||||
return &d->m_inputContext;
|
||||
return d->m_inputContext.data();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
|
||||
#endif
|
||||
virtual QAbstractEventDispatcher *createEventDispatcher() const;
|
||||
void initialize() Q_DECL_OVERRIDE;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
virtual QPlatformClipboard *clipboard() const;
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
|
Loading…
Reference in New Issue
Block a user