def __init__(self, parent=None, name='', label='', text='', ext="*"): super(NodeLineEdit, self).__init__(parent, name, label) self._ledit = QtWidgets.QLineEdit() self._ledit.setStyleSheet(STYLE_QLINEEDIT) self._ledit.setAlignment(QtCore.Qt.AlignCenter) self._ledit.editingFinished.connect(self._value_changed) self._ledit.clearFocus() _button = QtWidgets.QPushButton() _button.setStyleSheet(STYLE_QPUSHBUTTON) _button.setIcon(self.get_icon(21)) widget = QtWidgets.QWidget() hbox = QtWidgets.QHBoxLayout() hbox.addWidget(self._ledit) hbox.addWidget(_button) widget.setLayout(hbox) widget.setStyleSheet(STYLE_QWIDGET) group = _NodeGroupBox(label) group.add_node_widget(widget) self.text = text _button.clicked.connect(self._on_select_file) self.setWidget(group) self._ext = ext
def __init__(self, parent=None, node=None): super(NodePropWidget, self).__init__(parent) self.__node_id = node.id self.__tab_windows = {} self.__tab = QtWidgets.QTabWidget() close_btn = QtWidgets.QPushButton('X') close_btn.setToolTip('close property') close_btn.clicked.connect(self._on_close) self.name_wgt = PropLineEdit() self.name_wgt.setToolTip('name') self.name_wgt.set_value(node.name()) self.name_wgt.value_changed.connect(self._on_property_changed) self.type_wgt = QtWidgets.QLabel(node.type_) self.type_wgt.setAlignment(QtCore.Qt.AlignRight) self.type_wgt.setToolTip('type_') font = self.type_wgt.font() font.setPointSize(10) self.type_wgt.setFont(font) name_layout = QtWidgets.QHBoxLayout() name_layout.setContentsMargins(0, 0, 0, 0) name_layout.addWidget(QtWidgets.QLabel('name')) name_layout.addWidget(self.name_wgt) name_layout.addWidget(close_btn) layout = QtWidgets.QVBoxLayout(self) layout.setSpacing(4) layout.addLayout(name_layout) layout.addWidget(self.__tab) layout.addWidget(self.type_wgt) self._read_node(node)
def __init__(self, parent=None, node_graph=None): super(PropertiesBinWidget, self).__init__(parent) self.setWindowTitle('Properties Bin') self._prop_list = PropertiesList() self._limit = QtWidgets.QSpinBox() self._limit.setToolTip('Set display nodes limit.') self._limit.setMaximum(10) self._limit.setMinimum(0) self._limit.setValue(5) self._limit.valueChanged.connect(self.__on_limit_changed) self.resize(400, 400) self._block_signal = False btn_clr = QtWidgets.QPushButton('clear') btn_clr.setToolTip('Clear the properties bin.') btn_clr.clicked.connect(self.clear_bin) top_layout = QtWidgets.QHBoxLayout() top_layout.addWidget(self._limit) top_layout.addStretch(1) top_layout.addWidget(btn_clr) layout = QtWidgets.QVBoxLayout(self) layout.addLayout(top_layout) layout.addWidget(self._prop_list, 1) # wire up node graph. node_graph.add_properties_bin(self) node_graph.node_double_clicked.connect(self.add_node) node_graph.property_changed.connect(self.__on_graph_property_changed)
def __init__(self, onClick, parent=None, name='', label=''): super(NodeButton, self).__init__(parent, name, label) self.btn = QtWidgets.QPushButton() self.btn.setText(name) self.btn.clicked.connect(onClick) group = _NodeGroupBox(label) group.add_node_widget(self.btn) group.setAlignment(QtCore.Qt.AlignCenter) group._layout.setAlignment(QtCore.Qt.AlignCenter) self.setWidget(group)
def __init__(self, parent=None): super(PropColorPicker, self).__init__(parent) self._color = (0, 0, 0) self._label = QtWidgets.QLabel() self._button = QtWidgets.QPushButton() self._update_color() self._button.clicked.connect(self._on_select_color) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 8, 0) layout.setSpacing(4) layout.addWidget(self._label, 0, QtCore.Qt.AlignCenter) layout.addWidget(self._button, 1, QtCore.Qt.AlignLeft)
def __init__(self, parent=None): super(PropColorPicker, self).__init__(parent) self._solid = _ColorSolid(self) self._solid.setMaximumHeight(15) self._label = QtWidgets.QLabel() self._update_label() button = QtWidgets.QPushButton('select color') button.clicked.connect(self._on_select_color) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 8, 0) layout.setSpacing(4) layout.addWidget(self._solid, 0, QtCore.Qt.AlignCenter) layout.addWidget(self._label, 0, QtCore.Qt.AlignCenter) layout.addWidget(button, 1, QtCore.Qt.AlignLeft)
def __init__(self, parent=None): super(PropFilePath, self).__init__(parent) self._ledit = QtWidgets.QLineEdit() self._ledit.setAlignment(QtCore.Qt.AlignLeft) self._ledit.editingFinished.connect(self._on_value_change) self._ledit.clearFocus() icon = self.style().standardIcon(QtWidgets.QStyle.StandardPixmap(21)) _button = QtWidgets.QPushButton() _button.setIcon(icon) hbox = QtWidgets.QHBoxLayout() hbox.addWidget(self._ledit) hbox.addWidget(_button) self.setLayout(hbox) _button.clicked.connect(self._on_select_file) self._ledit.setStyleSheet("QLineEdit{border:1px solid}") _button.setStyleSheet("QPushButton{border:1px solid}") self._ext = "*"
def __init__(self, parent=None): super(PropertiesBinWidget, self).__init__(parent) self.setWindowTitle('Properties Bin') self._prop_list = PropertiesList() self._limit = QtWidgets.QSpinBox() self._limit.setToolTip('Set node limit to display.') self._limit.setMaximum(10) self._limit.setMinimum(0) self._limit.setValue(10) self._limit.valueChanged.connect(self.__on_limit_changed) self.resize(400, 400) btn_clr = QtWidgets.QPushButton('clear') btn_clr.setToolTip('Clear the properties bin.') btn_clr.clicked.connect(self.clear_bin) top_layout = QtWidgets.QHBoxLayout() top_layout.addWidget(self._limit) top_layout.addStretch(1) top_layout.addWidget(btn_clr) layout = QtWidgets.QVBoxLayout(self) layout.addLayout(top_layout) layout.addWidget(self._prop_list, 1)