Fix Geometry meta enum for static methods
parent
1b59cbc37c
commit
d2fd74a8c4
|
@ -1,7 +1,6 @@
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
|
|
||||||
|
|
||||||
const QMetaEnum Geometry::metaEnumFormat = QMetaEnum::fromType<Geometry::Format>();
|
|
||||||
const QRegularExpression Geometry::corners = QRegularExpression("(-?\\d*),(-?\\d*):(-?\\d*),(-?\\d*)");
|
const QRegularExpression Geometry::corners = QRegularExpression("(-?\\d*),(-?\\d*):(-?\\d*),(-?\\d*)");
|
||||||
const QRegularExpression Geometry::centerDimension = QRegularExpression("(-?\\d*),(-?\\d*):(-?\\d*)x(-?\\d*)");
|
const QRegularExpression Geometry::centerDimension = QRegularExpression("(-?\\d*),(-?\\d*):(-?\\d*)x(-?\\d*)");
|
||||||
const QRegularExpression Geometry::cornerDimension = QRegularExpression("(-?\\d*)[,:](-?\\d*)[+-](-?\\d*)[+-](-?\\d*)");
|
const QRegularExpression Geometry::cornerDimension = QRegularExpression("(-?\\d*)[,:](-?\\d*)[+-](-?\\d*)[+-](-?\\d*)");
|
||||||
|
@ -11,7 +10,7 @@ const char *Geometry::formatName(Geometry::Format id)
|
||||||
{
|
{
|
||||||
if (id < Geometry::FormatNone || id >= Geometry::FormatMax)
|
if (id < Geometry::FormatNone || id >= Geometry::FormatMax)
|
||||||
id = Geometry::FormatUnknown;
|
id = Geometry::FormatUnknown;
|
||||||
return metaEnumFormat.key(id);
|
return QMetaEnum::fromType<Geometry::Format>().key(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry::Format Geometry::formatId(const QString &name)
|
Geometry::Format Geometry::formatId(const QString &name)
|
||||||
|
@ -22,7 +21,7 @@ Geometry::Format Geometry::formatId(const QString &name)
|
||||||
Geometry::Format Geometry::formatId(const char *name)
|
Geometry::Format Geometry::formatId(const char *name)
|
||||||
{
|
{
|
||||||
// keyToValue returns -1 for not found, which equals FormatUnknown
|
// keyToValue returns -1 for not found, which equals FormatUnknown
|
||||||
return static_cast<Format>(metaEnumFormat.keyToValue(name));
|
return static_cast<Format>(QMetaEnum::fromType<Geometry::Format>().keyToValue(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry::Format Geometry::set(const QString &str)
|
Geometry::Format Geometry::set(const QString &str)
|
||||||
|
|
|
@ -23,7 +23,6 @@ public:
|
||||||
FormatMax
|
FormatMax
|
||||||
};
|
};
|
||||||
Q_ENUM(Format)
|
Q_ENUM(Format)
|
||||||
static const QMetaEnum metaEnumFormat;
|
|
||||||
|
|
||||||
static const char *formatName(Geometry::Format id);
|
static const char *formatName(Geometry::Format id);
|
||||||
static Geometry::Format formatId(const QString &name);
|
static Geometry::Format formatId(const QString &name);
|
||||||
|
|
Loading…
Reference in New Issue