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

6.5beta1 & 6.6 regression breaks Qt5/Qt6 code portability with PinchHandler runtime error caused by "import QtQuick 2.12"

    XMLWordPrintable

Details

    • All
    • d99afad40 (dev), 29a063284 (6.5)

    Description

      Beginning with the Qt6.5 Beta1 release (prior 6.5.0-0-202212201419, "dev" release was not affected by this bug) as well as the Qt6.6 "dev" release (6.6.0-0-202212210709), code that formerly was portable between Qt5 and Qt6 now breaks due to 

       

      import QtQuick 2.12

      Giving a runtime error:

       

      QQmlApplicationEngine failed to load component
      qrc:/main.qml:31:13: "PinchHandler.onScaleChanged" is not available in QtQuick 2.12.

       

      Which is clearly a bug since "PinchHandler" and its "scale" property were available as far back as Qt5.12. This ends up breaking code that was formerly portable for all Qt versions from 5.12 to 6.5 (at least up to "dev" release 6.5.0-0-202212201419, which didn't have this regression).

      Changing the import statement to:

       

      import QtQuick

      allows the code to work as intended with Qt6.5 and Qt6.6. However since the code requires portability between Qt5 and Qt6, removing the version number from the import statement breaks Qt5 compilation.

       

      Enclosed is an example program qqc2-quick-import-bug.tgz to demonstrate this problem.

       

       

       

       

       

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            nielsmayer Niels Mayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes