- All Implemented Interfaces:
QtObjectInterface
- Enclosing class:
QObject
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor
-
Constructor Summary
ConstructorDescriptionConstructs achar
-typed property.QCharProperty
(char initialValue) Constructs achar
-typed property with the provided initialValue.QCharProperty
(QtUtilities.CharSupplier functor) Constructs achar
-typed property bound to the providedfunctor
.QCharProperty
(QCharPropertyBinding binding) Constructs achar
-typed property with the provided binding.Constructs achar
-typed property with the provided binding. -
Method Summary
Modifier and TypeMethodDescriptionfinal QPropertyNotifier
Registers the given functor f as a callback that shall be called whenever the value of the bindable changes.final QCharPropertyBinding
binding()
Returns the binding expression that is associated with this property.final boolean
Checks if the property has a binding.final void
Programmatically signals a change of the property.final QPropertyChangeHandler
Registers the given functor f as a callback that shall be called whenever the value of the property changes.final QCharPropertyBinding
setBinding
(QtUtilities.CharSupplier functor) Associates the value of this property with the providedfunctor
and returns the previously associated binding.final QCharPropertyBinding
setBinding
(QCharPropertyBinding newBinding) Associates the value of this property with the providednewBinding
expression and returns the previously associated binding.final QCharPropertyBinding
setBinding
(QPropertyBinding<@QtPrimitiveType Character> newBinding) Associates the value of this property with the providednewBinding
expression and returns the previously associated binding.final boolean
setBinding
(QUntypedPropertyBinding newBinding) Associates the value of this property with the providednewBinding
expression.final void
setValue
(char newValue) Assigns newValue to this property and removes the property's associated binding, if present.final QPropertyChangeHandler
Subscribes the given functor f as a callback that is called immediately and whenever the value of the property changes in the future.final QCharPropertyBinding
Disassociates the binding expression from this property and returns it.final char
value()
Returns the value of the property.Methods inherited from class io.qt.core.QCharPropertyData
getValueBypassingBindings, setValueBypassingBindings
Methods inherited from class io.qt.QtObject
dispose, equals, isDisposed
-
Constructor Details
-
QCharProperty
public QCharProperty()Constructs achar
-typed property. -
QCharProperty
public QCharProperty(char initialValue) Constructs achar
-typed property with the provided initialValue.- Parameters:
initialValue
-
-
QCharProperty
Constructs achar
-typed property with the provided binding.- Parameters:
binding
-
-
QCharProperty
Constructs achar
-typed property with the provided binding.- Parameters:
binding
-
-
QCharProperty
Constructs a
char
-typed property bound to the providedfunctor
.- Parameters:
functor
-
-
-
Method Details
-
value
Returns the value of the property. This may evaluate a binding expression that is tied to this property, before returning the value.- Returns:
- value
-
setValue
Assigns newValue to this property and removes the property's associated binding, if present.
- Parameters:
newValue
-
-
setBinding
Associates the value of this property with the provided
newBinding
expression and returns the previously associated binding.The first time the property value is read, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
- Parameters:
newBinding
-- Returns:
- oldBinding
-
setBinding
@QtUninvokable public final QCharPropertyBinding setBinding(QPropertyBinding<@QtPrimitiveType Character> newBinding) Associates the value of this property with the provided
newBinding
expression and returns the previously associated binding.The binding's value type (
QUntypedPropertyBinding.valueMetaType()
) has to bechar
, otherwise the property remains unchanged.The first time the property value is read, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
- Parameters:
newBinding
-- Returns:
- oldBinding
-
setBinding
Associates the value of this property with the provided
newBinding
expression.The binding's value type (
QUntypedPropertyBinding.valueMetaType()
) has to bechar
, otherwise the property remains unchanged and the method returnsfalse
.The first time the property value is read, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
Returns true if the type of this property is the same as the type the binding function returns; false otherwise.
- Parameters:
newBinding
-- Returns:
- true if types match, false otherwise.
-
setBinding
Associates the value of this property with the provided
functor
and returns the previously associated binding.The first time the property value is read, the binding is evaluated by invoking
QtUtilities.CharSupplier.getAsChar()
offunctor
. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.- Parameters:
functor
-- Returns:
- oldBinding
-
hasBinding
Checks if the property has a binding.- Returns:
- true if the property has a binding, false otherwise.
-
binding
Returns the binding expression that is associated with this property. A default constructedQCharPropertyBinding
will be returned if no such association exists.- Returns:
- binding
-
takeBinding
Disassociates the binding expression from this property and returns it.
After calling this function, the value of the property will only change if you assign a new value to it, or when a new binding is set.
- Returns:
- the removed binding
-
onValueChanged
Registers the given functor f as a callback that shall be called whenever the value of the property changes.
The returned property change handler object keeps track of the registration. As long as the change handler is alive i.e. as long as a reference to the
QPropertyChangeHandler
instance exists, the callback remains installed. When the garbage collection deletes the instance, the callback is de-registered.- Parameters:
f
-- Returns:
- property change handler
- See Also:
-
subscribe
Subscribes the given functor f as a callback that is called immediately and whenever the value of the property changes in the future.- Parameters:
f
-- Returns:
- property change handler
- See Also:
-
addNotifier
Registers the given functor f as a callback that shall be called whenever the value of the bindable changes.
The returned property notifier object keeps track of the registration. As long as the notifier is alive i.e. as long as a reference to the
QPropertyNotifier
instance exists, the callback remains installed. When the garbage collection deletes the instance, the callback is de-registered.- Parameters:
f
-- Returns:
- property notifier
- See Also:
-
notifyProperty
Programmatically signals a change of the property. Any binding which depend on it will be notified, and if the property has a signal, it will be emitted.
-