CMS 3D CMS Logo

IgQtLineEdit.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "Iguana/Studio/interface/IgQtLineEdit.h"
00004 
00005 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00006 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00007 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00008 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00009 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00010 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00011 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00012 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00013 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
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 & /* str */)
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; }

Generated on Tue Jun 9 17:38:49 2009 for CMSSW by  doxygen 1.5.4