[immodule-qt] I have implemented QInputMethodEvent Property for the discussion

Lars Knoll lars at trolltech.com
Sun Jan 9 18:35:13 EET 2005


On Saturday 08 January 2005 07:44, Daisuke Kameda wrote:
> On Friday 07 January 2005 19:03, Lars Knoll wrote:
> > Below is the structure of the QInputMethodEvent I could imagine after the
> > discussions we had:
>
> Thank you for this work.
>
> > ReplaceString:
> > 	Not actually an attribute, but allows editing operations outside the
> > preedit area. value contains a QVariant of type string that specifies the
> > text to insert. start and length can specify regions outside the preedit
> > area and specify the text to be removed.
> > 	This allows inserts (length=0), deletes (string empty) and replaces of
> > text outside the preedit area.
>
> I cannot judge whether this function is enough.
> Anuradha, do you think it fills demand of surrounding text modification?

I hope it does, as it allows arbitrary modifications of the string before and 
after the preedit. Together with inputMethodQuery(ImSurroundingText) I hope 
everything needed is there.

> > Language:
> > 	The variant contains a QLocale object specifying the language of the
> > preedit string.
> > 	One question here: Is it enough to have one language for the whole event
> > or do you need to split it up into several for the preedit string? IMO
> > one language tag for the whole string should be enough.
>
> Actually, in Japanese, Writing with mixing Japanese and English is
> realized. In the future, mixing other language may be realized. Therefore,
> I think one language tag for the whole string is not enough.

Ok. So we'll leave it as an attribute that you can specify for sections of the 
string.

> > Please tell me what you think of this structure as I would like to
> > implement it as soon as possible.
>
> Although I implemented value of Attribute using the void*,
> I think that QVariant is enough as implementation at present.

QVariant has the big advantage of being typesafe that's why I chose it. 
'void *' always has problems because you can't safely cast to the original 
type and there are problems deleting the pointer. You can already now store 
almost all interesting types in a QVariant directly and if there should be 
something missing, you can register your own types for use with QVariant.

> BTW, is independent commit action realized by this implementation?

I think so as you can use the ReplaceString functionality to add a committed 
string before the preedit string.

Best regards,
Lars



More information about the immodule-qt mailing list