summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2009-12-16 15:21:08 +0100
committerQt Continuous Integration System <qt-info@nokia.com>2009-12-16 15:21:08 +0100
commit6b07987e030deb402f51eda69b640ffd07f372d5 (patch)
tree200f06b10bc154a1adf1a5dcd374738d7fd26ea1 /src/gui/itemviews/qabstractitemview.cpp
parent4d34dc665a5145237801e46cc0a502e32b1a5dad (diff)
parenta2ec72ee604181892050093669b870580708842d (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: (31 commits) Fixed qstylesheetstyle benchmark for Symbian Fixed qdiriterator benchmark for Symbian Fixed events benchmark postEvent function Fix for QTBUG-4908 SVG transparency rendering problem. Long informative texts causes messagebox to grow outside of screen area qreal-ization qreal-ization qreal-ization QS60Style: Remove layouts with mirrored information Fixed qgraphicsview autotest build for winscw. Enabled input method update code for all platforms. (ODBC) Fixes segfault when error string is larger than 256 chars. Fixed QGraphicsView benchmark for Symbian. FEP indicator shown in status pane when it should not Skipped the most memory intensive tests in QByteArray benchmark. qreal-ization qreal-ization QS60Style: Theme graphics for QSlider in 3.1 QS60Style: Groove changes caused build break of S60 3.1 Slow spinbox on N95 when using keys Up/Down ...
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 47b5f66308..f447989ff6 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2068,9 +2068,13 @@ void QAbstractItemView::focusInEvent(QFocusEvent *event)
{
Q_D(QAbstractItemView);
QAbstractScrollArea::focusInEvent(event);
- if (selectionModel()
+
+ const QItemSelectionModel* model = selectionModel();
+ const bool currentIndexValid = currentIndex().isValid();
+
+ if (model
&& !d->currentIndexSet
- && !currentIndex().isValid()) {
+ && !currentIndexValid) {
bool autoScroll = d->autoScroll;
d->autoScroll = false;
QModelIndex index = moveCursor(MoveNext, Qt::NoModifier); // first visible index
@@ -2078,6 +2082,17 @@ void QAbstractItemView::focusInEvent(QFocusEvent *event)
selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
d->autoScroll = autoScroll;
}
+
+ if (model && currentIndexValid) {
+ if (currentIndex().flags() != Qt::ItemIsEditable)
+ setAttribute(Qt::WA_InputMethodEnabled, false);
+ else
+ setAttribute(Qt::WA_InputMethodEnabled);
+ }
+
+ if (!currentIndexValid)
+ setAttribute(Qt::WA_InputMethodEnabled, false);
+
d->viewport->update();
}