def __init__(self, parent_node: Node, flow, configuration=None): super(Button_NodeInstance, self).__init__(parent_node, flow, configuration) # self.special_actions['action name'] = self.actionmethod ... self.main_widget.clicked.connect(m(self.button_clicked)) self.initialized()
def __init__(self, parent_node: Node, flow, configuration=None): super(%NODE_TITLE%_NodeInstance, self).__init__(parent_node, flow, configuration) self.special_actions['print something 1'] = {'method': m(self.print_something), 'data': 'hello!!'} self.special_actions['print something 2'] = {'method': self.print_something, 'data': 'HELLOO!?!?!?'} self.initialized()
def __init__(self, parent_port_instance, parent_node_instance): super(ChooseFileInputWidget_PortInstanceWidget, self).__init__() # leave these lines ------------------------------ self.parent_port_instance = parent_port_instance self.parent_node_instance = parent_node_instance # ------------------------------------------------ self.file_path = '' # UI self.setLayout(QVBoxLayout()) self.path_line_edit = QLineEdit() self.path_line_edit.setPlaceholderText('file path...') self.path_line_edit.textChanged.connect(m(self.set_file_path)) self.select_file_button = QPushButton('select') self.select_file_button.clicked.connect( m(self.select_file_button_clicked)) self.layout().addWidget(self.path_line_edit) self.layout().addWidget(self.select_file_button) self.setStyleSheet(''' QWidget { background: transparent; } QLineEdit { border-radius: 10px; background-color: transparent; border: 1px solid #202020; color: #aaaaaa; padding: 3px; } QPushButton { background-color: #36383B; padding-top: 5px; padding-bottom: 5px; padding-left: 22px; padding-right: 22px; border: 1px solid #666666; border-radius: 5px; } ''') self.setFixedWidth(150)