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

Expose new QInputPanel API as global property Qt.application.inputPanel

    XMLWordPrintable

Details

    Description

      Old Qt 4 QInputContext is replaced by two new APIs QInputPanel and QPlatformInputContext in Qt 5. QPlatformInputContext API is not accessible by applications at all, but used by platform input methods to integrate to Qt. From application perspective most text input related functionality is accessed either through the public editor API (TextInput/TextEdit) or using the new QInputPanel API. For the most part QInputPanel is just a property container and fits QML model of development well, and should be exposed by QtQuick.

      InputPanel {
          cursorRectangle // updated up to every frame when needed, provides cursor rectangle in scene co-ordinates
          keyboardRectangle // keyboard geometry in scene co-ordinates
          visible // virtual keyboard visibility, for non-visual input methods this is always false
          animating // keyboard is in the process of opening/closing, e.g. fully open when !animating && visible
          function show() // convenience functions to set the visible property
          function hide() // convenience functions to set the visible property
      }
      

      Keyboard geometry information is needed to position and animate the application view optimally when keyboard is opened and closed, or when keyboard changes it's size due to keyboard language change. Qt Quick 1.x -based component libraries like Symbian and Meego Qt Components expose keyboard geometry information to QML side in some form or another. From Qt 5 onwards this information will be exposed as part of QInputPanel and provided by the currently active platform input context. Applications can query the keyboard geometry using Qt.application.inputPanel.keyboardRectangle property.

      Also, openSoftwareInputPanel() and closeSoftwareInputPanel() functions should be deprecated in TextInput and TextEdit. From Qt 5 onwards applications should use Qt.application.inputPanel.visible/show()/hide() instead.

      Attachments

        For Gerrit Dashboard: QTBUG-21449
        # Subject Branch Project Status CR V

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes