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

Assert on setting binding to alias property

    XMLWordPrintable

Details

    • c550b71fb93279a1788aec809c874b779d88b987 (qt/qtdeclarative/5.15)

    Description

      The following code would crash on windows platform, but it seems fine on mac.

      It would result in error:

       

      ASSERT: "propertyData && !propertyData->isAlias()" in file qml\qqmlproperty.cpp, line 868

       

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          id: _window
          property string userFontFamily: "Times New Roman"
      
          Column {
              Button {
                  id: _button
                  text: "CLICK ME"
                  onClicked: {
                      _box.font.family = Qt.binding(function() { return _window.userFontFamily; });
                  }
              }
      
              Rectangle {
                  id: _box
                  width: 100
                  height: 100
                  property alias font: _text.font
      
                  Text {
                      id: _text
                      anchors.fill: parent
                      text: "Text"
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            steve.k.chiu Steve K. Chiu
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes