QNX: Add support for QInputMethod::keyboardRectangle()
Change-Id: Ie23aa06fed5778e228abf0f35fc1136a86661771 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
parent
4866fcf008
commit
6b8d0b3092
@ -42,6 +42,8 @@
|
|||||||
#include "qqnxinputcontext_imf.h"
|
#include "qqnxinputcontext_imf.h"
|
||||||
#include "qqnxeventthread.h"
|
#include "qqnxeventthread.h"
|
||||||
#include "qqnxabstractvirtualkeyboard.h"
|
#include "qqnxabstractvirtualkeyboard.h"
|
||||||
|
#include "qqnxintegration.h"
|
||||||
|
#include "qqnxscreen.h"
|
||||||
|
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtGui/QInputMethodEvent>
|
#include <QtGui/QInputMethodEvent>
|
||||||
@ -645,12 +647,13 @@ static bool imfAvailable()
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QQnxInputContext::QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard):
|
QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard) :
|
||||||
QPlatformInputContext(),
|
QPlatformInputContext(),
|
||||||
m_lastCaretPos(0),
|
m_lastCaretPos(0),
|
||||||
m_isComposing(false),
|
m_isComposing(false),
|
||||||
m_inputPanelVisible(false),
|
m_inputPanelVisible(false),
|
||||||
m_inputPanelLocale(QLocale::c()),
|
m_inputPanelLocale(QLocale::c()),
|
||||||
|
m_integration(integration),
|
||||||
m_virtualKeyboad(keyboard)
|
m_virtualKeyboad(keyboard)
|
||||||
{
|
{
|
||||||
qInputContextDebug() << Q_FUNC_INFO;
|
qInputContextDebug() << Q_FUNC_INFO;
|
||||||
@ -857,6 +860,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRectF QQnxInputContext::keyboardRect() const
|
||||||
|
{
|
||||||
|
QRect screenGeometry = m_integration->primaryDisplay()->geometry();
|
||||||
|
return QRectF(screenGeometry.x(), screenGeometry.height() - m_virtualKeyboard.height(),
|
||||||
|
screenGeometry.width(), m_virtualKeyboard.height());
|
||||||
|
}
|
||||||
|
|
||||||
void QQnxInputContext::reset()
|
void QQnxInputContext::reset()
|
||||||
{
|
{
|
||||||
qInputContextDebug() << Q_FUNC_INFO;
|
qInputContextDebug() << Q_FUNC_INFO;
|
||||||
|
@ -54,21 +54,24 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QQnxAbstractVirtualKeyboard;
|
class QQnxAbstractVirtualKeyboard;
|
||||||
|
class QQnxIntegration;
|
||||||
|
|
||||||
class QQnxInputContext : public QPlatformInputContext
|
class QQnxInputContext : public QPlatformInputContext
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard);
|
explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard);
|
||||||
~QQnxInputContext();
|
~QQnxInputContext();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
bool filterEvent(const QEvent *event);
|
bool filterEvent(const QEvent *event);
|
||||||
|
QRectF keyboardRect() const;
|
||||||
void reset();
|
void reset();
|
||||||
void update(Qt::InputMethodQueries);
|
void update(Qt::InputMethodQueries);
|
||||||
bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
|
bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
|
||||||
|
|
||||||
|
|
||||||
void showInputPanel();
|
void showInputPanel();
|
||||||
void hideInputPanel();
|
void hideInputPanel();
|
||||||
bool isInputPanelVisible() const;
|
bool isInputPanelVisible() const;
|
||||||
@ -125,6 +128,7 @@ private:
|
|||||||
QString m_composingText;
|
QString m_composingText;
|
||||||
bool m_inputPanelVisible;
|
bool m_inputPanelVisible;
|
||||||
QLocale m_inputPanelLocale;
|
QLocale m_inputPanelLocale;
|
||||||
|
QQnxIntegration *m_integration;
|
||||||
QQnxAbstractVirtualKeyboard &m_virtualKeyboad;
|
QQnxAbstractVirtualKeyboard &m_virtualKeyboad;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
#include "qqnxinputcontext_noimf.h"
|
#include "qqnxinputcontext_noimf.h"
|
||||||
#include "qqnxabstractvirtualkeyboard.h"
|
#include "qqnxabstractvirtualkeyboard.h"
|
||||||
|
#include "qqnxintegration.h"
|
||||||
|
#include "qqnxscreen.h"
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
@ -53,10 +55,11 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QQnxInputContext::QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard) :
|
QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard) :
|
||||||
QPlatformInputContext(),
|
QPlatformInputContext(),
|
||||||
m_inputPanelVisible(false),
|
m_inputPanelVisible(false),
|
||||||
m_inputPanelLocale(QLocale::c()),
|
m_inputPanelLocale(QLocale::c()),
|
||||||
|
m_integration(integration),
|
||||||
m_virtualKeyboard(keyboard)
|
m_virtualKeyboard(keyboard)
|
||||||
{
|
{
|
||||||
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
|
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
|
||||||
@ -105,6 +108,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRectF QQnxInputContext::keyboardRect() const
|
||||||
|
{
|
||||||
|
QRect screenGeometry = m_integration->primaryDisplay()->geometry();
|
||||||
|
return QRectF(screenGeometry.x(), screenGeometry.height() - m_virtualKeyboard.height(),
|
||||||
|
screenGeometry.width(), m_virtualKeyboard.height());
|
||||||
|
}
|
||||||
|
|
||||||
bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
|
bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
|
||||||
{
|
{
|
||||||
Q_UNUSED(flags);
|
Q_UNUSED(flags);
|
||||||
|
@ -49,18 +49,20 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QQnxAbstractVirtualKeyboard;
|
class QQnxAbstractVirtualKeyboard;
|
||||||
|
class QQnxIntegration;
|
||||||
|
|
||||||
class QQnxInputContext : public QPlatformInputContext
|
class QQnxInputContext : public QPlatformInputContext
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard);
|
explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard);
|
||||||
~QQnxInputContext();
|
~QQnxInputContext();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
bool filterEvent( const QEvent *event );
|
bool filterEvent( const QEvent *event );
|
||||||
|
QRectF keyboardRect() const;
|
||||||
bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
|
bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
|
||||||
|
|
||||||
void showInputPanel();
|
void showInputPanel();
|
||||||
@ -79,6 +81,7 @@ private:
|
|||||||
|
|
||||||
bool m_inputPanelVisible;
|
bool m_inputPanelVisible;
|
||||||
QLocale m_inputPanelLocale;
|
QLocale m_inputPanelLocale;
|
||||||
|
QQnxIntegration *m_integration;
|
||||||
QQnxAbstractVirtualKeyboard &m_virtualKeyboard;
|
QQnxAbstractVirtualKeyboard &m_virtualKeyboard;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ QQnxIntegration::QQnxIntegration()
|
|||||||
|
|
||||||
#if defined(QQNX_PPS)
|
#if defined(QQNX_PPS)
|
||||||
// Set up the input context
|
// Set up the input context
|
||||||
m_inputContext = new QQnxInputContext(*m_virtualKeyboard);
|
m_inputContext = new QQnxInputContext(this, *m_virtualKeyboard);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user