COPASI API  4.16.103
Public Member Functions | Protected Attributes | List of all members
CQValidatorBound Class Reference

#include <CQValidator.h>

Inheritance diagram for CQValidatorBound:
Inheritance graph
[legend]
Collaboration diagram for CQValidatorBound:
Collaboration graph
[legend]

Public Member Functions

 CQValidatorBound (QLineEdit *parent, const QString &sign)
 
virtual void force (const QString &input) const
 
virtual State validate (QString &input, int &pos) const
 
- Public Member Functions inherited from CQValidator< QLineEdit >
 CQValidator (QLineEdit *parent, QString(QLineEdit::*retrieve)(void) const, const char *name=0)
 
virtual State revalidate ()
 
virtual void saved () const
 

Protected Attributes

QDoubleValidator * mpDoubleValidator
 
QString mSign
 
QString mValidBound
 
- Protected Attributes inherited from CQValidator< QLineEdit >
QString mLastAccepted
 
QLineEdit * mpContainer
 
QString(QLineEdit::* mRetrieve )(void) const
 

Additional Inherited Members

- Protected Member Functions inherited from CQValidator< QLineEdit >
State setColor (const State &state) const
 

Detailed Description

Definition at line 125 of file CQValidator.h.

Constructor & Destructor Documentation

CQValidatorBound::CQValidatorBound ( QLineEdit *  parent,
const QString &  sign 
)

Definition at line 34 of file CQValidator.cpp.

34  :
35  CQValidator< QLineEdit >(parent, &QLineEdit::text, NULL),
36  mpDoubleValidator(new QDoubleValidator(-std::numeric_limits< C_FLOAT64 >::max(), std::numeric_limits< C_FLOAT64 >::max(), std::numeric_limits< C_FLOAT64 >::digits10, this)),
37  mSign(sign),
38  mValidBound("\t") // It is not possible to insert a tab.
39 {}
QString mValidBound
Definition: CQValidator.h:141
QDoubleValidator * mpDoubleValidator
Definition: CQValidator.h:137
#define max(a, b)
Definition: f2c.h:176

Member Function Documentation

void CQValidatorBound::force ( const QString &  input) const
virtual

Reimplemented from CQValidator< QLineEdit >.

Definition at line 59 of file CQValidator.cpp.

References CQValidator< Type >::force(), and mValidBound.

Referenced by CQFittingItemWidget::slotLowerEdit(), CQFittingItemWidget::slotUpperEdit(), and validate().

60 {
61  const_cast<CQValidatorBound *>(this)->mValidBound = input;
62 
64 }
QString mValidBound
Definition: CQValidator.h:141
virtual void force(const QString &input) const
Definition: CQValidator.h:77
QValidator::State CQValidatorBound::validate ( QString &  input,
int &  pos 
) const
virtual

Reimplemented from CQValidator< QLineEdit >.

Definition at line 41 of file CQValidator.cpp.

References force(), mpDoubleValidator, mSign, mValidBound, and CQValidator< QLineEdit >::setColor().

42 {
43  QString Input;
44 
45  if (input == mValidBound ||
46  mpDoubleValidator->validate(input, pos) == Acceptable ||
47  (input.startsWith(mSign) &&
48  input.endsWith("%") &&
49  mpDoubleValidator->validate(Input = input.mid(1, input.length() - 2), pos)))
50  {
51  force(input);
52  return Acceptable;
53  }
54 
55  setColor(Invalid);
56  return Intermediate;
57 }
virtual void force(const QString &input) const
Definition: CQValidator.cpp:59
QString mValidBound
Definition: CQValidator.h:141
QDoubleValidator * mpDoubleValidator
Definition: CQValidator.h:137
State setColor(const State &state) const
Definition: CQValidator.h:84

Member Data Documentation

QDoubleValidator* CQValidatorBound::mpDoubleValidator
protected

Definition at line 137 of file CQValidator.h.

Referenced by validate().

QString CQValidatorBound::mSign
protected

Definition at line 139 of file CQValidator.h.

Referenced by validate().

QString CQValidatorBound::mValidBound
protected

Definition at line 141 of file CQValidator.h.

Referenced by force(), and validate().


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