View Single Post
Feathers McGraw's Avatar
Posts: 654 | Thanked: 2,368 times | Joined on Jul 2014 @ UK
#8
Originally Posted by Markkyboy View Post
I wouldn't recognise C++ from a kick in the balls
Doesn't your application have a main function written in C++?

or how to 'push' a file from 'home'..?, can you explain more in layman terms please...?
What I mean is that lots of applications have C++ parts and QML parts, where QML is used (mostly) for graphical stuff, and C++ is used for the backend data work.

Some of those applications have data structures and classes defined in C++ that are included in the QML file so that the objects can be initialised and used from QML.

Sometimes the objects the application needs for the backend are created when the first qml page is loaded, like in hammerhead torch, which initialises the LEDControl object in harbour-hammerhead-torch.qml, and then uses it in other pages like MainPage.qml by referring to it by its id ("led").

I don't think MainPage.qml from hammerhead torch would work if you just loaded it directly, because "led" wouldn't refer to anything. I don't know if that means it wouldn't load at all, or if the page would load with errors.

When I said push a page I was talking about the page stack ("pageStack.push"), and home was referring to /home/nemo (a convenient place to place a test qml file).
 

The Following User Says Thank You to Feathers McGraw For This Useful Post: