本文整理匯總了Python中PyQt5.QtWidgets.QDial.show方法的典型用法代碼示例。如果您正苦於以下問題:Python QDial.show方法的具體用法?Python QDial.show怎麽用?Python QDial.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtWidgets.QDial
的用法示例。
在下文中一共展示了QDial.show方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: printValue
# 需要導入模塊: from PyQt5.QtWidgets import QDial [as 別名]
# 或者: from PyQt5.QtWidgets.QDial import show [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)