summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h1
2 files changed, 18 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 9e5dfb5..ec14c78 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -913,6 +913,22 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
QDeclarativePaintedItem::keyPressEvent(ev);
}
+void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev)
+{
+ Q_D(QDeclarativeTextInput);
+ inputMethodPreHandler(ev);
+ if (ev->isAccepted())
+ return;
+ if (d->control->isReadOnly()) {
+ ev->ignore();
+ } else {
+ d->control->processInputMethodEvent(ev);
+ updateSize();
+ }
+ if (!ev->isAccepted())
+ QDeclarativePaintedItem::inputMethodEvent(ev);
+}
+
/*!
\overload
Handles the given mouse \a event.
@@ -993,6 +1009,7 @@ bool QDeclarativeTextInput::event(QEvent* ev)
switch(ev->type()){
case QEvent::KeyPress:
case QEvent::KeyRelease://###Should the control be doing anything with release?
+ case QEvent::InputMethod:
case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMouseRelease:
@@ -1000,8 +1017,6 @@ bool QDeclarativeTextInput::event(QEvent* ev)
break;
default:
handled = d->control->processEvent(ev);
- if (ev->type() == QEvent::InputMethod)
- updateSize();
}
if(!handled)
handled = QDeclarativePaintedItem::event(ev);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 03f55ae..6934da4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -222,6 +222,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent(QKeyEvent* ev);
+ void inputMethodEvent(QInputMethodEvent *);
bool event(QEvent *e);
void focusInEvent(QFocusEvent *event);