I am re-writing my Qt/QML mobile app to enable more control and easier workflow.

I have a main.cpp file and two supporting CPP files. I also have a main.qml and 'many' supporting QML files which are my 'pages' that get loaded into the main.qml window.

Originally, I had all my javascript functions and QML pages defined in main.qml. Now I am separating it all out into individual files. Each QML page uses common javascript functions, so I moved all my javascript to a functions.js file. Now each QML imports the functions.js file like this: 'import "functions.js" as Funcs'...no problem, that all works OK.

My issue is that I need to call a couple of javascript functions from my CPP files.

Originally, I could access those via the QQmlApplicationEngine object, which I instantiated with the main.qml file.

But with all the functions moved to a separate JS file...how can I go about calling them from my CPP files?