def connect_float_edit(client, prop, widget):
    v = QtGui.QDoubleValidator(None)
    v.setDecimals(4)
    widget.setValidator(v)

    def update_prop():
        val = widget.text()
        try:
            setattr(client, prop, float(val))
        except ValueError:
            setattr(client, prop, 0)

    def update_widget(val):
        if val is None:
            val = 0.
        widget.setText(pretty_number(val))

    add_callback(client, prop, update_widget)
    widget.editingFinished.connect(update_prop)
    update_widget(getattr(client, prop))
Handles the user changing the contents of the font text control.
dataset/ETHPy150Open glue-viz/glue/glue/utils/qt/widget_properties.py/connect_float_edit--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/font_editor.py/CustomFontEditor.update_object