本文整理匯總了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)