mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-03-09 18:27:52 +01:00
11 lines
341 B
Python
11 lines
341 B
Python
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
|