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

PageIndicator with pragma ComponentBehavior: Bound causes QQmlContext: Cannot set property on internal context.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8, 6.9
    • Quick: Controls 2
    • None
    • Tested using PySide6 6.8.0.2 on Windows

    Description

      With the following code

      pragma ComponentBehavior: Bound
      import QtQuick.Controls as QQC
      import QtQuick
      
      Window {
          height: 100
          visible: true
          width: 100
      
          QQC.PageIndicator {
              id: control
      
              anchors.fill: parent
              count: 3
              interactive: true
      
              delegate: Rectangle {
                  required property int index
      
                  color: index === control.currentIndex ? "red" : "grey"
                  implicitHeight: 18
                  implicitWidth: 18
                  radius: width / 2
              }
          }
      }
      

      The following warning is printed every time the page changes (e.g. by clicking on one of the circles)

      QQmlContext: Cannot set property on internal context.
      

      Removing the pragma ComponentBehavior: Bound removes the warning (but then qmllint is unhappy).

      These seems to be the same problem as https://bugreports.qt.io/browse/QTBUG-114358, but for a different control.

      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
            matsjoyce-refeyn Matthew Joyce
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes