[Interest] QML / Qt Creator: Invalid property when using intermediate template

Peter Koek peter_koek at hotmail.com
Wed Aug 28 16:17:05 CEST 2013


I have the following class hierarchy:Base (Q_OBJECT) -> IntermediateTemplate -> Derived (Q_OBJECT, not templated)The base class exposes some properties that are used by derived. Both the Base and the Derived are exposed to QML, but only Derived is creatable.The template exists to reduce boilerplate code and is not marked as Q_OBJECT. As such, it does not add any type information.The Derived class is not a template as it derives from an instance of the template.
When coding QML in Qt Creator, the properties defined in the Base class are marked invalid in the editor when accessed through the Derived class. At runtime, everything runs as expected, so it seems to be just a highlighting issue. Qt Creator seems unable to cross (or skip) the template class. When removing the intermediate template for the sake of testing the highlighting, Qt Creator is able to find the properties and no longer marks them invalid.
Is there a way around this issue? If not, wouldn't it be a good idea to let Qt Creator skip templated intermediate classes, as they can't add meta information anyway? 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130828/da264783/attachment.html>


More information about the Interest mailing list