Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
6.7
-
None
-
6bf49d126 (dev), bd5fe124e (6.6), 38a7fc206 (6.5)
Description
This fails:
// push([component, {binding}]) - with JS variable in binding var jsVariable = false var item7 = control.push([itemComponent, {objectName: Qt.binding(() => { return jsVariable.toString() })}], StackView.Immediate) compare(item7.objectName, "false") compare(control.depth, 7) compare(control.currentItem, item7) jsVariable = true compare(item7.objectName, "true") // fails - still "false"
This doesn't fail:
import QtQuick import QtQuick.Controls ApplicationWindow { width: 400 height: 400 visible: true property bool bound Component.onCompleted: { var aFlag = false bound = Qt.binding(() => { return aFlag.toString() }) aFlag = true print(bound) }
Using a QML property instead does work:
property bool qmlProperty [...] // push([component, {binding}]) - with QML property in binding qmlProperty = false var item8 = control.push([itemComponent, {objectName: Qt.binding(() => { return testCase.qmlProperty.toString() })}], StackView.Immediate) compare(item8.objectName, "false") compare(control.depth, 8) compare(control.currentItem, item8) qmlProperty = true compare(item8.objectName, "true")
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-114959 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
488647,2 | StackView: add tests to check that Qt.binding works with push() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
489059,2 | StackView: add tests to check that Qt.binding works with push() | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
489060,2 | StackView: add tests to check that Qt.binding works with push() | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |