In the "custom" branch implementation I've stayed away from using the "__" prefix altogether, mainly because QML fails to automatically create the "Changed" signals for these properties. I.e. if a property is defined like this
property bool __myPrivateProperty this won't work on__myPrivatePropertyChanged: print("it changed!") nor will this: __onMyPrivatePropertyChanged: print("it changed!") I'm not sure I like the __ convention, but it's probably just because I'm not a JS developer and haven't got used to seeing it. Anyway, just created http://bugreports.qt.nokia.com/browse/QTBUG-17950 Grouped properties could perhaps be used for private and platform specific properties, but the necessary support is lacking, see http://bugreports.qt.nokia.com/browse/QTBUG-15269 Cheers Mathias ------------------------------------------------------------ Mathias Malmqvist UX Prototype Lead 10 Great Pulteney Street, London, W1F 9NB, UK Got no reply? Try giving me a call: Mobile: +44 (0)77 6522 2738 http://www.nokia.com ________________________________________ From: qt-components-bounces+mathias.malmqvist=nokia....@qt.nokia.com [qt-components-bounces+mathias.malmqvist=nokia....@qt.nokia.com] on behalf of ext henrik.ha...@nokia.com [henrik.ha...@nokia.com] Sent: Thursday, March 03, 2011 3:43 PM To: qt-components@qt.nokia.com Subject: [Qt-components] Platform-specific properties in a cross-platform world Hi, After some internal discussions, we're wondering the best approach for making a cross-platform API for Qt Quick components. A bit of background; currently, we have a common API that we use an apichecker test to verify conformance - and we're quite OK there. However, there are a few properties and features that are platform specific - for instance 'focusable' on MeeGo's ImplicitSizeItem, needed for some specific item interaction features, or Symbian having 'title' in it's Page. The convention we have used so far is; * '__' is private and should not be used. Best approach is to have a QtObject {id:property} with properties for hiding private properties * '_' is platform specific, and should be used with care.. however, neither of these illustrate which platform you are locking yourself to - and it does not allow encapsulating the platform specific property for e.g. Symbian. Question to the list; are there better techniques for exposing properties to a common element from a specific implementation - and be able to use such properties in the implementation effectively? Can attached properties be used for this without breaking the ability to deploy the App to a different platform that doesn't have this property? Others, please pipe up if I forgot some details about our discussion. Cheers, Henrik _______________________________________________ Qt-components mailing list Qt-components@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-components _______________________________________________ Qt-components mailing list Qt-components@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-components