Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57325

Documentation for QInputMethod and QWidget::inputMethodQuery is incomplete

    XMLWordPrintable

Details

    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.)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            docteam Qt Documentation Team
            dg0yt Kai Pastor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes