Thanks Gazi for your reply.

But i am wondering if the lost of the focus will be my error because i am
capturing mouse events without problem, even when i run my qt designer
application. I only have problems on capturing keyboard events.

Anyway, i will try to do as you said to me this afternoon since it has
sense. Maybe keyboard events works different than  mouse events.

Thank you.



2007/11/28, Gazi Alankus <[EMAIL PROTECTED]>:
>
> You should call osgWidget->setFocus(); initially and after every
> button click or some other similar action that will make your widget
> lose focus.
>
> -Gazi
>
>
> On 27/11/2007, jonathan escolano <[EMAIL PROTECTED]> wrote:
> > Hello everyone!
> >
> > It is the first time i use OSG and Qt4 so sorry if my problem is so
> basic.
> >
> > I have created a Qt4 plugin, based on the osgviewerQT example, to be
> used
> > with QTDesigner. I have added an object from my plugin into a new form
> and i
> > am able to render models and to capture mouse events, but there is no
> way on
> > capturing Keyboard events.
> >
> > I have implemented a class wich inherits from QGLWidget and
> > osgViewer::Viewer, and tried to capture keyboard events via
> > keyPressEvent(QKeyEvent* event) method.
> > As i have said, if a run a Qt application wich shows a form with my
> custom
> > widget inside, i cannot capture keyboard events, but, on the other hand,
> if
> > i run a Qt application wich just create a new object from my custom
> widget
> > class and calls the show() method (remember that my custom widget
> inherits
> > from osgViewer::Viewer too) the keyboard events are captured perfectly!
> >
> > I am using the windows version of Qt, and the Qt plugin is created as a
> .dll
> > file.
> >
> > Is there some kind of restriction when capturing keyboard events from
> custom
> > plugins?
> >
> > Thank you very much!
> >
> > Jonathan.
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to