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

QQmlProperty crashes on alias properties

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.10.1
    • Fix Version/s: 5.11.0 Beta 2
    • Labels:
      None
    • Environment:
      Windows 10/most likely any case-insensitive file system.
    • Commits:
      efa0dac9c4c456793f9e0e706a3b026ed0941801

      Description

      QQmlProperty crashes on alias properties if a component with the same name exists.
      e.g.

      Item {
          property alias test: test
          width: 400
          height: 400
          Rectangle {
              id: test
          }
      }
      

      If a component Test.qml exists this will crash if the alias property is accessed via QQmlProperty.

      When using qrc files (which are always case sensitive) the issue does not occur.
      This is highly relevant for the Qt Quick Designer, since the designer always
      uses the native file system and also promotes using alias properties.

      I attached a simple example that triggers the crash on Windows.

      This is a regression against Qt 5.10.0.

      It was introduced by 1e350a8c98d9c98823dde83a6745d2f26a9c0785.
      Since exists = QFile::exists(path); (qmltypeloader line 1843) is case insensitive we get a "false postive" for "type names must begin with an uppercase letter".
      The ad hoc fix would be to make the check case sensitive for the filename.

      This is also relevant for Qt 5.9 if there will be a Qt 5.9.5 release. Qt 5.9.4 does not seem to be affected.

        Attachments

        1. aliascrash.zip
          3 kB
        2. qtbug66715.zip
          3 kB

          Issue Links

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

            Activity

              People

              Assignee:
              mitch_curtis Mitch Curtis
              Reporter:
              thohartm Thomas Hartmann
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes