[immodule-qt] Some more things for Qt 4

Anuradha Ratnaweera gnu.slash.linux at gmail.com
Mon Oct 25 09:41:36 EEST 2004


On Sun, 24 Oct 2004 18:26:03 +0900, Daisuke Kameda
<kaminmat at cc.rim.or.jp> wrote:
> 
> I feel this solution is good. Please tell me example usage about
> surrounding text for more detailed discussion. Especially, I want to know
> about how getting and using data from QVAriant object.

In GTK, when queried for surrounding text, it returns a _copy_ of the
actual text which needs to be free()ed.  But this is not necessary,
and expensive, to malloc() and strcpy() for each call, so returning a
pointer to actual text would have been efficient (IMHO only).  And if
one really wants, then doing a malloc(), strycpy() and free() would
have been triviel.

I think we better learn from that experience and not to do expensive
allocation / deallocation per every surrounding text query (and for
other proposed queries for QT4 that returns large data structures). 
In the immodules that use it (Sinhala, for example), there will be one
per every keystroke!  I don't know how this works exactly in C++, so
can't talk specifically.

        Anuradha

-- 

http://www.linux.lk/~anuradha/
http://www.gnu.org/philosophy/no-word-attachments.html



More information about the immodule-qt mailing list