From: Joona Petrell Date: Thu, 8 Sep 2011 09:09:22 +0000 (+0300) Subject: Fix TextInput and TextEdit open/closeSoftwareInputPanel functions X-Git-Tag: qt-v5.0.0-alpha1~1697^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f034d804b76eacbf59a2dbb1f240d741fee0957a;p=profile%2Fivi%2Fqtdeclarative.git Fix TextInput and TextEdit open/closeSoftwareInputPanel functions Change-Id: I69bac4d1ce55271685dcddcc4c8ad2f6598e7630 Reviewed-on: http://codereview.qt-project.org/4439 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- diff --git a/src/declarative/items/qsgtextedit.cpp b/src/declarative/items/qsgtextedit.cpp index 74f3450..1afb36f 100644 --- a/src/declarative/items/qsgtextedit.cpp +++ b/src/declarative/items/qsgtextedit.cpp @@ -1919,12 +1919,8 @@ void QSGTextEditPrivate::updateDefaultTextOption() */ void QSGTextEdit::openSoftwareInputPanel() { - if (qApp) { - if (canvas()) { - QEvent event(QEvent::RequestSoftwareInputPanel); - QGuiApplication::sendEvent(canvas(), &event); - } - } + if (qGuiApp) + qGuiApp->inputPanel()->show(); } /*! @@ -1968,12 +1964,8 @@ void QSGTextEdit::openSoftwareInputPanel() */ void QSGTextEdit::closeSoftwareInputPanel() { - if (qApp) { - if (canvas()) { - QEvent event(QEvent::CloseSoftwareInputPanel); - QGuiApplication::sendEvent(canvas(), &event); - } - } + if (qGuiApp) + qGuiApp->inputPanel()->show(); } void QSGTextEdit::focusInEvent(QFocusEvent *event) diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp index 7a58698..42105cf 100644 --- a/src/declarative/items/qsgtextinput.cpp +++ b/src/declarative/items/qsgtextinput.cpp @@ -1732,12 +1732,8 @@ void QSGTextInput::moveCursorSelection(int pos, SelectionMode mode) */ void QSGTextInput::openSoftwareInputPanel() { - if (qApp) { - if (canvas()) { - QEvent event(QEvent::RequestSoftwareInputPanel); - QCoreApplication::sendEvent(canvas(), &event); - } - } + if (qGuiApp) + qGuiApp->inputPanel()->show(); } /*! @@ -1781,12 +1777,8 @@ void QSGTextInput::openSoftwareInputPanel() */ void QSGTextInput::closeSoftwareInputPanel() { - if (qApp) { - if (canvas()) { - QEvent event(QEvent::CloseSoftwareInputPanel); - QCoreApplication::sendEvent(canvas(), &event); - } - } + if (qGuiApp) + qGuiApp->inputPanel()->hide(); } void QSGTextInput::focusInEvent(QFocusEvent *event)