kMyMoneyLineEdit Class Reference

#include <kmymoneylineedit.h>

Inheritance diagram for kMyMoneyLineEdit:

KLineEdit
Collaboration diagram for kMyMoneyLineEdit:

Collaboration graph
[legend]

List of all members.

Public Slots

void loadText (const QString &text)

Signals

void lineChanged (const QString &str)

Public Member Functions

 kMyMoneyLineEdit (QWidget *w=0, const char *name=0, bool forceMonetaryDecimalSymbol=false, int alignment=(AlignLeft|AlignVCenter))
 ~kMyMoneyLineEdit ()
void resetText (void)
void setHint (const QString &hint)

Protected Member Functions

void focusOutEvent (QFocusEvent *ev)
void drawContents (QPainter *)
void keyPressEvent (QKeyEvent *ev)
void keyReleaseEvent (QKeyEvent *ev)

Private Attributes

QString m_text
QString m_hint
bool m_forceMonetaryDecimalSymbol


Detailed Description

This class represents a special verson of a KLineEdit object that supports the display of a hint if the display area is empty. It also overrides the comma key on the numeric keypad with the currently selected monetaryDecimalSymbol if selected during creation of the object.

Author:
Michael Edwardes

Thomas Baumgart


Constructor & Destructor Documentation

kMyMoneyLineEdit::kMyMoneyLineEdit ( QWidget w = 0,
const char *  name = 0,
bool  forceMonetaryDecimalSymbol = false,
int  alignment = (AlignLeft|AlignVCenter) 
)

Parameters:
w pointer to parent
name pointer to name of object
forceMonetaryDecimalSymbol if true, the numeric keypad comma key will have a fixed value and does not follow the keyboard layout (default: false)
alignment Controls the alignment of the text. Default is Qt::AlignLeft | Qt::AlignVCenter. See Qt::AlignmentFlags for other possible values.

kMyMoneyLineEdit::~kMyMoneyLineEdit (  ) 


Member Function Documentation

void kMyMoneyLineEdit::resetText ( void   ) 

This method is used to set the value of the widget back to the one passed using loadText().

void kMyMoneyLineEdit::setHint ( const QString &  hint  )  [inline]

This method is used to turn on/off the hint display

void kMyMoneyLineEdit::loadText ( const QString &  text  )  [slot]

void kMyMoneyLineEdit::lineChanged ( const QString &  str  )  [signal]

This signal is emitted when the focus leaves the object and the text has been changed. The new text is passed as str.

void kMyMoneyLineEdit::focusOutEvent ( QFocusEvent *  ev  )  [protected]

void kMyMoneyLineEdit::drawContents ( QPainter *   )  [protected]

reimplemented to support the hint display

void kMyMoneyLineEdit::keyPressEvent ( QKeyEvent *  ev  )  [protected]

Overridden so that the period key on the numeric keypad always sends out the currently selected monetary decimal symbol instead of the key defined by the keymap.

Example: If you have set the keymap (keyboard layout) as English, then the numeric keypad will send a period but if you have set the keymap to be German, the same key will send a comma.

Parameters:
ev pointer to current QKeyEvent

void kMyMoneyLineEdit::keyReleaseEvent ( QKeyEvent *  ev  )  [protected]

Overridden so that the period key on the numeric keypad always sends out the currently selected monetary decimal symbol instead of the key defined by the keymap.

Example: If you have set the keymap (keyboard layout) as English, then the numeric keypad will send a period but if you have set the keymap to be German, the same key will send a comma.

Parameters:
ev pointer to current QKeyEvent


Member Data Documentation

QString kMyMoneyLineEdit::m_text [private]

This member keeps the initial value. It is used during resetText() to set the widgets text back to this initial value and as comparison during focusOutEvent() to emit the lineChanged signal if the current text is different.

QString kMyMoneyLineEdit::m_hint [private]

This member tells what to display as hint as long as the field is empty

This member keeps the status if overriding the numeric keypad comma key is requested or not.


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

Generated on Wed Jan 26 13:08:01 2011 for KMyMoney by  doxygen 1.5.6