Merge branch 'master' into refactor
[profile/ivi/qtdeclarative.git] / src / declarative / items / qsgtextedit.cpp
index eeeaa20..1c0ed62 100644 (file)
@@ -47,8 +47,8 @@
 #include "qsgsimplerectnode.h"
 
 #include <QtDeclarative/qdeclarativeinfo.h>
-#include <QtGui/qapplication.h>
-#include <QtGui/qgraphicssceneevent.h>
+#include <QtWidgets/qapplication.h>
+#include <QtWidgets/qgraphicssceneevent.h>
 #include <QtGui/qpainter.h>
 #include <QtGui/qtextobject.h>
 #include <QtCore/qmath.h>
@@ -1360,9 +1360,11 @@ void QSGTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
     d->control->processEvent(event, QPointF(0, -d->yoff));
     if (!d->showInputPanelOnFocus) { // input panel on click
         if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
-            if (canvas() && canvas() == qApp->focusWidget()) {
-                qt_widget_private(canvas())->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
-            }
+            // ### refactor: port properly
+            qDebug("QSGTextEdit: virtual keyboard handling not implemented");
+//            if (canvas() && canvas() == qApp->focusWidget()) {
+//                qt_widget_private(canvas())->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+//            }
         }
     }
     d->clickCausedFocus = false;
@@ -1412,7 +1414,7 @@ void QSGTextEdit::itemChange(ItemChange change, const ItemChangeData &value)
 {
     Q_D(QSGTextEdit);
     if (change == ItemActiveFocusHasChanged) {
-        setCursorVisible(value.boolValue && d->canvas && d->canvas->hasFocus());
+        setCursorVisible(value.boolValue); // ### refactor: focus handling && d->canvas && d->canvas->hasFocus());
     }
     QSGItem::itemChange(change, value);
 }
@@ -1906,7 +1908,7 @@ void QSGTextEditPrivate::updateDefaultTextOption()
 void QSGTextEdit::openSoftwareInputPanel()
 {
     if (qApp) {
-        if (canvas() && canvas() == qApp->focusWidget()) {
+        if (canvas()) {
             QEvent event(QEvent::RequestSoftwareInputPanel);
             QApplication::sendEvent(canvas(), &event);
         }
@@ -1953,9 +1955,9 @@ void QSGTextEdit::openSoftwareInputPanel()
     \endcode
 */
 void QSGTextEdit::closeSoftwareInputPanel()
-{
+{  
     if (qApp) {
-        if (canvas() && canvas() == qApp->focusWidget()) {
+        if (canvas()) {
             QEvent event(QEvent::CloseSoftwareInputPanel);
             QApplication::sendEvent(canvas(), &event);
         }