refactor: DoubleValidationDelegate moved to qt_utils

This commit is contained in:
wyzula-jan
2023-09-06 10:37:38 +02:00
parent be1bd81d60
commit ca099eced3
3 changed files with 19 additions and 6 deletions
@@ -0,0 +1,10 @@
from PyQt5.QtGui import QDoubleValidator
from PyQt5.QtWidgets import QStyledItemDelegate, QLineEdit
class DoubleValidationDelegate(QStyledItemDelegate):
def createEditor(self, parent, option, index):
editor = QLineEdit(parent)
validator = QDoubleValidator()
editor.setValidator(validator)
return editor