func accessChanged(accessLineEdit *widgets.QLineEdit, index int) { switch index { case 0: accessLineEdit.SetReadOnly(false) case 1: accessLineEdit.SetReadOnly(true) } }
func validatorChanged(validatorLineEdit *widgets.QLineEdit, index int) { switch index { case 0: validatorLineEdit.SetValidator(nil) case 1: validatorLineEdit.SetValidator(gui.NewQIntValidator(validatorLineEdit)) case 2: validatorLineEdit.SetValidator(gui.NewQDoubleValidator(validatorLineEdit)) // TODO: Min/Max } validatorLineEdit.Clear() }
func echoChanged(echoLineEdit *widgets.QLineEdit, index int) { switch index { case 0: echoLineEdit.SetEchoMode(widgets.QLineEdit__Normal) case 1: echoLineEdit.SetEchoMode(widgets.QLineEdit__Password) case 2: echoLineEdit.SetEchoMode(widgets.QLineEdit__PasswordEchoOnEdit) case 3: echoLineEdit.SetEchoMode(widgets.QLineEdit__NoEcho) } }
func alignmentChanged(alignmentLineEdit *widgets.QLineEdit, index int) { switch index { case 0: alignmentLineEdit.SetAlignment(core.Qt__AlignLeft) case 1: alignmentLineEdit.SetAlignment(core.Qt__AlignCenter) case 2: alignmentLineEdit.SetAlignment(core.Qt__AlignRight) } }
func validatorChanged(validatorLineEdit *widgets.QLineEdit, index int) { switch index { case 0: { validatorLineEdit.SetValidator(nil) } case 1: { validatorLineEdit.SetValidator(gui.NewQIntValidator(validatorLineEdit)) } case 2: { validatorLineEdit.SetValidator(gui.NewQDoubleValidator(validatorLineEdit)) //TODO: gui.NewQDoubleValidator2(-999.0, 999.0, 2, validatorLineEdit) } } validatorLineEdit.Clear() }
func inputMaskChanged(inputMaskLineEdit *widgets.QLineEdit, index int) { switch index { case 0: inputMaskLineEdit.SetInputMask("") case 1: inputMaskLineEdit.SetInputMask("+99 99 99 99 99;_") case 2: inputMaskLineEdit.SetInputMask("0000-00-00") inputMaskLineEdit.SetText("00000000") inputMaskLineEdit.SetCursorPosition(0) case 3: inputMaskLineEdit.SetInputMask(">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#") } }