Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
Description
As a QML component developper, I often need private properties, that are needed for my component to work, but that should not be eexposed to the component user.
For example :
import Qt 4.7 TextInput { signal endEditing(bool changed) property string oldText //I'd like to make this private /* // Workaround QtObject { id: privateVars property string oldText } */ onFocusChanged: { if (focus) { oldText = text; } else { if (text != oldText) endEditing(true); else endEditing(false); } } }
So I'd suggest that it would be helpful if we had a way to mark a property as private.
I discussed about that on #qt-qml and Michael Brasser suggested:
we've also discussed this in the past in the Brisbane office; one unresolved question has been what exactly private should mean – obviously it means inaccessible to users of the component, but what about sub-components of the component, etc? If there isn't already something in JIRA for it, I'd suggest adding it, and we can look into more for a future release. Your workaround is exactly what we suggest at the moment
Attachments
Issue Links
- duplicates
-
QTBUG-67166 QML access modifiers for properties: private with "_" underscore character
- Closed