[Development] QQmlListProperty<T>: static_assert that T inherits QObject
milian.wolff at kdab.com
Fri Jan 27 16:54:54 CET 2017
On Friday, January 27, 2017 4:49:15 PM CET Simon Hausmann wrote:
> Regarding the question about why the engine itself uses
> QQmlListProperty<void> internally when populating list properties during
instantiation, I think you've already found the answer yourself: Because of
interface types :)
I.e. we need to keep it that way - ok.
> I think it would be great if incorrectly used types could be reported to the
> developer as early as possible, but at the same time the ability to things
> like forward-declaring "Foo" used by "Q_PROPERTY(QQmlListProperty<Foo> ...)"
> is likely a feature used by many people when designing class interfaces. So
> I'm not sure it's a good idea to suddenly break their build when upgrading
> to a new version of Qt.
Has anyone an idea how to fix that in a different way then?
It's a pity imo, if we decide that forward declaring is more important than
enforcing the correct type hierarchy.
Milian Wolff | milian.wolff at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
KDAB - The Qt Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5903 bytes
Desc: not available
More information about the Development