[PyQt] qmlRegisterType limited to 20 Classes?

Detlev Offenbach detlev at die-offenbachs.de
Thu Nov 14 17:53:38 GMT 2013



On Wednesday 13 November 2013, 20:02:22 Phil Thompson wrote:
> 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.
> 

Thanks for this explanation. It is a valid reason for having a fixed limit. I 
would accept it even from my developers ;-)

Detlev


More information about the PyQt mailing list