MousePressFilter Class Reference

#include <kgloballedgerview.h>

Inheritance diagram for MousePressFilter:

QObject
Collaboration diagram for MousePressFilter:

Collaboration graph
[legend]

List of all members.

Public Slots

void setFilterActive (bool state=true)
void setFilterDeactive (bool state=false)

Signals

void mousePressedOnExternalWidget (bool &)

Public Member Functions

 MousePressFilter (QWidget *parent=0, const char *name=0)
void addWidget (QWidget *w)

Protected Member Functions

bool isChildOf (QWidget *child, QWidget *parent)
bool eventFilter (QObject *o, QEvent *e)

Private Attributes

QValueList< QWidget * > m_parents
QEvent * m_lastMousePressEvent
bool m_filterActive


Detailed Description

helper class implementing an event filter to detect mouse button press events on widgets outside a given set of widgets. This is used internally to detect when to leave the edit mode.

Constructor & Destructor Documentation

MousePressFilter::MousePressFilter ( QWidget parent = 0,
const char *  name = 0 
)


Member Function Documentation

void MousePressFilter::addWidget ( QWidget w  ) 

Add widget w to the list of possible parent objects. See eventFilter() how they will be used.

void MousePressFilter::setFilterActive ( bool  state = true  )  [slot]

This slot allows to activate/deactive the filter. By default the filter is active.

Parameters:
state Allows to activate (true) or deactivate (false) the filter

void MousePressFilter::setFilterDeactive ( bool  state = false  )  [inline, slot]

This slot allows to activate/deactive the filter. By default the filter is active.

Parameters:
state Allows to deactivate (true) or activate (false) the filter

bool MousePressFilter::isChildOf ( QWidget child,
QWidget parent 
) [protected]

This method checks if the widget child is a child of the widget parent and returns either true or false.

Parameters:
child pointer to child widget
parent pointer to parent widget
Return values:
true child points to widget which has parent as parent or grand-parent
false child points to a widget which is not related to parent

bool MousePressFilter::eventFilter ( QObject o,
QEvent *  e 
) [protected]

Reimplemented from base class. Sends out the mousePressedOnExternalWidget() signal if object o points to an object which is not a child widget of any added previously using the addWidget() method. The signal is sent out only once for each event e.

Parameters:
o pointer to QObject
e pointer to QEvent
Returns:
always returns false

void MousePressFilter::mousePressedOnExternalWidget ( bool &   )  [signal]


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Wed Jan 26 13:09:10 2011 for KMyMoney by  doxygen 1.5.6