-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling KeyPressEvent for a QLineEdit instance results in a seg fault. #104
Comments
Thinking about it perhaps I'm not on the gui thread, and I need to use a slot. I'll try that. |
No, that's rubbish. I'm tired and going to bed. I'll come back to it tomorrow. |
Hey It's a You probably want to suffix So this should work: filterEdit := widgets.NewQLineEdit(nil)
filterEdit.ConnectKeyPressEvent(func(event *gui.QKeyEvent) {
if event.Key() == int(core.Qt__Key_Down) {
fmt.Println("down")
} else if event.Key() == int(core.Qt__Key_Up) {
fmt.Println("up")
} else {
filterEdit.KeyPressEventDefault(event)
}
}) |
Yes, that works. Thank you. There are several little nuggets like this that are not easy to discover. I have some thoughts on documentation, and I'll probably open an issue next weekend to discuss. |
This is fine when Up or Down is pressed. But if anything else is pressed something goes horribly wrong when calling KeyPressEvent.
Segmentation fault (core dumped)
In C++ this works.
The text was updated successfully, but these errors were encountered: