36 from python_qt_binding
import loadUi
37 from python_qt_binding.QtGui
import QIcon
38 from python_qt_binding.QtWidgets
import QWidget
44 Wraps the other filter widgets to provide enable check box, delete button control and uniform 50 :param widget: the Qwidget to wrap ''Qwidget'' 51 :param filter_name: the name to be placed on the label ''str'' 53 super(FilterWrapperWidget, self).
__init__()
55 ui_file = os.path.join(
56 rp.get_path(
'rqt_console'),
'resource/filters',
'filter_wrapper_widget.ui')
58 self.setObjectName(
'FilterWrapperWidget')
59 self.delete_button.setIcon(QIcon.fromTheme(
'list-remove'))
63 stretch = self.layout_frame.stretch(2)
64 self.layout_frame.insertWidget(2, widget)
65 self.layout_frame.setStretch(2, stretch)
69 self.layout_frame.setStretch(3, 0)
72 self.filter_name_label.setText(filter_name +
':')
75 self.
_widget._parentfilter.set_enabled(checked)
76 self.
_widget.setEnabled(checked)
83 Handles writing the enabled flag to the ini file and then passes the 84 settings object to the wrapped widget 86 :param settings: used to write the settings to an ini file ''qt_gui.settings.Settings'' 88 settings.set_value(
'enabled', self.
_widget._parentfilter._enabled)
93 Handles reading the enabled flag from the ini file. 94 :param settings: used to read the settings to an ini file ''qt_gui.settings.Settings'' 96 checked = settings.value(
'enabled')
in [
True,
'true']
98 self.enabled_checkbox.setChecked(checked)