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

List:       kde-devel
Subject:    Re: QMouseEvent button/state
From:       Gioele Barabucci <ml () gioelebarabucci ! com>
Date:       2002-06-30 20:26:31
[Download RAW message or body]

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

At least in the future other ppl will undestand what this code does, and WHY 
it does so.

> When you find strange looking code, cvs annotate is always a good idea. 
How can I use cvs annotate? man cvs don't report it.


-- 
Gioele Barabucci (Gb])
) mailto:dev@gioelebarabucci.com
) http://www.gioelebarabucci.com
) ) I've been and now I've gone
) )          /Magic Pie^Oasis


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