summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-02-16 03:33:52 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-02-21 04:34:41 (GMT)
commitfd198736e1da02f535bc81d9934cb4e8412a87bc (patch)
treec256a874dd17f94ab8d354ffe6dfd47055b6e1e4 /src/declarative
parent521a9bba59fe198ec7b1afe9bb25a9d3334675cf (diff)
downloadQt-fd198736e1da02f535bc81d9934cb4e8412a87bc.zip
Qt-fd198736e1da02f535bc81d9934cb4e8412a87bc.tar.gz
Qt-fd198736e1da02f535bc81d9934cb4e8412a87bc.tar.bz2
Hide the TextInput/Edit cursor when the view doesn't have focus.
Only display a cursor if both the item and its scene have focus. Change-Id: I0c91ab4d533cd7d773ffc2489633e12c0d399ad9 Task-number: QTBUG-17365 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 2946f6e..83c7420 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1126,7 +1126,7 @@ void QDeclarativeTextEdit::keyReleaseEvent(QKeyEvent *event)
void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
{
Q_Q(QDeclarativeTextEdit);
- q->setCursorVisible(hasFocus);
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
QDeclarativeItemPrivate::focusChanged(hasFocus);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index bfcd715..ba1ae63 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -948,7 +948,7 @@ void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
{
Q_Q(QDeclarativeTextInput);
focused = hasFocus;
- q->setCursorVisible(hasFocus);
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
if(q->echoMode() == QDeclarativeTextInput::PasswordEchoOnEdit && !hasFocus)
control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
if (!hasFocus)