[PyQt] qmlRegisterType limited to 20 Classes?

Phil Thompson phil at riverbankcomputing.com
Tue Nov 12 17:27:42 GMT 2013


On Tue, 12 Nov 2013 12:36:21 +0100, raskolnikov at es.gnu.org wrote:
>> 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.

The current limits are arbitrary. What would be a sensible limit for you?

Phil


More information about the PyQt mailing list