aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtquick1
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2011-09-08 15:12:45 +0300
committerLars Knoll <lars.knoll@nokia.com>2011-09-08 15:23:54 +0200
commitc8fdb0541b047b73413aa67d4f5aece539e98347 (patch)
tree4b8cf5ea6cc0273d153f63d3d7aa377a06d62af5 /src/qtquick1
parentaabb92746d02ed05baccf72c2905c9d4203d15f2 (diff)
Fix TextInput and TextEdit software input panel on qtquick1
Change-Id: I39da7a877cef546da69bccfcf7ee1ae2ba92b208 Reviewed-on: http://codereview.qt-project.org/4455 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/qtquick1')
-rw-r--r--src/qtquick1/graphicsitems/qdeclarativetextedit.cpp7
-rw-r--r--src/qtquick1/graphicsitems/qdeclarativetextinput.cpp9
2 files changed, 6 insertions, 10 deletions
diff --git a/src/qtquick1/graphicsitems/qdeclarativetextedit.cpp b/src/qtquick1/graphicsitems/qdeclarativetextedit.cpp
index 36105158f3..777d964716 100644
--- a/src/qtquick1/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/qtquick1/graphicsitems/qdeclarativetextedit.cpp
@@ -56,6 +56,7 @@
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QPainter>
+#include <QtGui/QInputPanel>
#include <private/qtextcontrol_p.h>
@@ -1807,11 +1808,10 @@ void QDeclarative1TextEditPrivate::updateDefaultTextOption()
*/
void QDeclarative1TextEdit::openSoftwareInputPanel()
{
- QEvent event(QEvent::RequestSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->show();
}
}
}
@@ -1858,11 +1858,10 @@ void QDeclarative1TextEdit::openSoftwareInputPanel()
*/
void QDeclarative1TextEdit::closeSoftwareInputPanel()
{
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->hide();
}
}
}
diff --git a/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp b/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
index 271595a863..544e35d46d 100644
--- a/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
@@ -48,6 +48,7 @@
#include <QValidator>
#include <QTextCursor>
#include <QApplication>
+#include <QtGui/QInputPanel>
#include <QFontMetrics>
#include <QPainter>
#include <QTextBoundaryFinder>
@@ -1277,7 +1278,6 @@ bool QDeclarative1TextInput::event(QEvent* ev)
void QDeclarative1TextInput::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
- Q_D(QDeclarative1TextInput);
if (newGeometry.width() != oldGeometry.width()) {
updateSize();
updateCursorRectangle();
@@ -1763,11 +1763,10 @@ void QDeclarative1TextInput::moveCursorSelection(int pos, SelectionMode mode)
*/
void QDeclarative1TextInput::openSoftwareInputPanel()
{
- QEvent event(QEvent::RequestSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->show();
}
}
}
@@ -1814,12 +1813,10 @@ void QDeclarative1TextInput::openSoftwareInputPanel()
*/
void QDeclarative1TextInput::closeSoftwareInputPanel()
{
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (qApp) {
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->hide();
}
}
}