add newItem function to interface with QML

In order to make sure QML can properly interact with Rust I'll use a
function in the proxy model to interact with the actual model
underneath in Rust.
This commit is contained in:
Chris Cochrun 2023-04-12 19:00:31 -05:00
parent b2a87b76b6
commit 85285b7d02
3 changed files with 7 additions and 1 deletions

View file

@ -299,7 +299,7 @@ Item {
}
function addImg(url) {
imageProxyModel.imageModel.newItem(url);
imageProxyModel.newItem(url);
selectedLibrary = "image";
imageLibrary.libraryList.currentIndex = imageProxyModel.imageModel.count();
console.log(imageProxyModel.getImage(imageLibrary.libraryList.currentIndex));