what I wanna perhaps like this:
when a right mouse button is pressed and we go down and right with a cursor. As in letter ‘L’. Our mouse gesture will close the window.

I think Qt already have framework for mouse gesture .see here
Although I cannot make use of the knowledge there due to a lack of Qt programming experience ,but I still think it can helps us simplify the mouse gesture program design.
please forgive my greedy request ,can you give me an code example ?

I googled such gesture examples on Qt4 ,but hard to find one ,so your help will be greatly appreciated !
thanks inadvance !