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

Remove implicit import of QtQuick.VirtualKeyboard.Components

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 7.0 (Next Major Release)
    • Virtual Keyboard
    • None

    Description

      Background

      During review of changes porting virtual keyboard to declarative types registration, there was a debate whether some semi-public components can be moved from QtQuick.VirtualKeyboard namespace to QtQuick.VirtualKeyboard.Components. Such components are used in the keyboard layouts, which are typically not customized by user applications. In some cases, however, it is possible that custom layouts are provided.

      It was agreed that the Components are kept as implicit import of QtQuick.VirtualKeyboard until Qt7, where the components will be moved as dependencies. This would mean, that the Qt 6.x would remain backwards compatible, and in Qt7 the users would have to add an explicit

      import QtQuick.VirtualKeyboard.Components
      

      to custom layouts.

      Special case for EnterKey

      Porting to declarative type registration (as opposed to manual type registration) raised a previously hidden conflict in type resolution to surface. The EnterKey type conflicts between:

      https://doc.qt.io/qt-6/qml-qtquick-enterkey.html

      https://doc.qt.io/qt-6/qml-qtquick-virtualkeyboard-enterkey.html

      In a typical keyboard layout, there are following imports:

      import QtQuick
      import QtQuick.VirtualKeyboard
      import QtQuick.Layouts
      

      Since the implicit import is given lower precedence, EnterKey type is resolved to QtQuick.

      This issue was resolved by adding a wrapper QML component for EnterKey to QtQuick.VirtualKeyboard, which imports the EnterKey from QtQuick.VirtualKeyboard.Components, giving the component higher precedence.

      Attachments

        Activity

          People

            jakoivik Jarkko Koivikko
            jakoivik Jarkko Koivikko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: