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

When a base class and sub class both declare attached QML properties, only the base class is used in QML

    XMLWordPrintable

Details

    Description

      1. Cherry-pick https://codereview.qt-project.org/c/qt/qtdeclarative/+/284119
      2. Build qtdeclarative
      3. Run tests/auto/quick/qquicklayouts/tst_qquicklayouts -input /path/to/qt5/sources/qtdeclarative/tests/auto/quick/qquicklayouts/data/tst_stacklayout.qml

      You will get output like this:

      ********* Start testing of qquicklayouts *********
      Config: Using QtTest library 6.0.0, Qt 6.0.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 7.4.0)
      PASS   : qquicklayouts::Tests_StackLayout::initTestCase()
      FAIL!  : qquicklayouts::Tests_StackLayout::test_attachedIndex() Compared values are not the same
         Actual   (): undefined
         Expected (): 0
         Loc: [/home/mitch/dev/qt5.15/qtdeclarative/tests/auto/quick/qquicklayouts/data/tst_stacklayout.qml(131)]
      PASS   : qquicklayouts::Tests_StackLayout::test_rearrange()
      PASS   : qquicklayouts::Tests_StackLayout::cleanupTestCase()
      Totals: 3 passed, 1 failed, 0 skipped, 0 blacklisted, 26ms
      ********* Finished testing of qquicklayouts *********
      

      If you then add a print(item1.StackLayout) before that failure, you'll see this:

      qml: QQuickLayoutAttached(0x60d00003aec0)
      

      It should print QQuickStackLayoutAttached.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes