summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-29 03:32:38 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-29 03:32:38 (GMT)
commitc0502481e49ea2c72a767a80fafdb51f8a135c98 (patch)
tree3961188a702360a56a1223b8323f2a60e41b15b2 /src/gui/graphicsview/qgraphicsitem.cpp
parent189d2660968368532761586ffd495eb6c18cdbdf (diff)
downloadQt-c0502481e49ea2c72a767a80fafdb51f8a135c98.zip
Qt-c0502481e49ea2c72a767a80fafdb51f8a135c98.tar.gz
Qt-c0502481e49ea2c72a767a80fafdb51f8a135c98.tar.bz2
Ensure micro focus is updated in TextEdit and TextInput
Task-number: QTBUG-11552
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2de3638..8a419b4 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7312,10 +7312,13 @@ void QGraphicsItem::updateMicroFocus()
{
#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
if (QWidget *fw = QApplication::focusWidget()) {
- for (int i = 0 ; i < scene()->views().count() ; ++i)
- if (scene()->views().at(i) == fw)
- if (QInputContext *inputContext = fw->inputContext())
- inputContext->update();
+ if (scene()) {
+ for (int i = 0 ; i < scene()->views().count() ; ++i) {
+ if (scene()->views().at(i) == fw)
+ if (QInputContext *inputContext = fw->inputContext())
+ inputContext->update();
+ }
+ }
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);