mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-08-13 05:30:30 +02:00
refactor: DoubleValidationDelegate moved to qt_utils
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
from .crosshair import Crosshair
|
||||
from .colors import Colors
|
||||
from .validator_delegate import DoubleValidationDelegate
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user