#include <kmymoneylineedit.h>
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 |
kMyMoneyLineEdit::kMyMoneyLineEdit | ( | QWidget * | w = 0 , |
|
const char * | name = 0 , |
|||
bool | forceMonetaryDecimalSymbol = false , |
|||
int | alignment = (AlignLeft|AlignVCenter) | |||
) |
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 | ( | ) |
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.
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.
ev | pointer to current QKeyEvent |
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
bool kMyMoneyLineEdit::m_forceMonetaryDecimalSymbol [private] |
This member keeps the status if overriding the numeric keypad comma key is requested or not.