Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Gui::Widgets::ConstrainedNumericSpinBox< T > Class Template Reference

Constrained input spin box. The constraint to apply to any input value is verified using the user-define predicate associated to the object. More...

#include <Gui/Widgets/ConstrainedNumericSpinBox.hpp>

+ Collaboration diagram for Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >:

Public Types

using BaseWidget = typename QtSpinBox::getType<T>::Type
 
using Predicate = std::function<bool( T )>
 

Public Member Functions

QValidator::State validate (QString &input, int &) const override
 
void setPredicate (Predicate p)
 Set the predicate to evaluate.
 
bool isValid (T s) const
 Validate a value.
 

Detailed Description

template<typename T>
class Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >

Constrained input spin box. The constraint to apply to any input value is verified using the user-define predicate associated to the object.

Template Parameters
TType of the constrained value to input

Definition at line 18 of file ConstrainedNumericSpinBox.hpp.

Member Typedef Documentation

◆ BaseWidget

template<typename T >
using Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >::BaseWidget = typename QtSpinBox::getType<T>::Type

Definition at line 21 of file ConstrainedNumericSpinBox.hpp.

◆ Predicate

template<typename T >
using Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >::Predicate = std::function<bool( T )>

Definition at line 22 of file ConstrainedNumericSpinBox.hpp.

Member Function Documentation

◆ isValid()

template<typename T >
bool Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >::isValid ( T s) const
inline

Validate a value.

Parameters
s
Returns
true if the value is valid according to the stored predicate, false otherwise.

Definition at line 33 of file ConstrainedNumericSpinBox.hpp.

◆ setPredicate()

template<typename T >
void Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >::setPredicate ( Predicate p)
inline

Set the predicate to evaluate.

Definition at line 27 of file ConstrainedNumericSpinBox.hpp.

◆ validate()

template<typename T >
QValidator::State Ra::Gui::Widgets::ConstrainedNumericSpinBox< T >::validate ( QString & input,
int &  ) const
override

Definition at line 40 of file ConstrainedNumericSpinBox.hpp.


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