上传文件至 /
This commit is contained in:
parent
fb5f83ff7c
commit
ab5321a93c
17
widgets.py
Normal file
17
widgets.py
Normal file
@ -0,0 +1,17 @@
|
||||
'''自定义控件实现'''
|
||||
from PyQt6.QtWidgets import QSpinBox, QDoubleSpinBox
|
||||
from PyQt6.QtCore import Qt
|
||||
|
||||
class NoWheelSpinBox(QSpinBox):
|
||||
"""禁用鼠标滚轮的SpinBox"""
|
||||
def wheelEvent(self, event):
|
||||
event.ignore()
|
||||
|
||||
class NoWheelDoubleSpinBox(QDoubleSpinBox):
|
||||
"""禁用鼠标滚轮的DoubleSpinBox"""
|
||||
def wheelEvent(self, event):
|
||||
event.ignore()
|
||||
|
||||
def setDecimalsFromRules(self, decimals):
|
||||
"""根据规则设置小数位数"""
|
||||
self.setDecimals(decimals)
|
||||
Loading…
x
Reference in New Issue
Block a user