Hi Henning
The following code shows how to do this. Unfortunetaly, there is a regression bug (I accidently changed a few lines of code in the compiler related to the set feature), so it won't work unless you download the newest release, which I will upload right now.
The trick is to use Qt Designer and create QLineEdit, but actually "extend" the QLineEdit to a q7b control "TextBox", which have signals for lostfocus etc. (see the documentation).
QLineEdit has no lost/gotfocus signal native (the Qt way would be to create a sub class of QLineEdit and use this, therefore I provide the "TextBox")
- Code: Select all
Outlet lineEdit1 As QLineEdit Set TextBox ' add TextBox feature to the QLineEdit (actually TextBox is a sub class of QLineEdit)
Signal on_lineEdit1_GotFocus()
lineEdit1.setStyleSheet("background-color: rgb(255, 0, 0);")
End Signal
Signal on_lineEdit1_LostFocus()
lineEdit1.setStyleSheet("background-color: rgb(255, 255, 255);")
End Signal