6#ifndef SWIFT_MISC_PQ_PQSTRING_H
7#define SWIFT_MISC_PQ_PQSTRING_H
19namespace swift::misc::physical_quantities
54 static CVariant parseToVariant(
const QString &value, SeparatorMode mode = SeparatorQtDefault);
71 return qv.
value<PQ>();
77 static double parseNumber(
const QString &number,
bool &success, SeparatorMode mode = SeparatorBestGuess);
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
T value() const
Return the value converted to the type T.
bool isNull() const
True if this variant is null.
bool canConvert(int typeId) const
True if this variant can be converted to the type with the given metatype ID.
Represents a physical quantity by a string.
static CVariant parseToVariant(const QString &value, SeparatorMode mode=SeparatorQtDefault)
Parse a string value like "100m", "10.3Mhz".
static PQ parse(const QString &value, SeparatorMode mode=SeparatorQtDefault)
Parse into concrete type.
SeparatorMode
Number separators / group separators.
@ SeparatorLocale
depending on QLocale, e.g.
@ SeparatorBestGuess
try to figure out
@ SeparatorQtDefault
100000.00 no group separator
CPqString()=default
Default constructor.
CPqString(const QString &value)
Constructor, for values such as 10km/h.
QString convertToQString(bool i18n=false) const
Cast as QString.
SeparatorIndex
Group and digit separator.
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...