Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6.2
-
None
Description
The general documentation for dealing with input methods is in QInputMethodEvent, not in QInputMethod. Unfortunately, there is not a single reference from the latter to the former.
QInputMethodEvent documentation states that (text editing) subclasses of QWidget shall reimplement QWidget::inputMethodQuery(). This links to the single-argument method which exist in QWidget and is documented. However, QInputMethod::queryFocusObject() does an invokeMethod on an undocumented two-argument method QWidget::inputMethodQuery() first.
- Apart from the lack of documentation, this gives warnings at least in debug mode (QMetaObject::invokeMethod: No such method SomeWidget::inputMethodQuery(Qt::InputMethodQuery,QVariant)).
- If invokeMethod() fails, QInputMethod::queryFocusObject() goes on to send a QInputMethodQuery event to the focus object, which eventually leads to calls of the single argument QWidget::inputMethodQuery(). I guess that this is a fallback for legacy behaviour. I wonder if this fallback couldn't be implemented as a default behaviour in the (missing) two-argument form of QWidget::inputMethodQuery() which in turn could be documented. (I assume it will not makes sense to document the two-argument form unless it can also be called by users.)