本文整理汇总了Python中PyQt5.QtWidgets.QDial.setMaximum方法的典型用法代码示例。如果您正苦于以下问题:Python QDial.setMaximum方法的具体用法?Python QDial.setMaximum怎么用?Python QDial.setMaximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QDial
的用法示例。
在下文中一共展示了QDial.setMaximum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SlidersGroup
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setMaximum [as 别名]
class SlidersGroup(QGroupBox):
valueChanged = pyqtSignal(int)
def __init__(self, orientation, title, parent=None):
super(SlidersGroup, self).__init__(title, parent)
self.slider = QSlider(orientation)
self.slider.setFocusPolicy(Qt.StrongFocus)
self.slider.setTickPosition(QSlider.TicksBothSides)
self.slider.setTickInterval(10)
self.slider.setSingleStep(1)
self.scrollBar = QScrollBar(orientation)
self.scrollBar.setFocusPolicy(Qt.StrongFocus)
self.dial = QDial()
self.dial.setFocusPolicy(Qt.StrongFocus)
self.slider.valueChanged.connect(self.scrollBar.setValue)
self.scrollBar.valueChanged.connect(self.dial.setValue)
self.dial.valueChanged.connect(self.slider.setValue)
self.dial.valueChanged.connect(self.valueChanged)
if orientation == Qt.Horizontal:
direction = QBoxLayout.TopToBottom
else:
direction = QBoxLayout.LeftToRight
slidersLayout = QBoxLayout(direction)
slidersLayout.addWidget(self.slider)
slidersLayout.addWidget(self.scrollBar)
slidersLayout.addWidget(self.dial)
self.setLayout(slidersLayout)
def setValue(self, value):
self.slider.setValue(value)
def setMinimum(self, value):
self.slider.setMinimum(value)
self.scrollBar.setMinimum(value)
self.dial.setMinimum(value)
def setMaximum(self, value):
self.slider.setMaximum(value)
self.scrollBar.setMaximum(value)
self.dial.setMaximum(value)
def invertAppearance(self, invert):
self.slider.setInvertedAppearance(invert)
self.scrollBar.setInvertedAppearance(invert)
self.dial.setInvertedAppearance(invert)
def invertKeyBindings(self, invert):
self.slider.setInvertedControls(invert)
self.scrollBar.setInvertedControls(invert)
self.dial.setInvertedControls(invert)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setMaximum [as 别名]
def __init__(self, parent, index=0):
QDial.__init__(self, parent)
self.fMinimum = 0.0
self.fMaximum = 1.0
self.fRealValue = 0.0
self.fIsHovered = False
self.fHoverStep = self.HOVER_MIN
self.fIndex = index
self.fPixmap = QPixmap(":/bitmaps/dial_01d.png")
self.fPixmapNum = "01"
if self.fPixmap.width() > self.fPixmap.height():
self.fPixmapOrientation = self.HORIZONTAL
else:
self.fPixmapOrientation = self.VERTICAL
self.fLabel = ""
self.fLabelPos = QPointF(0.0, 0.0)
self.fLabelFont = QFont(self.font())
self.fLabelFont.setPointSize(6)
self.fLabelWidth = 0
self.fLabelHeight = 0
if self.palette().window().color().lightness() > 100:
# Light background
c = self.palette().dark().color()
self.fLabelGradientColor1 = c
self.fLabelGradientColor2 = QColor(c.red(), c.green(), c.blue(), 0)
self.fLabelGradientColorT = [self.palette().buttonText().color(), self.palette().mid().color()]
else:
# Dark background
self.fLabelGradientColor1 = QColor(0, 0, 0, 255)
self.fLabelGradientColor2 = QColor(0, 0, 0, 0)
self.fLabelGradientColorT = [Qt.white, Qt.darkGray]
self.fLabelGradient = QLinearGradient(0, 0, 0, 1)
self.fLabelGradient.setColorAt(0.0, self.fLabelGradientColor1)
self.fLabelGradient.setColorAt(0.6, self.fLabelGradientColor1)
self.fLabelGradient.setColorAt(1.0, self.fLabelGradientColor2)
self.fLabelGradientRect = QRectF(0.0, 0.0, 0.0, 0.0)
self.fCustomPaintMode = self.CUSTOM_PAINT_MODE_NULL
self.fCustomPaintColor = QColor(0xff, 0xff, 0xff)
self.updateSizes()
# Fake internal value, 10'000 precision
QDial.setMinimum(self, 0)
QDial.setMaximum(self, 10000)
QDial.setValue(self, 0)
self.valueChanged.connect(self.slot_valueChanged)
示例3: setPrecision
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setMaximum [as 别名]
def setPrecision(self, value, isInteger):
self.fPrecision = value
self.fIsInteger = isInteger
QDial.setMaximum(self, value)