[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: propagating events
From:       Stefan Kombrink <katakombi () gmail ! com>
Date:       2005-06-20 23:44:57
Message-ID: 200506210144.58753.katakombi () web ! de
[Download RAW message or body]

On Tuesday 21 June 2005 00:49, Andreas Pakulat wrote:
> On 20.Jun 2005 - 23:52:59, Stefan Kombrink wrote:
> > On Monday 20 June 2005 23:13, Andreas Pakulat wrote:
> > > On 20.Jun 2005 - 23:02:33, Stefan Kombrink wrote:
> > > return mParent->event(e);
> >
> > Yeah, seems obvious, but you can't do that since it is protected!
>
> Right, I shouldn't have written that from memory, but have a look at my
> own app...
>
> > > to propagate the Event to your Parent.
> > >
> > > Andreas
> >
> > Now my code looks like that (and it works)
> >
> > bool QSensorConfig::event( QEvent *e )
> > {
> >     if ( !QWidget::event( e ) )
> >         return QApplication::sendEvent( mParent, e );
> >     else return true;
> > }
>
> Hmm, if that's your event() function, why have one at all? I mean,
> you're not doing anything, but sending the events to your parent, which
> is also done if you don't override event() from QWidget.

But if holding the focus it doesn't propagate any events to its parent, if I 
won't have this function.
I'd be glad if that was the default behaviour, but it seems I need to overload 
somehow.

>
> In my Apps I use just:
>
> return <class that my class is a subclass of>::event(e)
>
> at the end of event().
>
> In case the description in <> is unclear I mean with
>
> class MyWidget : public QWidget
>
> I would use
>
> return QWidget::event(e);
>
> Andreas

I see, I will try that again as well...


  thanks alot,
  Stefan >8 ^)
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic