[SailfishDevel] Sharing model between pages ("by reference")

Dirk Zimmermann me+sailfishos at dirkz.com
Sun Feb 1 09:57:59 UTC 2015


I have a page with an attached page. Currently, they get pushed on the
stack by a parent page like this:

pageStack.push(Qt.resolvedUrl("Page1.qml"), lightModel)
pageStack.pushAttached(Qt.resolvedUrl("Page2.qml"), lightModel)

Page1.qml will then refresh its copy with live data. I would rather
Page2.qml not have to refresh its copy the same way. Instead, they would
ideally share the same object, and changes to it would be instantly
visible when switching between the two pages.

Is that possible?


More information about the Devel mailing list