API Documentation
Loading...
Searching...
No Matches
QCustomValidator Class Reference

Responsible on most user input fields for correcting the input when possible or allerting the user that the input is incorrect. Used on all QCustomLineEdit widgets and derivatives. More...

#include <QCustomValidator.h>

Inheritance diagram for QCustomValidator:
[legend]
Collaboration diagram for QCustomValidator:
[legend]

Public Types

enum  ValidityMessage {
  e_is_valid , e_unexpected_format , e_value_is_not_a_real_number , e_too_many_decimals ,
  e_value_too_high , e_value_too_low , e_value_is_empty , e_string_is_too_long ,
  e_string_is_too_short , e_file_exists
}
 

Public Member Functions

void fixup (QString &input) const override
 
Stringfixup (String &input, bool to_unit=true, bool from_unit=true) const
 
ValidityMessage getMessage (const String &input) const
 
TranslatedString getMessageString (ValidityMessage message)
 
fltp08 max () const
 
fltp08 min () const
 
const QCustomValidatoroperator= (const QCustomValidator &other)
 
 QCustomValidator (const QCustomValidator &validator)
 
 QCustomValidator (const TypeInfo &info, QObject *parent=nullptr)
 
 QCustomValidator (QObject *parent=nullptr)
 
const Stringregex () const
 
void setAllowEmpty (bool allow_empty)
 
void setAllowWrapping (bool allow_wrapping)
 
void setCustomCallback (const std::function< ValidityMessage(const String &)> &callback)
 
template<class t_angle_type >
void setMax (Angle< t_angle_type > max)
 
void setMax (fltp08 max)
 
template<class t_angle_type >
void setMin (Angle< t_angle_type > min)
 
void setMin (fltp08 min)
 
void setNumberOfDecimals (uint04 decimals)
 
void setRegex (const String &regex)
 
void setStep (fltp08 step)
 
void setTypeInfo (const TypeInfo &info)
 
void setUnitType (UnitCategory type)
 
void setUnitValidator (const ConstPointer< Unit > &unit, uint01 dimension=Constant< uint01 >::Invalid)
 
fltp08 step () const
 
const TypeInfotypeInfo () const
 
const ConstPointer< Unit > & unit () const
 
uint01 unitDimension () const
 
const UnitCategoryunitType () const
 
QValidator::State validate (QString &input, int &pos) const override
 
virtual ~QCustomValidator ()
 

Detailed Description

Responsible on most user input fields for correcting the input when possible or allerting the user that the input is incorrect. Used on all QCustomLineEdit widgets and derivatives.


Member Enumeration Documentation

◆ ValidityMessage

Enumerator
e_is_valid 
e_unexpected_format 
e_value_is_not_a_real_number 
e_too_many_decimals 
e_value_too_high 
e_value_too_low 
e_value_is_empty 
e_string_is_too_long 
e_string_is_too_short 
e_file_exists 

Constructor & Destructor Documentation

◆ QCustomValidator() [1/3]

QCustomValidator ( QObject * parent = nullptr)
explicit

◆ QCustomValidator() [2/3]

QCustomValidator ( const TypeInfo & info,
QObject * parent = nullptr )
explicit

◆ QCustomValidator() [3/3]

QCustomValidator ( const QCustomValidator & validator)

◆ ~QCustomValidator()

virtual ~QCustomValidator ( )
virtual

Member Function Documentation

◆ fixup() [1/2]

void fixup ( QString & input) const
override

◆ fixup() [2/2]

String & fixup ( String & input,
bool to_unit = true,
bool from_unit = true ) const

◆ getMessage()

ValidityMessage getMessage ( const String & input) const

◆ getMessageString()

TranslatedString getMessageString ( ValidityMessage message)

◆ max()

fltp08 max ( ) const
inlinenodiscard

◆ min()

fltp08 min ( ) const
inlinenodiscard

◆ operator=()

const QCustomValidator & operator= ( const QCustomValidator & other)

◆ regex()

const String & regex ( ) const
inlinenodiscard

◆ setAllowEmpty()

void setAllowEmpty ( bool allow_empty)
inline

◆ setAllowWrapping()

void setAllowWrapping ( bool allow_wrapping)
inline

◆ setCustomCallback()

void setCustomCallback ( const std::function< ValidityMessage(const String &)> & callback)
inline

◆ setMax() [1/2]

template<class t_angle_type >
void setMax ( Angle< t_angle_type > max)
inline

◆ setMax() [2/2]

void setMax ( fltp08 max)
inline

◆ setMin() [1/2]

template<class t_angle_type >
void setMin ( Angle< t_angle_type > min)
inline

◆ setMin() [2/2]

void setMin ( fltp08 min)
inline

◆ setNumberOfDecimals()

void setNumberOfDecimals ( uint04 decimals)
inline

◆ setRegex()

void setRegex ( const String & regex)

◆ setStep()

void setStep ( fltp08 step)
inline

◆ setTypeInfo()

void setTypeInfo ( const TypeInfo & info)
inline

◆ setUnitType()

void setUnitType ( UnitCategory type)

◆ setUnitValidator()

void setUnitValidator ( const ConstPointer< Unit > & unit,
uint01 dimension = Constantuint01 >::Invalid )

◆ step()

fltp08 step ( ) const
nodiscard

◆ typeInfo()

const TypeInfo & typeInfo ( ) const
inlinenodiscard

◆ unit()

const ConstPointer< Unit > & unit ( ) const
inlinenodiscard

◆ unitDimension()

uint01 unitDimension ( ) const
inlinenodiscard

◆ unitType()

const UnitCategory & unitType ( ) const
inlinenodiscard

◆ validate()

QValidator::State validate ( QString & input,
int & pos ) const
override

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