本文整理汇总了Python中PyQt5.QtWidgets.QDial.setNotchesVisible方法的典型用法代码示例。如果您正苦于以下问题:Python QDial.setNotchesVisible方法的具体用法?Python QDial.setNotchesVisible怎么用?Python QDial.setNotchesVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QDial
的用法示例。
在下文中一共展示了QDial.setNotchesVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEditor
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setNotchesVisible [as 别名]
def createEditor(self, parent, option, index):
editor = QDial(parent=parent)
editor.setRange(-5, 5)
editor.setNotchesVisible(True)
editor.setAutoFillBackground(True)
return editor
开发者ID:jeremiedecock,项目名称:snippets,代码行数:9,代码来源:widget_QTableView_delegate_on_edit_using_dial_widget.py
示例2: createBottomRightGroupBox
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setNotchesVisible [as 别名]
def createBottomRightGroupBox(self):
self.bottomRightGroupBox = QGroupBox("Group 3")
self.bottomRightGroupBox.setCheckable(True)
self.bottomRightGroupBox.setChecked(True)
lineEdit = QLineEdit('s3cRe7')
lineEdit.setEchoMode(QLineEdit.Password)
spinBox = QSpinBox(self.bottomRightGroupBox)
spinBox.setValue(50)
dateTimeEdit = QDateTimeEdit(self.bottomRightGroupBox)
dateTimeEdit.setDateTime(QDateTime.currentDateTime())
slider = QSlider(Qt.Horizontal, self.bottomRightGroupBox)
slider.setValue(40)
scrollBar = QScrollBar(Qt.Horizontal, self.bottomRightGroupBox)
scrollBar.setValue(60)
dial = QDial(self.bottomRightGroupBox)
dial.setValue(30)
dial.setNotchesVisible(True)
layout = QGridLayout()
layout.addWidget(lineEdit, 0, 0, 1, 2)
layout.addWidget(spinBox, 1, 0, 1, 2)
layout.addWidget(dateTimeEdit, 2, 0, 1, 2)
layout.addWidget(slider, 3, 0)
layout.addWidget(scrollBar, 4, 0)
layout.addWidget(dial, 3, 1, 2, 1)
layout.setRowStretch(5, 1)
self.bottomRightGroupBox.setLayout(layout)
示例3: printValue
# 需要导入模块: from PyQt5.QtWidgets import QDial [as 别名]
# 或者: from PyQt5.QtWidgets.QDial import setNotchesVisible [as 别名]
from PyQt5.QtWidgets import QApplication, QDial
def printValue(value):
print(value, dial.value())
app = QApplication(sys.argv)
dial = QDial()
#dial.setMinimum(-15)
#dial.setMaximum(15)
dial.setRange(-15, 15)
dial.setNotchesVisible(True)
dial.setValue(5) # Initial value
dial.valueChanged.connect(printValue)
dial.show()
# The mainloop of the application. The event handling starts from this point.
# The exec_() method has an underscore. It is because the exec is a Python keyword. And thus, exec_() was used instead.
exit_code = app.exec_()
# The sys.exit() method ensures a clean exit.
# The environment will be informed, how the application ended.
sys.exit(exit_code)