[immodule-qt] Turn the argument of QInputContext::filterEvent() into const

YamaKen yamaken at bp.iij4u.or.jp
Tue Aug 10 11:27:51 EEST 2004


Hi all, I would like to change a API a little. Please tell me
what do you think about it.

The 'event' argument of QInputContext::filterEvent() is not a
const. It impresses a doubt about the interface to developers.

bool QInputContext::filterEvent( QEvent *event )
{
    return FALSE;
}

QEvent that passed to the function is restricted to 'input
events' such as QKeyEvent. But such events have accept() and
ignore() methods to indicate whether the event had already been
accepted by an object (Qt4 has been made it into a base class
'QInputEvent' as an improvement). It confuses developers as
"should I invoke event->accept() in addition to returning TRUE
when I comsume the event?"

To eliminate such confusion, I would like to make it const. It
is compatible with both Qt3 and Qt4.

bool QInputContext::filterEvent( const QEvent *event )
{
    return FALSE;
}

-------------------------------
YamaKen  yamaken at bp.iij4u.or.jp



More information about the immodule-qt mailing list