[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
After further investigation and discussion, this seems to be the problem: - focusWindow changes after the components are completed. - change of focusWindow registers a new 'window' context property. - registering a new context property, causes a re-evaluation of properties in the context. So the properties of variables are set twice, once before the focus window is set, and once afterwards. This gives problems, for example, in the Sections where the index is reset when its model is changed after the Sections component was completed, thus overriding the index property that was explicitly set by the app developer. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
^properties of variables = properties of components. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
Code to reproduce the issue without using a ListView is here: http://bazaar.launchpad.net/~tpeeters/ubuntu-ui- toolkit/qt56fixes2sections/revision/2095 ** Changed in: ubuntu-ui-toolkit (Ubuntu) Assignee: (unassigned) => Tim Peeters (tpeeters) ** Changed in: ubuntu-ui-toolkit (Ubuntu) Status: Confirmed => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
I can reproduce the issue without using a ListView. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
ListView extension is not active if someone explicitly uses ViewItems attached properties or ListItem as delegate. As your sample doesn't use either of these, it cannot be the culprit. You don't seem to use anything from UITK so the only elements are instantiated at this time are the context properties. However neither of those should have any effect on the model setup. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: ubuntu-ui-toolkit (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
** Description changed: This is the cause for the Sections index resetting after initialization, - see bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui- - toolkit/+bug/1610231 + see bug 1610231. Create the file ModelTest.qml: + import QtQuick 2.4 Item { - id: root - width: 800 - height: 600 + id: root + width: 800 + height: 600 - ListView { - model: root.model - onModelChanged: print("LV model changed to "+model[0]+" "+model[1]+" "+model[2]+" "+model[3]) - Component.onCompleted: print("ListView completed.") - } - Component.onCompleted: print("root item completed.") + ListView { + model: root.model + onModelChanged: print("LV model changed to "+model[0]+" "+model[1]+" "+model[2]+" "+model[3]) + Component.onCompleted: print("ListView completed.") + } + Component.onCompleted: print("root item completed.") - property list objectList - onObjectListChanged: print("root.objectList changed to "+objectList[0]+" "+objectList[1]+" "+objectList[2]) - property var model: objectList + property list objectList + onObjectListChanged: print("root.objectList changed to "+objectList[0]+" "+objectList[1]+" "+objectList[2]) + property var model: objectList } + And run this program modelInst.qml: - and run this program modelInst.qml: import QtQuick 2.4 import Ubuntu.Components 1.3 ModelTest { - QtObject { - objectName: "one" - id: objectOne - } - QtObject { - objectName: "two" - id: objectTwo - } - QtObject{ - objectName: "three" - id: objectThree - } + QtObject { + objectName: "one" + id: objectOne + } + QtObject { + objectName: "two" + id: objectTwo + } + QtObject{ + objectName: "three" + id: objectThree + } -objectList: [objectOne, objectTwo, objectThree] + objectList: [objectOne, objectTwo, objectThree] } + The output is as follows: - The output is as follows: - ubuntu@xenial1:~/dev/ubuntu-ui-toolkit/m/qt56fixes2sections$ qmlscene modelInst.qml + $ qmlscene modelInst.qml qml: root.objectList changed to undefined undefined undefined qml: root.objectList changed to QObject(0x118abf0, "one") undefined undefined qml: root.objectList changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") undefined qml: root.objectList changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") QObject(0x1182f80, "three") qml: LV model changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") QObject(0x1182f80, "three") undefined qml: LV model changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") QObject(0x1182f80, "three") undefined qml: root item completed. qml: ListView completed. qml: LV model changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") QObject(0x1182f80, "three") undefined qml: LV model changed to QObject(0x118abf0, "one") QObject(0x118a110, "two") QObject(0x1182f80, "three") undefined - so the model ic changed AFTER the ListView and root item are completed. + So the model is changed AFTER the ListView and root item are completed. - When the Ubuntu.Components import is removed, the output is correct, like this: - ubuntu@xenial1:~/dev/ubuntu-ui-toolkit/m/qt56fixes2sections$ qmlscene modelInst.qml + When the Ubuntu.Components import is removed the output is correct: + + $ qmlscene modelInst.qml qml: root.objectList changed to undefined undefined undefined qml: root.objectList changed to QObject(0x171c8d0, "one") undefined undefined qml: root.objectList changed to QObject(0x171c8d0, "one") QObject(0x171d290, "two") undefined qml: root.objectList changed to QObject(0x171c8d0, "one") QObject(0x171d290, "two") QObject(0x171d420, "three") qml: LV model changed to QObject(0x171c8d0, "one") QObject(0x171d290, "two") QObject(0x171d420, "three") undefined qml: LV model changed to QObject(0x171c8d0, "one") QObject(0x171d290, "two") QObject(0x171d420, "three") undefined qml: root item completed. qml: ListView completed. - - Also, if there is no ListView inside ModelTest.qml, then nothing is updated after the items are completed. So I suspect the issue is in our ListView extension. + Also, if there is no ListView inside ModelTest.qml, then nothing is + updated after the items are completed. So I suspect the issue is in our + ListView extension. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/lis
[Bug 1621509] Re: ListView with extension from UbuntuToolkit updates its model after the component is completed
I checked and no ListViewProxy is created. So something else causes this when importing Ubuntu.Components (1.0/1.1/1.2/1.3). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621509 Title: ListView with extension from UbuntuToolkit updates its model after the component is completed To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1621509/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs