From kde-devel Sun Jun 30 20:26:31 2002 From: Gioele Barabucci Date: Sun, 30 Jun 2002 20:26:31 +0000 To: kde-devel Subject: Re: QMouseEvent button/state X-MARC-Message: https://marc.info/?l=kde-devel&m=102546884217220 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 <<