[PyQt] qmlRegisterType limited to 20 Classes?

Phil Thompson phil at riverbankcomputing.com
Wed Nov 13 20:02:22 GMT 2013


On Wed, 13 Nov 2013 18:40:53 +0100, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> On Wednesday 13 November 2013, 16:37:31 Phil Thompson wrote:
>> On Wed, 13 Nov 2013 16:35:31 +0100, Tobias Lausch
<lausch at rhrk.uni-kl.de>
>> 
>> wrote:
>> > Hi There,
>> > 
>> > approx. 50 but I would expect this limit to be breached in half a
year
>> > when nobody remembers that there has been such a limit.
>> 
>> You should get an exception when the limit is reached.
>> 
>> > Having no limit at all would be very nice.
>> 
>> ...but not possible.
> 
> Why that? Hardcoded array limits are always a bad idea. At work my
> developers 
> are forced to explain the need for such a design. 

The problem is that C++ (unlike Python) doesn't allow you to create new
classes at runtime. QML types (as they are implemented as C++ classes) must
be defined at compile time. They are mapped to Python types at runtime.

The fundamental problem is that QML is badly designed.

Phil


More information about the PyQt mailing list