--- qt-x11-free-3.3.8/src/widgets/qtextedit.cpp.post_immodule 2007-02-27 09:36:05.000000000 +0100 +++ qt-x11-free-3.3.8/src/widgets/qtextedit.cpp 2007-02-27 09:37:18.000000000 +0100 @@ -1035,7 +1035,7 @@ bool drawCur = hasFocus() || viewport()->hasFocus(); if (( hasSelectedText() && !style().styleHint( QStyle::SH_BlinkCursorWhenTextSelected ) ) || - isReadOnly() || !cursorVisible ) + isReadOnly() || !cursorVisible || doc->hasSelection( QTextDocument::IMSelectionText )) drawCur = FALSE; QColorGroup g = colorGroup(); const QColorGroup::ColorRole backRole = QPalette::backgroundRoleFromMode(backgroundMode()); @@ -1662,6 +1662,7 @@ } } + updateMicroFocusHint(); repaintChanged(); } @@ -2173,6 +2174,7 @@ ( !style().styleHint( QStyle::SH_BlinkCursorWhenTextSelected ) && ( d->optimMode ? optimHasSelection() : doc->hasSelection( QTextDocument::Standard, TRUE ))) || ( visible && !hasFocus() && !viewport()->hasFocus() && !inDnD ) || + doc->hasSelection( QTextDocument::IMSelectionText ) || isReadOnly() ) return; @@ -2897,8 +2899,14 @@ void QTextEdit::updateMicroFocusHint() { QTextCursor c( *cursor ); - if ( d->preeditStart != -1 ) - c.setIndex( d->preeditStart ); + if ( d->preeditStart != -1 ) { + c.setIndex( d->preeditStart ); + if(doc->hasSelection(QTextDocument::IMSelectionText)) { + int para, index; + doc->selectionStart(QTextDocument::IMSelectionText, para, index); + c.setIndex(index); + } + } if ( hasFocus() || viewport()->hasFocus() ) { int h = c.paragraph()->lineHeightOfChar( cursor->index() ); --- qt-x11-free-3.3.8/src/widgets/qlineedit.cpp.post_immodule 2007-02-27 09:36:05.000000000 +0100 +++ qt-x11-free-3.3.8/src/widgets/qlineedit.cpp 2007-02-27 09:39:41.000000000 +0100 @@ -1843,8 +1843,9 @@ d->imend = d->imstart + e->text().length(); d->imselstart = d->imstart + e->cursorPos(); d->imselend = d->imselstart + e->selectionLength(); - d->cursor = e->selectionLength() ? d->imend : d->imselend; + d->cursor = d->imselstart; d->updateTextLayout(); + d->updateMicroFocusHint(); update(); }