OSB_GUI::RangeValidator< T, Limits > Class Template Reference

Inheritance diagram for OSB_GUI::RangeValidator< T, Limits >:

Inheritance graph
[legend]
Collaboration diagram for OSB_GUI::RangeValidator< T, Limits >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T, typename Limits = std::numeric_limits<T>>
class OSB_GUI::RangeValidator< T, Limits >

Template to validate user input in QLineEdit objects.

Parameters:
T Datatype of validate.
Limits Limits of the datatype. It must provide min(), max(), is_integer and is_signed.

Definition at line 66 of file osblineedits.h.

Public Member Functions

Read access:
Configuration:

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

template<typename T, typename Limits = std::numeric_limits<T>>
OSB_GUI::RangeValidator< T, Limits >::RangeValidator ( QObject parent,
const char *  name = "podValidator_" 
) [inline, explicit]

Constructor with QT arguments.

Definition at line 69 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::bottom_, and OSB_GUI::RangeValidator< T, Limits >::top_.

template<typename T, typename Limits = std::numeric_limits<T>>
OSB_GUI::RangeValidator< T, Limits >::RangeValidator ( const T &  bottom,
const T &  top,
QObject parent,
const char *  name = "podValidator_" 
) [inline]

Constructor with range and QT arguments.

Definition at line 78 of file osblineedits.h.

template<typename T, typename Limits = std::numeric_limits<T>>
OSB_GUI::RangeValidator< T, Limits >::RangeValidator ( const RangeValidator< T, Limits > &   )  [private]

Prevent copying: not implemented.


Member Function Documentation

template<typename T, typename Limits = std::numeric_limits<T>>
const T& OSB_GUI::RangeValidator< T, Limits >::bottom (  )  const [inline]

Get lower boundary (included).

Definition at line 96 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::bottom_.

Referenced by OSB_GUI::RangeLineEdit< size_t >::bottom().

template<typename T, typename Limits>
bool OSB_GUI::RangeValidator< T, Limits >::getValue ( T &  t,
const QString &  s 
) const

Get the value.

Parameters:
t Gets the converted input.
s String with value.
Returns:
true if s contains a valid T.
If not the function returns false and t is default constructed.

Definition at line 387 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::bottom_, and OSB_GUI::RangeValidator< T, Limits >::top_.

Referenced by OSB_GUI::RangeValidator< T, Limits >::validate(), and OSB_GUI::RangeLineEdit< size_t >::value().

template<typename T, typename Limits = std::numeric_limits<T>>
RangeValidator& OSB_GUI::RangeValidator< T, Limits >::operator= ( const RangeValidator< T, Limits > &   )  [private]

Prevent assignment: not implemented.

template<typename T, typename Limits = std::numeric_limits<T>>
void OSB_GUI::RangeValidator< T, Limits >::setBottom ( const T &  bottom  )  [inline]

Set lower boundary (included).

Definition at line 120 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::bottom_.

Referenced by OSB_GUI::RangeLineEdit< size_t >::setBottom().

template<typename T, typename Limits = std::numeric_limits<T>>
void OSB_GUI::RangeValidator< T, Limits >::setRange ( const T &  bottom,
const T &  top 
) [inline]

Set range (bottom and top included).

Definition at line 130 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::bottom_, and OSB_GUI::RangeValidator< T, Limits >::top_.

Referenced by OSB_GUI::RangeLineEdit< size_t >::setRange().

template<typename T, typename Limits = std::numeric_limits<T>>
void OSB_GUI::RangeValidator< T, Limits >::setTop ( const T &  top  )  [inline]

Set upper boundary (included).

Definition at line 125 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::top_.

Referenced by OSB_GUI::RangeLineEdit< size_t >::setTop().

template<typename T, typename Limits = std::numeric_limits<T>>
const T& OSB_GUI::RangeValidator< T, Limits >::top (  )  const [inline]

Get upper boundary (included).

Definition at line 101 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::top_.

Referenced by OSB_GUI::RangeLineEdit< size_t >::top().

template<typename T, typename Limits>
QValidator::State OSB_GUI::RangeValidator< T, Limits >::validate ( QString &  input,
int &  pos 
) const

Validate the input.

Returns:
QValidator::Acceptable if input is within the valid range.
QValidator::Intermediate if is empty or just contains a '-'.
QValidator::Invalid if input is outside the valid range or is not a valid T.

Definition at line 368 of file osblineedits.h.

References OSB_GUI::RangeValidator< T, Limits >::getValue().


Member Data Documentation

template<typename T, typename Limits = std::numeric_limits<T>>
T OSB_GUI::RangeValidator< T, Limits >::bottom_ [private]

Lower boundary (included).

Definition at line 150 of file osblineedits.h.

Referenced by OSB_GUI::RangeValidator< T, Limits >::bottom(), OSB_GUI::RangeValidator< T, Limits >::getValue(), OSB_GUI::RangeValidator< T, Limits >::RangeValidator(), OSB_GUI::RangeValidator< T, Limits >::setBottom(), and OSB_GUI::RangeValidator< T, Limits >::setRange().

template<typename T, typename Limits = std::numeric_limits<T>>
T OSB_GUI::RangeValidator< T, Limits >::top_ [private]

Upper boundary (included).

Definition at line 152 of file osblineedits.h.

Referenced by OSB_GUI::RangeValidator< T, Limits >::getValue(), OSB_GUI::RangeValidator< T, Limits >::RangeValidator(), OSB_GUI::RangeValidator< T, Limits >::setRange(), OSB_GUI::RangeValidator< T, Limits >::setTop(), and OSB_GUI::RangeValidator< T, Limits >::top().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:18:52 2006 for OSB Library by  doxygen 1.4.7