def __init__(self, value, parent=None): FormWidget.__init__(self, parent) widget = QtGui.QDoubleSpinBox(self) widget.setValue(value) self.setWidget(widget) widget.setMinimumWidth(100) self._widget.setFocusPolicy(QtCore.Qt.NoFocus)
def __init__(self, node, parent): QtGui.QWidget.__init__(self, parent) l = QtGui.QHBoxLayout(self) for load in node.system.load: box = QtGui.QDoubleSpinBox(parent) box.setValue(load / 100.0) if box.value() > node.system.physicalCores + (node.system.logicalCores * .2): box.setStyleSheet("background-color: rgba(177, 24, 0, 192)") box.setReadOnly(True) box.setButtonSymbols(QtGui.QAbstractSpinBox.NoButtons) box.setFocusPolicy(QtCore.Qt.NoFocus) l.addWidget(box)