Quote Originally Posted by witusx93 View Post
@Wysota
I am gonna write in polish, couse it will be easier to describe problem.
Chodzi o to, że muszę muszę pracować z tym LocalStorage. Chciałbym zrobic w jednym pliku qml funkcje, a w innym wywolywac je wywolywac, np DodajDoBazy(argumenty), a w innym np onClicked: DodajDoBazy(). I nie weim jak w innym pliku odnosic sie do tych funkcji. Czy mozna zrobic to w jakis lepszy sposob? Nie wiem tez za bardzo jak uzyc localStorage w liscie? Np ze lista ma godziny 00:00 do 23:00 i w niektore godziny jest jakies zdarzenie, a w inne nie, zrobilem przycisk filtruj, zeby wyswietlalo TYLKO godziny w ktorych cos jest i nie weim za bardzo jak to zrobic na liscie, czy jest jakas opcja visible czy co.

EDIT:
OK. I want to create functions in a .qml file and use these functions in other file, e.g. AddToDB() nad in other file onClicked: AddToDB() (Now how to call this function??) Is there any other way to do this?
Second thing is that I dont really know how to use LocalStorage in ListModel. Eg. I have hours 00:00 - 23:00 and things to do on some of them. I created the button and I want it to filter ONLY the hours with things to do.
You can create a library of functions (with ".pragma library") and then import the script file whenever you want and simply call those functions from whereever you need. Regarding the list model, I have no idea how you would want to use LocalStorage there. ListModel is a crude container for simple item data, if you really have to, you can of course insert data to the model when you need it but that is it. It is much better to implement your model in C++ (e.g. using QtSql module) and then export the objects you need (the model itself and maybe a filter proxy model) to QML.