How to use on_attribute_changed method in autotest

Best Python code snippet using autotest_python

editor_widgets.py

Source:editor_widgets.py Github

copy

Full Screen

...681 def set_value(self, value):682 self.set_valid()683 self.inputWidget.set_value(value)684 @gui.decorate_event685 def on_attribute_changed(self, widget, value):686 self.set_valid()...

Full Screen

Full Screen

wiParamsWidget.py

Source:wiParamsWidget.py Github

copy

Full Screen

...341 self.removeAttribute.style['display'] = 'none'342343 def on_attribute_remove(self, widget):344 self.inputWidget.set_value(self._param._defaultValue)345 self.on_attribute_changed(widget, self._param._defaultValue)346347 def set_value(self, value):348 self.set_valid()349 self.inputWidget.set_value(value)350351 def on_attribute_changed(self, widget, value):352 self.set_valid()353 354 # stupid patch for bool355 attributeType = self._param._type356 if attributeType == bool or attributeType == 'bool':357 if value == 'true':358 value =True359 if value == 'false':360 value =False361 362 return self.eventManager.propagate(self.EVENT_ATTRIB_ONCHANGE, ("", self.attributeName, value))363364 def set_on_attribute_change_listener(self, callback, *userdata):365 self.eventManager.register_listener( ...

Full Screen

Full Screen

param_minmax_setup_window.py

Source:param_minmax_setup_window.py Github

copy

Full Screen

...142 index = item.data(QtCore.Qt.UserRole)143 resulting_indices.append(index)144 return resulting_indices145 def on_add_button_pressed(self):146 self.on_attribute_changed()147 new_object = AttributeMinMax()148 new_object.name = '<unnamed attribute>'149 self.event_handler.attribute_min_max_values.append(new_object)150 self.init_table()151 self.table.selectRow(len(self.event_handler.attribute_min_max_values) - 1)152 self.attribute_name_line_edit.setFocus()153 self.attribute_name_line_edit.selectAll()154 def on_table_selection_changed(self):155 # Block signals, so we don't trigger OnAttributeChanged caused by the setValue calls on the widgets.156 self.attribute_name_line_edit.blockSignals(True)157 self.min_value_widget.blockSignals(True)158 self.max_value_widget.blockSignals(True)159 # Update widget values.160 selected_items = self.table.selectedItems()161 if len(selected_items) == 0:162 self.attribute_name_line_edit.setText('')163 self.min_value_widget.setValue(0.0)164 self.max_value_widget.setValue(1.0)165 self.attribute_name_line_edit.setEnabled(False)166 self.min_value_widget.setEnabled(False)167 self.max_value_widget.setEnabled(False)168 else:169 selected_attributes = self.get_selected_attribute_indices()170 attribute = self.event_handler.attribute_min_max_values[selected_attributes[-1]]171 self.attribute_name_line_edit.setText(attribute.name)172 self.min_value_widget.setValue(attribute.min_value)173 self.max_value_widget.setValue(attribute.max_value)174 self.attribute_name_line_edit.setEnabled(True)175 self.min_value_widget.setEnabled(True)176 self.max_value_widget.setEnabled(True)177 # Unblock signals.178 self.attribute_name_line_edit.blockSignals(False)179 self.min_value_widget.blockSignals(False)180 self.max_value_widget.blockSignals(False)181 def on_attribute_changed(self):182 selected_items = self.table.selectedItems()183 if len(selected_items) == 0:184 return185 attribute_indices = self.get_selected_attribute_indices()186 if len(attribute_indices) == 1:187 attribute = self.event_handler.attribute_min_max_values[attribute_indices[0]]188 attribute.name = self.attribute_name_line_edit.text()189 for index in attribute_indices:190 attribute = self.event_handler.attribute_min_max_values[index]191 attribute.min_value = self.min_value_widget.value()192 attribute.max_value = self.max_value_widget.value()193 self.event_handler.save_attribute_min_max_setup_to_file(self.event_handler.min_max_settings_file)194 self.init_table()195 # Remove a given list of attributes, where the remove list is a list of indices....

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful