cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Protected Member Functions | List of all members
cc_tools_qt::property::field::FloatValue Class Reference

#include "cc_tools_qt/property/field.h"

Detailed Description

Class to contain all the properties relevant to comms::field::FloatValue fields.

Inheritance diagram for cc_tools_qt::property::field::FloatValue:
cc_tools_qt::property::field::CommonBase< FloatValue > cc_tools_qt::property::field::Common

Public Types

using SpecialsList = QList< SpecialType >
 List of special values.
 
using SpecialType = QPair< QString, double >
 The special value is described as string containing name and the actual numeric value.
 

Public Member Functions

 FloatValue ()
 Default constructor.
 
 FloatValue (const FloatValue &)
 Copy constructor.
 
 FloatValue (const QVariant &props)
 Construct from QVariant containing QVariantMap.
 
 FloatValue (const QVariantMap &props)
 Construct from QVariantMap.
 
 FloatValue (FloatValue &&)
 Move constructor.
 
 ~FloatValue () noexcept
 Destructor.
 
FloatValueaddSpecial (const QString &specialName, double value)
 Add speical value.
 
QVariantMap asMap () const
 Retrieve all properties as map.
 
int decimals () const
 Get number of decimal digits to display.
 
FloatValuedecimals (int value)
 Set number of decimal digits to display.
 
FloatValuehidden (bool value=true)
 Set whether the field is hidden.
 
FloatValuehiddenWhenReadOnly (bool value=true)
 Set whether the field must be hidden when cannot be modified.
 
bool isHidden () const
 Check the field is hidden.
 
bool isHiddenWhenReadOnly () const
 Check the field is hidden when readOnly.
 
bool isReadOnly () const
 Check whether the field cannot be modified.
 
bool isSerialisedHidden () const
 Check the serialisation part is hidden.
 
const QString & name () const
 Get name of the field.
 
FloatValuename (const char *value)
 Set name value.
 
FloatValuename (const QString &value)
 Set name value.
 
FloatValueoperator= (const FloatValue &)
 Copy assignment.
 
FloatValueoperator= (FloatValue &&)
 Move assignment.
 
FloatValuereadOnly (bool value=true)
 Set whether the field cannot be modified.
 
FloatValueserialisedHidden (bool value=true)
 Set whether the serialised part is hidden.
 
void setName (const char *value)
 Update the name value.
 
void setName (const QString &value)
 Update the name value.
 
void setTo (QVariantMap &props) const
 Copy all the properties value into provided properties map.
 
const SpecialsListspecials () const
 Get access to all the special values information.
 

Static Protected Member Functions

template<typename TValueType >
static TValueType getElemFrom (const QVariantMap &props, const QString &name, const TValueType &defaultVal=TValueType())
 read element value from the map
 
template<typename U >
static void setElemTo (U &&val, const QString &name, QVariantMap &props)
 set element value to the map
 

Member Function Documentation

◆ addSpecial()

FloatValue & cc_tools_qt::property::field::FloatValue::addSpecial ( const QString &  specialName,
double  value 
)

Add speical value.

Parameters
[in]specialNameName of the special value.
[in]valueNumeric value

◆ getElemFrom()

template<typename TValueType >
static TValueType cc_tools_qt::property::field::Common::getElemFrom ( const QVariantMap &  props,
const QString &  name,
const TValueType &  defaultVal = TValueType() 
)
staticprotectedinherited

read element value from the map

Parameters
[in]propsProperties map
[in]nameProperty name
[in]defaultValValue to return if not found in map
Returns
Value of found property in the map

◆ hidden()

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::hidden ( bool  value = true)
inherited

Set whether the field is hidden.

Returns
reference to derived class

◆ hiddenWhenReadOnly()

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::hiddenWhenReadOnly ( bool  value = true)
inherited

Set whether the field must be hidden when cannot be modified.

Returns
reference to derived class

◆ name() [1/2]

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::name ( const char *  value)
inherited

Set name value.

Returns
reference to derived class

◆ name() [2/2]

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::name ( const QString &  value)
inherited

Set name value.

Returns
reference to derived class

◆ readOnly()

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::readOnly ( bool  value = true)
inherited

Set whether the field cannot be modified.

Returns
reference to derived class

◆ serialisedHidden()

FloatValue & cc_tools_qt::property::field::CommonBase< FloatValue >::serialisedHidden ( bool  value = true)
inherited

Set whether the serialised part is hidden.

Returns
reference to derived class

◆ setElemTo()

template<typename U >
static void cc_tools_qt::property::field::Common::setElemTo ( U &&  val,
const QString &  name,
QVariantMap &  props 
)
staticprotectedinherited

set element value to the map

Parameters
[in]valValue to set
[in]nameName of the property
[in,out]propsMap to update

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