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

List:       kde-devel
Subject:    Re: QMouseEvent button/state
From:       "Aaron J. Seigo" <aseigo () olympusproject ! org>
Date:       2002-06-30 21:44:25
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 30 June 2002 02:26, Gioele Barabucci wrote:
> On Sunday 30 June 2002 21:39, John Firebaugh wrote:
> > > whether it was the author's intention or not, it prevents a menu from
> > > appearing if you click the RMB while you are in the middle of a left
> > > click.
> > >
> > > e.g.: "LMB down -> RMB down -> LMB up" would not result in showMenu(..)
> > > being emitted.
>
> Is this ok?
>
> void KMiniPagerButton::mousePressEvent( QMouseEvent * e)
> {
>     switch ( e->button() ) {
>     case LeftButton:
>         QButton::mousePressEvent( e );
>         break;
>     case RightButton:
>         // prevent LMB down -> RMB down -> LMB up sequence
>         if ( e->state() == NoButton )
>             emit showMenu( e->globalPos(), deskNum );
>         break;
>     }
> }

now the QMouseEvent doesn't get propagated to QButton::mousePressEvent on MMB 
(or any other mouse button that may come along) .. the correct behaviour is 
to only intercept the event if the RMB is pressed and no other mouse button 
is pressed, and to pass it on otherwise ..

also this code won't show a RMB menu if Alt/Shift/Ctrl are held when right 
clicking ....

what's wrong with just adding a comment to the existing (working) code?

> How can I use cvs annotate? man cvs don't report it.

cvs annotate filename

it tells you what revision a line was last modified in and who checked in tha 
trevision... you can then do things like do cvs log on that -r ...

- -- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

"Everything should be made as simple as possible, but not simpler"
    - Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9H3u61rcusafx20MRAtwSAKCrK6Z0E0pDsniemIemDBwxxomMPQCeJ5lV
nTHBvPZNakQAtOQWr3AsNBo=
=68xU
-----END PGP SIGNATURE-----

 
>> 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