[immodule-qt] Some more things for Qt 4

Lars Knoll lars at trolltech.com
Fri Nov 12 11:40:17 EET 2004


On Sunday 31 October 2004 16:16, Daisuke Kameda wrote:
> Lars Knoll <lars at trolltech.com> wrote:
> > * QApplication::changeAllInputContext(), does set all input contexts in
> > the app to the new method. I am not sure, but I think that such a method
> > should not include input contexts that are private to a certain widget.
>
> I think now that the method is not required.
>
> > * Do we really need one input context per top level widget? Wouldn't it
> > be enough to have one per application (apart from private contexts)? We
> > could then have QApplication::setInputContext() to change the global (app
> > wide) input context, and QWidget::setInputContext() to set a private
> > input context.
>
> I think that input context per top level widget is required.
> But I want to know the treatment of input context which you consider,
> in order that I understand the reason you thought this.

I'll write another mail about the whole design I see in a second. But the main 
reason is to make the design easy and consistent. Using one input context per 
top level was a hack we introduced in Qt 3 to make XIM work at least partly 
correct in an application. 

One input context per top level some strange and inconsistent middle way. 
Either you should have one context per application or one context per input 
widget depending on how the design is. I think the design with one input 
context per application is cleaner and easier for people using input contexts 
in the application. It might be a bit harder for people implementing input 
contexts, but it is more flexible.

But IMO the better design is to hide the complexity and deficiencies of XIM on 
QXIMInputContext. Your implementation of an input context can still hold data 
for each widget that can receive text input internally. 

Cheers,
Lars



More information about the immodule-qt mailing list