Hi,
does anybody knows how to implement a signal that when I clicked on a QLineEdit? I really appreciate because I already eated the API from top to botttom
Hi,
does anybody knows how to implement a signal that when I clicked on a QLineEdit? I really appreciate because I already eated the API from top to botttom
Reimplement mouseReleaseEvent for your widget and emit the signal from within there. Why do you need such a signal anyway?
my idea is that when I click on the QLineEdit, the text that is already show, disappear
Well.. it really depends how you want it to behave. Do you actually want it only to happen when clicking or when the widget gains focus. As for actual implementation, use the "modified" property of the line edit to see if the text was changed by the user.
gains focus will be the best, but isModified() how can be use as signal?
Not as a signal. Reimplement focusInEvent() and check whether isModified() is true. If not, clear the contents, otherwise leave it intact, that's all.
U R GOD!!! hahahaha pretty good idea, thanks a lot
If readOnly is true, then by definition the text cannot be edited by the user and the widget will never receive focus. Receiving / losing focus means the widget can interact with the user, which is not possible for a readOnly QLineEdit. In this case, the QLineEdit is not much different from a QLabel. If you want the widget to behave like a normal QLineEdit, then do not set the readOnly flag.I have readOnly flag as true for QLineEdit.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks