From c8fdb0541b047b73413aa67d4f5aece539e98347 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 8 Sep 2011 15:12:45 +0300 Subject: 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 Reviewed-by: Lars Knoll --- src/qtquick1/graphicsitems/qdeclarativetextedit.cpp | 7 +++---- src/qtquick1/graphicsitems/qdeclarativetextinput.cpp | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/qtquick1') 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 #include #include +#include #include @@ -1807,11 +1808,10 @@ void QDeclarative1TextEditPrivate::updateDefaultTextOption() */ void QDeclarative1TextEdit::openSoftwareInputPanel() { - QEvent event(QEvent::RequestSoftwareInputPanel); if (qApp) { if (QGraphicsView * view = qobject_cast(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(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 #include #include +#include #include #include #include @@ -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(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(qApp->focusWidget())) { if (view->scene() && view->scene() == scene()) { - QApplication::sendEvent(view, &event); + qApp->inputPanel()->hide(); } } } -- cgit v1.2.3