上传文件至 /

This commit is contained in:
hujinyang 2026-01-19 08:02:27 +00:00
parent fb5f83ff7c
commit ab5321a93c

17
widgets.py Normal file
View 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)