[Panel-devel] mousePressEvent() and contentRect()

Jason Stubbs jasonbstubbs at gmail.com
Sat Dec 22 13:05:53 CET 2007


On Saturday 22 December 2007 20:42:33 JST Sebastian Kuegler wrote:
> On Friday 21 December 2007 16:21:30 Jason Stubbs wrote:
> > When overridding mousePressEvent for a Plasma::Applet, you pretty much
> > always want to ignore it if its not within contentRect(). The reason for
> > this is that, unlike QWidgets, you will get clicks for the frame as well.
>
> Shouldn't this be caught in Applet then, and just passed on to the
> implementation of the applet when it's in the contentRect? Having to handle
> that in each applet respectively sounds like a source of problems for me.
> The applet implementation itself should be ignorant to those Applet-generic
> things, no?

Hmm.. Well to do that, seperate overloads would need to be created for 
handling mouse buttons and pretty much everything else where mouse position 
is important.

A better way (imo) would be a convention of always doing stuff in Widget 
subclasses and adding those to the applets layout. Doing that means that one 
doesn't have to take the frame into account at all.

-- 
Jason Stubbs


More information about the Panel-devel mailing list