#include <QList>
#include <QString>
#include <QStringList>
#include <quark/EnumTraitsImpl.h++>
Go to the source code of this file.
◆ QUARK_DECLARE_ENUM_TRAITS
| #define QUARK_DECLARE_ENUM_TRAITS |
( |
|
TYPE, |
|
|
|
DEFAULT_VALUE, |
|
|
|
INVALID_VALUE, |
|
|
|
VALUE_LIST, |
|
|
|
LABEL_LIST |
|
) |
| |
Value:namespace quark {
namespace util { \
template<> EnumMap<TYPE> EnumTraits<TYPE>::_map(DEFAULT_VALUE, \
INVALID_VALUE, VALUE_LIST, LABEL_LIST); \
} }
Definition: BarChartView.h++:6
Registers the metadata for an enum type so that it can be used with the quark::util::EnumTraits template.
For example:
enum Direction { DirInvalid = -1, DirNone = 0, DirNorth, DirEast, DirSouth,
DirWest };QUARK_DECLARE_ENUM_TRAITS(Direction, DirNone, DirInvalid,
(QList<Direction>() << DirNone << DirNorth << DirEast << DirSouth
<< DirWest),
(QStringList() << "None" << "North" << "East" << "South" << "West"));
- Parameters
-
| TYPE | The enum type. |
| DEFAULT_VALUE | The "default" value for the enum type. |
| INVALID_VALUE | The "invalid" value for the enum type. |
| VALUE_LIST | A QList<E> containing the valid enum values for the enum type. |
| LABEL_LIST | A QStringList containing the labels for the valid values for the enum type. |