[PyQt] qmlRegisterType limited to 20 Classes?

raskolnikov at es.gnu.org raskolnikov at es.gnu.org
Tue Nov 12 11:36:21 GMT 2013


> While being glad of having the possibility to use qmlRegisterType,
> I now ran into the following lines of "hard limitation". Since I found
> it nowhere in the documentation that there is any maximum amount of
> classes available to the C interface, I'm now kind of stuck in the
> middle of translating our laboratory framework to a qml-based gui.
>
> qpy/QtQml/qpyqml_register_type.cpp:
> "a maximum of %d types may be registered with QML", NrOfTypes);
> qpy/QtQml/qpyqml_register_singleton_type.cpp:
> "a maximum of %d singleton types may be registered with QML",
> qpy/QtQuick/qpyquickitem.cpp:
> "a maximum of %d QQuickItem types may be registered with QML",
> qpy/QtQuick/qpyquickpainteditem.cpp:
> "a maximum of %d QQuickPaintedItem types may be registered with QML",
>
> Is there going to be dynamic allocation to solve this problem?

I just stepped on this recently and I figured out that it is actually
PyQt's limitation. I guess the solution is not trivial, since Qt's
registers types via a template, so there must be a predefined number of
precompiled slots.  I also think 20 types is too limited, and while in my
code I could work around this, it would be nice to at least increase this
number at configure/compile time.

JP




More information about the PyQt mailing list