summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextedit.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-05-26 06:26:19 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-05-26 06:28:39 (GMT)
commit1256a212460438462367b48de086ab690f722be5 (patch)
tree110b43dfab0e3bb00d324fe33c8c07dc842ab1ac /src/declarative/graphicsitems/qdeclarativetextedit.cpp
parent3449d4594f312728926ac83ae8453bba40434bbd (diff)
downloadQt-1256a212460438462367b48de086ab690f722be5.zip
Qt-1256a212460438462367b48de086ab690f722be5.tar.gz
Qt-1256a212460438462367b48de086ab690f722be5.tar.bz2
Open input panel on press if TextInput or TextEdit are already focused but panel has been closed
Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextedit.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 348a8bd..167db77 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -963,6 +963,7 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
if (d->focusOnPress){
+ bool hadFocus = hasFocus();
QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
while(p) {
if (p->flags() & QGraphicsItem::ItemIsFocusScope)
@@ -970,6 +971,10 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
+ if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
}
if (event->type() != QEvent::GraphicsSceneMouseDoubleClick || d->selectByMouse)
d->control->processEvent(event, QPointF(0, -d->yoff));