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

List:       kde-core-devel
Subject:    Re: QSemiModalWidget?
From:       Richard Moore <rich () ipso-facto ! freeserve ! co ! uk>
Date:       1999-12-02 13:32:57
[Download RAW message or body]



Matthias Ettrich wrote:
> 
> On Wed, 01 Dec 1999, Richard Moore wrote:
> > Richard Moore wrote:
> > >
> > > Does anyone know if it would be possible to create a QWidget that
> > > had it's own event loop (like QSemiModal) but which does not need
> > > to be a top level widget? I want something like this for inplace
> > > editing.
> >
> > I've looked into this a bit more now - the only work that is actually
> > done in QSemiModal appears to be the centering of the dialog. Everything
> > else (specifically the modality) is handled by using the Modal widget
> > flag, however according to the docs this implies the the Dialog flag.
> > Does this mean it cannot be done?
> 
> Why not use QWidget::grabMouse() and QWidget::grabKeyboard() for inline editing?

That was what I tried first, but I didn't get it to work very well. I'll
have another go and see if I can make it work better this time.

> 
> If you really want modality rather than grabbing (although I don't understand
> why), install an application event filter and filter out
>                     e->type() == QEvent::KeyPress ||
>                     e->type() == QEvent::KeyRelease ||
>                     e->type() == QEvent::Accel ||
>                     e->type() == QEvent::MouseButtonPress ||
>                     e->type() == QEvent::MouseButtonRelease ||
>                     e->type() == QEvent::MouseButtonDblClick ||
>                     e->type() == QEvent::FocusIn ||
>                     e->type() == QEvent::Enter
> 
> for all widgets that are not children of your "modal" one.

Hmm - I'll definitely have another go at using grabs - this looks scarey!

Rich.

> 
> Matthias

-- 
     Richard Moore		rich@ipso-facto.freeserve.co.uk
http://www.robocast.com/	richard@robocast.com
http://developer.kde.org/	rich@kde.org

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

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