Yes.
In every loop iteration.
You can basically keep your code, but instead of calling addEvent() on a different model you just call addEvent() of the current object.
When you create an object, the constructor for that class is called.
Once the object is created, calls to virtual functions always end up in the most specific subclass.
E.g. if you overwrite roleNames() a call to roleNames() will end up calling your implementation.
For what purpose?
I can see a use case of re-running the query on demand, but dbConnect?
dbConnect() is really internal, no? It has to be called before database access happens, so the class itself should know when to call it.
That is unnecessary.
Q_INVOKABLE methods and slots are already accessible as functions on an object set as a context property.
Registration of a type is only necessary if instances of that type need to be created from QML or if it has enum definitions where the QML code should be able to use the names.
You don't have to change anything in your code.
Cheers,
_
Bookmarks