.. index:: pair: class; EE::UI::UIReadOnlyValueBinding .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding: template class EE::UI::UIReadOnlyValueBinding ============================================= .. toctree:: :hidden: struct_EE_UI_UIReadOnlyValueBinding_State.rst Overview ~~~~~~~~ Move-only one-way binding from a read-only observable to a widget property. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class UIReadOnlyValueBinding { public: // typedefs typedef :ref:`UIValueConverter` :target:`Converter`; // structs struct :ref:`State`; // construction :target:`UIReadOnlyValueBinding`(); :target:`UIReadOnlyValueBinding`(const UIReadOnlyValueBinding&); :target:`UIReadOnlyValueBinding`(UIReadOnlyValueBinding&&); template :ref:`UIReadOnlyValueBinding`(Source& source, :ref:`UIWidget`* widget, const :ref:`Converter`& converter = :ref:`Converter::converterDefault`(), const std::string& propertyName = "value"); // methods UIReadOnlyValueBinding& :target:`operator=`(const UIReadOnlyValueBinding&); UIReadOnlyValueBinding& :target:`operator=`(UIReadOnlyValueBinding&&); void :ref:`disconnect`(); :ref:`operator bool`() const; bool :ref:`isValid`() const; const :ref:`UIValueValidationState`* :ref:`validationState`() const; }; .. _details-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Move-only one-way binding from a read-only observable to a widget property. Sources must provide ValueType, get(), observe(), and an ObservableValue-compatible Connection. The binding applies the current source value immediately and retains neither endpoint. Use this for :ref:`ComputedValue ` outputs or whenever widget edits must not update the source. Construction ------------ .. index:: pair: function; UIReadOnlyValueBinding .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding_1ab5f0f30ecaabb197cf957ea0cdcb6b45: .. ref-code-block:: cpp :class: doxyrest-title-code-block template UIReadOnlyValueBinding(Source& source, :ref:`UIWidget`* widget, const :ref:`Converter`& converter = :ref:`Converter::converterDefault`(), const std::string& propertyName = "value") Starts one-way synchronization from ``source`` to a property of ``widget``. Methods ------- .. index:: pair: function; disconnect .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding_1a534f74508e39486047d316c43e06cb3f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void disconnect() Stops synchronization. Calling this repeatedly is safe. .. index:: pair: function; operator bool .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding_1aff6dfe88b41e85f38920036a45c39a72: .. ref-code-block:: cpp :class: doxyrest-title-code-block operator bool() const .. rubric:: Returns: Whether the source connection and widget endpoint remain active. .. index:: pair: function; isValid .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding_1ae755ee369e617dc178667e6e62d4a761: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isValid() const .. rubric:: Returns: Whether formatting the most recent source value succeeded. .. index:: pair: function; validationState .. _doxid-class_e_e_1_1_u_i_1_1_u_i_read_only_value_binding_1a7359273c480fe4e69bbc11c3f97007f7: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`UIValueValidationState`* validationState() const .. rubric:: Returns: Formatting validation state, or nullptr for an empty binding.