From e941b37fcc715fc20d7365cae21cd657a215cf8f Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 11 Oct 2011 13:10:50 +0300 Subject: Move input panel visibility ownership from QInputPanel to QPlatformInputContext Now QInputPanel::visible() can be set true even when platform doesn't provide a virtual keyboard. Like keyboard geometry, visibility should be dictated by the platform plugin and not QInputPanel, whose role is more like that of a mediator. QInputPanel::show() and ::hide() calls should be treated as requests that may fail. Changed the QInputPanel's visible property to read-only as a setter that may fail is not really a setter, show() and hide() should be used instead. Enabling the new functionality cannot be activated immediatelly without breaking existing keyboards, added a temporary function handlesInputPanelVisibility that handovers the responsiblity of updating input panel visibility to QInputContextPlatform only once QInputContextPlatform says that it is able to handle it. Change-Id: Ideecaf7225cc3971f33a0ac976bd92cf7767475b Reviewed-on: http://codereview.qt-project.org/6429 Sanity-Review: Qt Sanity Bot Reviewed-by: Pekka Vuorela Reviewed-by: Lars Knoll --- src/gui/kernel/qplatforminputcontext_qpa.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qplatforminputcontext_qpa.cpp') diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp index 0313f69e5b..55b60279b8 100644 --- a/src/gui/kernel/qplatforminputcontext_qpa.cpp +++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp @@ -90,12 +90,12 @@ QRectF QPlatformInputContext::keyboardRect() const return QRectF(); } -void QPlatformInputContext::emitKeyboardRectChanged() const +void QPlatformInputContext::emitKeyboardRectChanged() { emit qApp->inputPanel()->keyboardRectangleChanged(); } -bool QPlatformInputContext::isAnimating() +bool QPlatformInputContext::isAnimating() const { return false; } @@ -105,5 +105,28 @@ void QPlatformInputContext::emitAnimatingChanged() emit qApp->inputPanel()->animatingChanged(); } +void QPlatformInputContext::showInputPanel() +{ +} + +void QPlatformInputContext::hideInputPanel() +{ +} + +bool QPlatformInputContext::isInputPanelVisible() const +{ + return false; +} + +void QPlatformInputContext::emitInputPanelVisibleChanged() +{ + emit qApp->inputPanel()->visibleChanged(); +} + +// temporary function added to retain compatibility to old functionality, will be deprecated +bool QPlatformInputContext::handlesInputPanelVisibility() const +{ + return false; +} QT_END_NAMESPACE -- cgit v1.2.3