Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2002
Re: Spacemouse integration


Message 1 in thread

Hi,
its very easy to integrate the spacemouse in a qt application. You have
to overload the x11EventFilter for the unix environment and
winEventFilter for the windows environment. I added a sourcecode example
as attachment to this mail.

regards

A. Strobel

-- 
 [ signature omitted ] 

Message 2 in thread

Hello!

> -----Original Message-----
> Andreas Strobel wrote
> Subject: Re: Spacemouse integration
>
> [added a sourcecode example]

Many thanks for your help! :-)

I think I understand now what to do. By deriving my own QApplication class
(MyApp) I overloaded now the QApplication::winEventFilter (resp.
QApplication::x11EventFilter) function.

Doing so one last problem occurs:

Of course I?ve to check for Spaceball presence in the MyQApp Constructor
calling a "SpaceballInit" function (sourcecode added to this email) to
create a "hdl" on the spaceball. It was more or less directly taken from the
(MFC) examples included in the spaceball sdk. The "SiOpenWinInit" function,
which is necessary for the spaceball initialization, needs a parameter which
points the current Window (hWnd). How do I get this information from Qt?
Unfortunately QApplication::curWin or something similar does not exist.

regards,
Sascha.Schneider@igd.fhg.de

Attachment: SpaceballInit.cpp
Description: Binary data


Message 3 in thread

Hi,
you have to build the whole application and than one step before calling
the mainloop of qt call the example code in the attachment. The win
Widget in the funktioncall is the mainwindow of your application.

regards

A. Strobel

-- 
 [ signature omitted ]