00001
00002
00003 #include "Iguana/Studio/interface/IgQtLineEdit.h"
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 IgQtLineEdit::IgQtLineEdit (QWidget *parent, const char *name)
00016 : QLineEdit (parent, name),
00017 m_textChanged (false)
00018 {
00019 connect(this, SIGNAL(textChanged(const QString&)),
00020 this, SLOT(changed(const QString&)));
00021
00022 connect(this, SIGNAL(returnPressed()),
00023 this, SLOT(changed()));
00024 }
00025
00026 IgQtLineEdit::IgQtLineEdit (const QString &contents,
00027 QWidget *parent,
00028 const char *name)
00029 : QLineEdit (contents, parent, name),
00030 m_textChanged (false)
00031 {
00032 connect(this, SIGNAL(textChanged(const QString&)),
00033 this, SLOT(changed(const QString&)));
00034 connect(this, SIGNAL(returnPressed()),
00035 this, SLOT(changed()));
00036 }
00037
00038 void IgQtLineEdit::changed (const QString & )
00039 { m_textChanged = true; }
00040
00041 void IgQtLineEdit::changed (void)
00042 {
00043 if (m_textChanged)
00044 {
00045 emit valueChanged (text ());
00046 m_textChanged = false;
00047 }
00048 }
00049
00050 void IgQtLineEdit::focusOutEvent (QFocusEvent *event)
00051 {
00052 QLineEdit::focusOutEvent(event);
00053 changed ();
00054 }
00055
00056 void IgQtLineEdit::setChanged (bool value)
00057 { m_textChanged = value; }