COPASI API  4.16.103
MyLineEdit.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2002 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef MYLINEEDIT_H
16 #define MYLINEEDIT_H
17 
18 #include <QtGui/QLineEdit>
19 
20 class MyLineEdit: public QLineEdit
21 {
22  Q_OBJECT
23 public:
24  MyLineEdit(QWidget * parent = 0, const char * name = 0);
25  MyLineEdit(const QString & contents, QWidget * parent, const char * name = 0);
26  bool isValid();
27 
28 protected:
29  QColor mOldColor;
30  QColor mNewColor;
31  QColor mErrorColor;
32 
33  void process();
34  void setupWidget();
35 
36  virtual void updateColor();
37 
38 protected slots:
39  void slotLostFocus();
40  void slotReturnPressed();
41  void slotTextChanged(const QString & text);
42 
43 public slots:
44  //force processing of changes in the LineEdit widget. This is
45  //needed when the ReturnPressed and LostFocus signals do not apply
46  void slotForceUpdate();
47 
48  virtual void setText(const QString & text);
49 
50 signals:
51  void edited();
52 };
53 
54 #endif
void process()
Definition: MyLineEdit.cpp:49
void slotTextChanged(const QString &text)
Definition: MyLineEdit.cpp:68
virtual void updateColor()
Definition: MyLineEdit.cpp:73
void edited()
void slotForceUpdate()
Definition: MyLineEdit.cpp:65
void slotReturnPressed()
Definition: MyLineEdit.cpp:62
QColor mOldColor
Definition: MyLineEdit.h:29
virtual void setText(const QString &text)
Definition: MyLineEdit.cpp:97
void setupWidget()
Definition: MyLineEdit.cpp:32
void slotLostFocus()
Definition: MyLineEdit.cpp:59
MyLineEdit(QWidget *parent=0, const char *name=0)
Definition: MyLineEdit.cpp:18
QColor mErrorColor
Definition: MyLineEdit.h:31
QColor mNewColor
Definition: MyLineEdit.h:30
bool isValid()
Definition: MyLineEdit.cpp:103