The problem now is that I don't know how I can use qml live preview? I saw a video: https://vimeo.com/145921618
I saw this post about erase this function for Qt Creator. How i can implementlive coding into my app?
Perhaps you mean Terrarium?
Terrarium is a cross platform QML Playground: the view renders lively as you type in the editor, makes prototyping and experimenting with QtQuick a lot more fun!
It monitors changes in its TextEdit, and triggers the view to reload source from the local http server. If you're looking for a file system watcher implementation, please refer to QML LiveReload.
Or LiveReload?
As is evident from the video, this is as simple as auto reloading a QML file each time a chance to the file has been saved.
You can easily do that yourself, set up a QFileSystemWatcher
and every time the file is modified, load the file in a QML view. And there you have it.
Of course, this is only good for previewing standalone components which can work on their own. You could go further, set the file system watcher to monitor the entire QML project and reload the main QML file every time something changes. It is a two step process, you need to monitor the directory, which only reflects adding or removing of files, and you subsequently add or remove those files from watching for changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With