- binding inheritance (you write some custom bindings that you use on different C++ classes not necessarily with a same base).
The last point lets you insert custom code that will be used instead of the method call. You still have automated type checking and exception protection but you can use things like multiple return values or simply create bindings for methods that do not exist in the C++ class:
This one returns two values:
globalPosition: |
QPoint pt = self->mapToGlobal(QPoint(0, 0));
lua_pushnumber(L, pt.x());
lua_pushnumber(L, pt.y());
return 2;
This is a method that does not exist in Qt:
globalMove: |
self->move(
self->mapToParent(
self->mapFromGlobal(QPoint(x, y))
)
);