[Development] Re: Controlling QML Imports

Jan Kundrát jkt at flaska.net
Thu Dec 13 09:00:54 CET 2012


On Wednesday, 12 December 2012 19:27:17 CEST, Alan Alpert wrote:
> This doesn't completely fix the problem, because if the wrong thing is
> instantiated it will still be able to do things in the period while
> and just after it is instantiated. For example there could be side
> effects from them instantiating a different type which you exposed,
> and they could still do stuff in the Component.onCompleted handler.

You're right.

> Actually this isn't enforcing the type of the children. That property
> has its type enforced, but properties can be dynamically added in QML.

I haven't realized that, thanks for pointing it out.

In short, what I really wanted to find was an ability to make sure that just a aprticular module can be imported.

> Property validation within an item will always have to be done by the
> item, so that's the best we'd be able to do.

Still, there's no way to throw a fatal error from the context of the item. I don't know if the QML can possibly handle this, but it's a feature I was looking for.

With kind regards,
Jan

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/



More information about the Development mailing list