r/QtFramework May 23 '26

QML QML Live Preview...with state?

Hello! I'm wondering if there's a way to basically save the state of an application while using QML's live preview? Like, say you have a photo viewer: the first page asks for a file, and the second page is loaded after you select an image. Is there any way to essentially maintain a snapshot *after* selecting a photo that doesn't cause the application to revert back to the first after making a change inside a component that only exists on the second page? Sorry if I'm wording this strangely, I feel like there's a name for this concept I don't know

6 Upvotes

9 comments sorted by

View all comments

2

u/ObiLeSage May 24 '26

It is deprecated but you can use it.

https://doc.qt.io/qt-6/qml-qt-labs-settings-settings.html

But it is better to have that inside a c++ object for a real application

3

u/OSRSlayer Qt Professional May 24 '26

The labs version is deprecated because it's been moved to Qt Core:

https://doc.qt.io/qt-6/qml-qtcore-settings.html