def __init__(self, sizes=None, colors=None, parent=None): QtWidgets.QDoubleSpinBox.__init__(self, parent) self.setLocale(QtCore.QLocale(QtCore.QLocale.English)) # Setting up event handling: self.lineEdit().cursorPositionChanged.connect(self.changeStep) self.lineEdit().updateWriteValue.connect(self.editReady) self.lineEdit().returnPressed.connect(self.editReady) self.setKeyboardTracking(False) self.valueChanged.connect(self.valueReady) self.editingFinished.connect(self.editReady) self.storedCursorPos = 0 self.lastKey = QtCore.Qt.Key_0 if colors is None: self.attrColors = QTangoColors() else: self.attrColors = colors if sizes is None: self.sizes = QTangoSizes() else: self.sizes = sizes s = ''.join( ('QDoubleSpinBox { \n', 'background-color: ', self.attrColors.backgroundColor, '; \n', 'selection-background-color: ', self.attrColors.secondaryColor0, '; \n', 'selection-color: ', self.attrColors.backgroundColor, '; \n', 'border-width: ', str(int(self.sizes.barHeight / 10)), 'px; \n', 'border-color: ', self.attrColors.secondaryColor0, '; \n', 'border-top-style: none; \n', 'border-bottom-style: none; \n', 'border-left-style: double; \n', 'border-right-style: solid; \n', 'border-radius: 0px; \n', 'padding: 0px; \n', 'margin: 0px; \n', 'qproperty-buttonSymbols: NoButtons; \n', 'min-width: ', str(int(self.sizes.barHeight) * 2.5), 'px; \n', 'max-width: ', str(int(self.sizes.barHeight) * 2.5), 'px; \n', 'min-height: ', str(int(self.sizes.barHeight)), 'px; \n', 'max-height: ', str(int( self.sizes.barHeight)), 'px; \n', 'qproperty-readOnly: 0; \n', 'color: ', self.attrColors.secondaryColor0, ';} \n')) font = self.font() font.setFamily(self.sizes.fontType) font.setStretch(self.sizes.fontStretch) font.setWeight(self.sizes.fontWeight) font.setPointSize(int(self.sizes.barHeight * 0.7)) font.setStyleStrategy(QtGui.QFont.PreferAntialias) self.setFont(font) self.setStyleSheet(s) self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignBottom) self.setMaximum(1e9) self.setMinimum(-1e9)
def __init__(self, sizes=None, colors=None, parent=None): QtWidgets.QWidget.__init__(self, parent) if colors is None: self.attrColors = QTangoColors() else: self.attrColors = colors if sizes is None: self.sizes = QTangoSizes() else: self.sizes = sizes self.cmdButtons = OrderedDict() self.layout = None self.setupLayout()
def __init__(self, title='', sizes=None, colors=None, parent=None): QtWidgets.QWidget.__init__(self, parent) if title is None: self.title = '' else: self.title = title if sizes is None: self.sizes = QTangoSizes() else: self.sizes = sizes if colors is None: self.attrColors = QTangoColors() else: self.attrColors = colors self.setupLayout()
def __init__(self, name, horizontal=True, sizes=None, colors=None, parent=None): QtGui.QWidget.__init__(self, parent) if colors is None: self.attrColors = QTangoColors() else: self.attrColors = colors if sizes is None: self.sizes = QTangoSizes() else: self.sizes = sizes self.layout = None self.name = name self.title_bar = None self.side_bar = None self.layout_bar = None self.layout_content = None self.setupLayout(horizontal)
def __init__(self, sizes=None, colors=None, parent=None): QtWidgets.QLabel.__init__(self, parent) if colors is None: self.attrColors = QTangoColors() else: self.attrColors = colors if sizes is None: self.sizes = QTangoSizes() else: self.sizes = sizes self.setText('') st = ''.join(('QLabel {min-height: ', str(self.sizes.barHeight / 2), 'px; \n', 'max-height: ', str(int(self.sizes.barHeight / 2)), 'px; \n', 'min-width: ', str(int(self.sizes.barHeight / 2)), 'px; \n', 'max-width: ', str(int(self.sizes.barHeight / 2)), 'px; \n', 'border-width: 1px; \n', 'border-color: ', self.attrColors.secondaryColor0, '; \n', 'border-style: solid; \n', 'border-radius: 0px; \n', 'padding: 0px; \n', 'margin: 0px; \n', 'background-color: ', self.attrColors.backgroundColor, ';}')) self.setStyleSheet(st)