Could you please give me an example or explain in more detail.
"Install an event filter on the application object and intercept key events there. "
How exactly?
Right. So when I write that I have installed an event filter and I am writing the system command for all the key press events, it works; the sound is played when these particular events occur. My question was there are some events internally handled by Qt like the scrolling of the scroll bars of a QScrollArea. I do not get the key press sound over there and its obvious. Then you adviced to install event filter for those also. To which I replied that then once I override the basic Qt's event handling of a particular event I need to write the code for it. This means I need to write the code for the scrolling of the scroll bars of the QScrollArea also. Then you said "NO". I didn't understand your NO!!
I have no idea what you are talking about. All events are "handled internally by Qt". Qt doesn't handle any events "externally".
No, I haven't. I told you to install an event filter on the application object and not on any scroll area or anything like that.Then you adviced to install event filter for those also.
By internally I meant by default. Like when we want to handle some events in our own way we install event filters. The events which we do not handle in them will be handled by Qt in a default way.
No, we reimplement event handlers. Event filters are for specific cases such as yours or for lazy people who don't care about quality of their code.
Next time please use the term "by default" and not "internally" if you want to say "by default". And now please install an event filter on the application object and have your problem solved.The events which we do not handle in them will be handled by Qt in a default way.
I accept. Will take care next time.
BTW I don't get how event filters affect the quality of code?
Bookmarks