Source code for rqt_ez_publisher.widget.string_value_widget

from python_qt_binding import QtWidgets
import value_widget


[docs]class StringValueWidget(value_widget.ValueWidget): def __init__(self, topic_name, attributes, array_index, publisher, parent): self._type = str super(StringValueWidget, self).__init__( topic_name, attributes, array_index, publisher, parent)
[docs] def input_text(self): self.publish_value(str(self._line_edit.text()))
[docs] def setup_ui(self, name): self._line_edit = QtWidgets.QLineEdit() self._line_edit.returnPressed.connect(self.input_text) self._horizontal_layout.addWidget(self._line_edit) self.setLayout(self._horizontal_layout)