Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
6.0
-
None
Description
- Static properties and functions can be implicitly shared and their common binding expression will be evaluated only once.
- Inherited properties should be allowed to be made static and implicitly shared as well. This provides benefits that the current singleton pattern does not.
- Static functions can be offloaded in a JS library or another QML object. However by using static functions code homogeneity is increased by keeping related code in the same place.
Possible Syntax
component MySprite: Image{ required x required y static height: 100 static width: 100 static function doCollide( s1:MySprite, s2:MySprite) { return Math.abs(s1.x-s2.x)<MySprite.width && Math.abs(s1.y-s2.y)<MySprite.height; } }