[immodule-qt] [PATCH] Surrounding text

Daisuke Kameda kaminmat at cc.rim.or.jp
Thu Sep 23 15:49:15 EEST 2004


On Wednesday 22 September 2004 15:13, Anuradha Ratnaweera wrote:
> Finally I managed to get surrounding text support in QT 3.3.3.

Thank you for contribution. And, I checked the patch.


> As we discussed here recently, it was done by adding a
> imGetSurrounding() and imDeleteSurrounding() virtual functions in
> QWidget and overiding them in QTextEdit and QLineEdit.  QInputContext
> also implements getSurrounding() and deleteSurrounding() functions,
> that simply call the corresponding ones in its composingWidget.

I think that this function name and implementation are good. 

The programmer will think that the function of the name "im*()" must 
be overrided for input method, when programming original widget. 

And, this implementation is very simple.


> I am not totally happy with the way I implemented imGetSurrounding()
> in QTextEdit.  Please comment.
>
> Plain QT applications such as qtconfig, and qt designer are working
> perfectly.  But some KDE applications that have their own input
> widgets (e.g.: Kate) doesn't work.  Adding, or rather overiding,
> imGetSurrounding() and imDeleteSurrounding() for them shouldn't be
> that tough.  I am looking into it now.

This is very difficult question. To enable input method in original widget, 
the programmer must also override imStartEvent(), imComposingEvent(), 
and imEndEvent().

Also in the implementation about XIM on the original Qt's code, he or she 
have to override these three functions in order to support on-the-spot 
style. So I think that it is unavoidable.

What do you think, All?


> Attached patch along with Sinhala Transliterated input method which I
> use to test it are here:
>
>     http://cvs.linux.lk/cgi-bin/cvsweb/sinhala/qt/im/
>
> Notice that the patch qt-3.3.3-im-sinhala.patch is redundant because
> it simply adds the contents in sinhala-t to QT source tree, and also
> adds sinhala-t to inputmethods.pro.

Thanks, I will check them, too.

-- 
Daisuke Kameda <kaminmat at cc.rim.or.jp>




More information about the immodule-qt mailing list