swift
|
Physical unit frequency. More...
Public Member Functions | |
CFrequency () | |
Default constructor. | |
CFrequency (double value, const CFrequencyUnit &unit) | |
Init by double value. | |
CFrequency (int value, const CFrequencyUnit &unit) | |
Init by int value converted to double. | |
CFrequency (const QString &unitString) | |
Constructor by parsed string, e.g. 10m. More... | |
![]() | |
int | compare (const CFrequency &other) const |
Compare with other PQ. | |
const CFrequencyUnit & | getUnit () const |
Unit. | |
void | setUnit (const CFrequencyUnit &unit) |
Simply set unit, do no calclulate conversion. More... | |
void | setUnitBySymbol (const QString &unitName) |
Set unit by string. | |
QString | getUnitSymbol () const |
Unit. | |
CFrequency & | switchUnit (const CFrequencyUnit &newUnit) |
Change unit, and convert value to maintain the same quantity. | |
CFrequency | switchedUnit (const CFrequencyUnit &newUnit) const |
Return copy with switched unit. | |
bool | isNull () const |
Is quantity null? | |
void | setNull () |
Set null. | |
double | value (CFrequencyUnit unit) const |
Value in given unit. | |
double | value () const |
Value in current unit. | |
void | setCurrentUnitValue (double value) |
Set value in current unit. | |
int | valueInteger (CFrequencyUnit unit) const |
As integer value. | |
int | valueInteger () const |
As integer value in current unit. | |
QString | valueIntegerAsString (CFrequencyUnit unit) const |
As integer value. | |
QString | valueIntegerAsString () const |
As integer value in current unit. | |
bool | isInteger () const |
Is value an integer. | |
double | valueRounded (CFrequencyUnit unit, int digits=-1) const |
Rounded value in given unit. More... | |
double | valueRounded (int digits=-1) const |
Rounded value in current unit. More... | |
QString | valueRoundedAsString (CFrequencyUnit unit, int digits=-1) const |
Rounded value in given unit. More... | |
QString | valueRoundedWithUnit (const CFrequencyUnit &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
Value to QString with the given unit, e.g. "5.00m". More... | |
QString | valueRoundedWithUnit (int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
Value to QString with the current unit, e.g. "5.00m". More... | |
void | roundToEpsilon () |
Round current value in current unit to epsilon. More... | |
void | setValueSameUnit (double value) |
Change value without changing unit. | |
void | addValueSameUnit (double value) |
Add to the value in the current unit. | |
void | substractValueSameUnit (double value) |
Substract from the value in the current unit. | |
CPhysicalQuantity & | operator*= (double multiply) |
Multiply operator *=. | |
CPhysicalQuantity & | operator/= (double divide) |
Divide operator /=. | |
CFrequency | operator* (double multiply) const |
Operator *. | |
CFrequency | operator/ (double divide) const |
Operator /. | |
CFrequency | operator- () const |
Unary operator -. | |
CPhysicalQuantity & | operator+= (const CPhysicalQuantity &other) |
Plus operator +=. | |
CPhysicalQuantity & | operator-= (const CPhysicalQuantity &other) |
Minus operator-=. | |
bool | isZeroEpsilonConsidered () const |
Quantity value <= epsilon. | |
bool | isPositiveWithEpsilonConsidered () const |
Value >= 0 epsilon considered. | |
bool | isNegativeWithEpsilonConsidered () const |
Value <= 0 epsilon considered. | |
const CFrequency & | makePositive () |
Make value always positive. | |
const CFrequency & | makeNegative () |
Make value always negative. | |
CFrequency | abs () const |
Absolute value (always >=0) | |
void | marshallToDbus (QDBusArgument &argument) const |
Marshall without begin/endStructure, for when composed within another object. More... | |
void | marshallToDbus (QDBusArgument &argument, LosslessTag) const |
Marshal to DBus, preserving the measurement unit. | |
void | unmarshallFromDbus (const QDBusArgument &argument) |
Unmarshall without begin/endStructure, for when composed within another object. More... | |
void | unmarshallFromDbus (const QDBusArgument &argument, LosslessTag) |
Unmarshal from DBus, with preserved measurement unit. | |
void | marshalToDataStream (QDataStream &stream) const |
Marshal a value to a QDataStream. More... | |
void | unmarshalFromDataStream (QDataStream &stream) |
Unmarshal a value from a QDataStream. More... | |
size_t | getValueHash () const |
qHash overload, needed for storing value in a QSet. More... | |
QJsonObject | toJson () const |
Cast to JSON object. More... | |
void | convertFromJson (const QJsonObject &json) |
Assign from JSON object. More... | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const CFrequency &pq) const |
Compare for index. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
void | parseFromString (const QString &value) |
Parse value from string. | |
void | parseFromString (const QString &value, CPqString::SeparatorMode mode) |
Parse to string, with specified separator. | |
void | parseFromString (const QString &value, CPqString::SeparatorMode mode, const CFrequencyUnit &defaultUnitIfMissing) |
Parse to string, with specified separator. | |
![]() | |
CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
Update by variant map. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. | |
int | comparePropertyByIndex (CPropertyIndexRef index, const Derived &compareValue) const |
Compare for index. | |
bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
Is given variant equal to value of property index? | |
![]() | |
int | getMetaTypeId () const |
Returns the Qt meta type ID of this object. More... | |
QString | getClassName () const |
Class name. | |
bool | isA (int metaTypeId) const |
Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
![]() | |
QString | toQString (bool i18n=false) const |
Cast as QString. | |
std::string | toStdString (bool i18n=false) const |
To std string. | |
QString | stringForStreaming () const |
String for streaming operators. | |
![]() | |
CIcons::IconIndex | toIcon () const |
As icon, not implemented by all classes. | |
Additional Inherited Members | |
![]() | |
enum | ColumnIndex |
Index. | |
![]() | |
enum | ColumnIndex { IndexPixmap = 10 , IndexIcon , IndexString } |
Base class enums. | |
![]() | |
static int | compare (const CFrequency &a, const CFrequency &b) |
Implementation of compare. | |
static const CFrequency & | maxValue (const CFrequency &pq1, const CFrequency &pq2) |
Maximum of 2 quantities. | |
static const CFrequency & | minValue (const CFrequency &pq1, const CFrequency &pq2) |
Minimum of 2 quantities. | |
static const CFrequency & | null () |
NULL PQ. | |
static CFrequency | parsedFromString (const QString &value, CPqString::SeparatorMode mode=CPqString::SeparatorBestGuess) |
Parsed from given string. | |
static CFrequency | parsedFromString (const QString &value, CPqString::SeparatorMode mode, const CFrequencyUnit &defaultUnitIfMissing) |
Parsed from given string. | |
![]() | |
static void | registerMetadata () |
Register metadata. | |
![]() | |
CPhysicalQuantity (double value, CFrequencyUnit unit) | |
Constructor with double. | |
CPhysicalQuantity (const QString &unitString) | |
Constructor by parsed string, e.g. 10m. | |
Physical unit frequency.
Definition at line 17 of file frequency.h.
|
inline |
Constructor by parsed string, e.g. 10m.
Definition at line 30 of file frequency.h.