Add support for input contexts to offscreen platform
This is needed to use qtvirtualkeyboard with offscreen platform [ChangeLog][Platform Specific Changes] Input context support to offscreen platform Task-number: QTBUG-60268 Change-Id: Id24dc8b0461036923df2c1624bcb913d28e0819e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>bb10
parent
c24ad1896a
commit
462c75be9e
|
|
@ -59,6 +59,8 @@
|
|||
|
||||
#include <QtGui/private/qpixmap_raster_p.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatforminputcontextfactory_p.h>
|
||||
#include <qpa/qplatforminputcontext.h>
|
||||
|
||||
#include <qpa/qplatformservices.h>
|
||||
|
||||
|
|
@ -118,6 +120,16 @@ QOffscreenIntegration::~QOffscreenIntegration()
|
|||
{
|
||||
}
|
||||
|
||||
void QOffscreenIntegration::initialize()
|
||||
{
|
||||
m_inputContext.reset(QPlatformInputContextFactory::create());
|
||||
}
|
||||
|
||||
QPlatformInputContext *QOffscreenIntegration::inputContext() const
|
||||
{
|
||||
return m_inputContext.data();
|
||||
}
|
||||
|
||||
bool QOffscreenIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||
{
|
||||
switch (cap) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
QOffscreenIntegration();
|
||||
~QOffscreenIntegration();
|
||||
|
||||
void initialize() Q_DECL_OVERRIDE;
|
||||
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
|
||||
|
||||
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
|
||||
|
|
@ -61,6 +62,8 @@ public:
|
|||
#ifndef QT_NO_DRAGANDDROP
|
||||
QPlatformDrag *drag() const Q_DECL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
|
||||
QPlatformServices *services() const Q_DECL_OVERRIDE;
|
||||
|
||||
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
|
||||
|
|
@ -73,6 +76,7 @@ private:
|
|||
#ifndef QT_NO_DRAGANDDROP
|
||||
QScopedPointer<QPlatformDrag> m_drag;
|
||||
#endif
|
||||
QScopedPointer<QPlatformInputContext> m_inputContext;
|
||||
QScopedPointer<QPlatformServices> m_services;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue