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

QKeyEvent: revise documentation

    XMLWordPrintable

Details

    Description

      QKeyEvent documentation has several mysterious sections, some excerpts:

      "A value of either 0 or Qt::Key_unknown means that the event is not the result of a known key; for example, it may be the result of a compose sequence, a keyboard macro, or due to key event compression."

      what is a keyboard macro?
      key event compression?

      It does not document that QKeyEvent::key() often returns a unicode value.

      "Note that if the event is a multiple-key compressed event that is partly due to auto-repeat, this function could return either true or false indeterminately."

      what is that about?

      The docs should also include an example of auto-repeat key sequence (there have been several instances when expected behavior is not obvious to API users):

      key: press autorepeat: false
      key: release autorepeat: true
      key: press autorepeat: true
      key: release autorepeat: false
      

      With an example where this is useful:

      Keys.onReleased: {
          if (!event.isAutoRepeat)
              console.log("key was physically released ") 
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              docteam Qt Documentation Team
              paeglis Gatis Paeglis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes