OpenTails / CRUMPET-Android

The Brains For Your Tail Company Gear!
GNU General Public License v3.0
31 stars 7 forks source link

Register objects with `qmlRegisterType<>()` #37

Closed ildar-gilmanov closed 5 years ago

ildar-gilmanov commented 5 years ago

We should register objects to QML by using qmlRegisterType<>() method and send C++ classes to QML instead of QObject*. It will give us tips from QtCreator when we work with QML code.

For example, use this

Q_PROPERTY(BTDeviceModel* deviceModel READ deviceModel NOTIFY deviceModelChanged)

instead of this:

Q_PROPERTY(QObject* deviceModel READ deviceModel NOTIFY deviceModelChanged)
leinir commented 5 years ago

Those are effectively leftovers from before the service split - none of this works in QML anyway due to RemoteObjects, as the only things available there are the ones found in the replicant version of each class. So, i'm going to interpret this bug as "remove the left over Q_PROPERTY statements" because, well, we just don't (and can't) use them anyway ;)