def _update_colors(self): """ Updates selected items background colors. This is done from the app to only list selected items once. """ # Get selected handles selected_sols = list(Method.get_selected_handles()) # Switches background colors for widget in self._get_sol_widgets(): widget.update_selected_status(selected_sols)
def keyPressEvent(self, e): """ Allows to look for an item by pressing F. :param e: QtCore.QEvent. """ # Get selected handles selected_sols = list(Method.get_selected_handles()) # If user pressed F and handles are selected : scroll to the first item if e.key() == 70 and selected_sols: for widget in self._get_sol_widgets(): if widget.node_master in selected_sols: self.scroll_area.ensureWidgetVisible(widget) break