KMyMoneyCategory Class Reference

#include <kmymoneycategory.h>

Inheritance diagram for KMyMoneyCategory:

KMyMoneyCombo KComboBox KMyMoneySecurity
Collaboration diagram for KMyMoneyCategory:

Collaboration graph

List of all members.

Public Slots

virtual void slotItemSelected (const QString &id)
virtual void setEnabled (bool)
virtual void setDisabled (bool)


void focusIn (void)

Public Member Functions

 KMyMoneyCategory (QWidget *parent=0, const char *name=0, bool splitButton=false)
virtual ~KMyMoneyCategory ()
kMyMoneyAccountSelectorselector (void) const
KPushButton * splitButton (void) const
virtual void reparent (QWidget *parent, WFlags, const QPoint &, bool showIt=FALSE)
virtual void setPalette (const QPalette &palette)
void setSplitTransaction (void)
bool isSplitTransaction (void) const
void setCurrentText (const QString &txt=QString())

Protected Member Functions

virtual void focusInEvent (QFocusEvent *ev)
virtual void focusOutEvent (QFocusEvent *ev)
virtual void setCurrentTextById (const QString &id)

Private Attributes

Private *const d

Detailed Description

This class implements a text based account/category selector. When initially used, the widget has the functionality of a KComboBox object. Whenever a key is pressed, the set of loaded accounts is searched for accounts which match the currently entered text.

If any match is found a list selection box is opened and the user can use the up/down, page-up/page-down keys or the mouse to navigate in the list. If an account is selected, the selection box is closed. Other key-strokes are directed to the parent object to manipulate the text. The visible contents of the selection box is updated with every key-stroke.

This object is a replacement of the kMyMoneyCategory object and should be used for new code.

Thomas Baumgart

Constructor & Destructor Documentation

KMyMoneyCategory::KMyMoneyCategory ( QWidget parent = 0,
const char *  name = 0,
bool  splitButton = false 

Standard constructor for the account selection object.

If parameter splitButton is true, the widget will construct a surrounding QFrame and reparent itself to be a child of this QFrame. It also adds a KPushButton with the "Split" icon to the right of the input field. In this case it is important not to use the pointer to this widget but it's parent when placing the object in a QLayout, QTable or some such. The parent widget (the QFrame in this case) can be extracted with the parentWidget() method.

Reparenting is handled by the object transparently for both cases.

Standard usage example (no split button):

 KMyMoneyCategory* category = new KMyMoneyCategory;

Enhanced usage example (with split button):

 KMyMoneyCategory* category = new KMyMoneyCategory(0, 0, true);

virtual KMyMoneyCategory::~KMyMoneyCategory (  )  [virtual]

Member Function Documentation

kMyMoneyAccountSelector* KMyMoneyCategory::selector ( void   )  const

This member returns a pointer to the completion object.

pointer to completion's selector object

Reimplemented from KMyMoneyCombo.

KPushButton* KMyMoneyCategory::splitButton ( void   )  const

This member returns a pointer to the split button. In case the splitButton parameter of the constructor was false, this method prints a warning to stderr and returns 0.

virtual void KMyMoneyCategory::reparent ( QWidget parent,
WFlags  ,
const QPoint &  ,
bool  showIt = FALSE 
) [virtual]

Reimplemented for internal reasons. No API change

virtual void KMyMoneyCategory::setPalette ( const QPalette &  palette  )  [virtual]

Reimplemented for internal reasons. No API change.

void KMyMoneyCategory::setSplitTransaction ( void   ) 

Force the text field to show the text for split transaction.

bool KMyMoneyCategory::isSplitTransaction ( void   )  const

Check if the text field contains the text for a split transaction

void KMyMoneyCategory::setCurrentText ( const QString &  txt = QString()  )  [inline]

overridden for internal reasons, no API change

Reimplemented from KMyMoneyCombo.

Reimplemented in KMyMoneySecurity.

virtual void KMyMoneyCategory::focusInEvent ( QFocusEvent *  ev  )  [protected, virtual]

Reimplemented to support protected category text ("split transactions")

See also:

virtual void KMyMoneyCategory::focusOutEvent ( QFocusEvent *  ev  )  [protected, virtual]

Reimplemented to support protected category text ("split transactions")

Reimplemented from KMyMoneyCombo.

virtual void KMyMoneyCategory::setCurrentTextById ( const QString &  id  )  [protected, virtual]

set the widgets text area based on the item with the given id.

Reimplemented from KMyMoneyCombo.

Reimplemented in KMyMoneySecurity.

virtual void KMyMoneyCategory::slotItemSelected ( const QString &  id  )  [virtual, slot]

Reimplemented from KMyMoneyCombo.

virtual void KMyMoneyCategory::setEnabled ( bool   )  [virtual, slot]

virtual void KMyMoneyCategory::setDisabled ( bool   )  [virtual, slot]

void KMyMoneyCategory::focusIn ( void   )  [signal]

Signal to inform other objects that this object has reached focus. Used for e.g. to open the split dialog when the focus reaches this object and it contains the text 'Split transaction'.

See also:

Member Data Documentation

Private* const KMyMoneyCategory::d [private]

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

Generated on Wed Jan 26 13:07:57 2011 for KMyMoney by  doxygen 1.5.6