def __init__(self, tree, dataset, master, parent=None): QLineEdit.__init__(self, parent) Control.__init__(self, tree, dataset, master) if hasattr(tree, "regexp"): self.setValidator(QRegExpValidator(QRegExp(tree.regexp), self)) if hasattr(tree, "defaultValue"): self.setText(tree.defaultValue)
def add_datetime(contents): le = add_textual(contents) le.setValidator(QRegExpValidator(QRegExp(TimeVariable.REGEX))) return le