You need to expose a QObject to QML context. Then you can run any method marked as Q_INVOKABLE and modify any Q_PROPERTYies that it has.

Another option is to inherit from QQuickItem (QDeclarativeItem in your case) and expose methods there (same story: Q_INOVKABLE, QPROPERTY).

Check out my CCF project - it's probably to complicated as an example, but there you go. qmlRegisterType lines register custom kids of QQuickItem, while lines 69-73 register standard QObjects. You can find base classes for those objects in "the repo":https://github.com/sierdzio/closecombatfree/tree/master/src.