[Development] QEvent problem

Berkay Elbir berkayelbir at gmail.com
Tue May 26 18:23:02 CEST 2015


I simplified the event handler function. This is an event handler of a
widget and there are different processes for every event case. In my
widget, I catch events and doing something in terms of them. For example,
as I said before I pressed "Delete" button of keyboard, type of event (
e->type() ) is sometimes QEvent::KeyRelease: and  sometimes
QEvent::Shortcut:.  To understand this, I debugged with Visual Studio. This
is just an example of course it happens for other keyboard keys.

I do not know why the reason is.

On Tue, May 26, 2015 at 6:03 PM, Thiago Macieira <thiago.macieira at intel.com>
wrote:

> On Tuesday 26 May 2015 16:10:08 Berkay Elbir wrote:
> > bool  eventFilter(QObject *o, QEvent *e){
> > switch(e->type()){
> > case QEvent::MouseButtonPress:
> > case QEvent::MouseMove:
> > case QEvent::MouseButtonRelease:
> > case QEvent::Shortcut:
> > case QEvent::KeyRelease:
> >
> > }
> > return false;
> > }
> >
> > My function is like this and when I press "Delete" button, it sometimes
> > enters KeyRelease instead of Shortcut then I press again, it enters
> > Shortcut part.
> >
> > Do you know about this issue? Is this a kind of bug or I use this wrong
> way?
>
> Not sure I understand you. If you have all five cases leading to the same
> code,
> how can you even tell which one it was?
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150526/c7203931/attachment.html>


More information about the Development mailing list