QMetaEnumBuilder Class
The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder. More...
| Header: | #include <QMetaEnumBuilder> |
Public Functions
| int | addKey(const QByteArray &name, int value) |
| QByteArray | enumName() const |
| bool | isFlag() const |
| bool | isScoped() const |
| QByteArray | key(int index) const |
| int | keyCount() const |
| QMetaType | metaType() const |
| QByteArray | name() const |
| void | removeKey(int index) |
| void | setEnumName(const QByteArray &alias) |
| void | setIsFlag(bool value) |
| void | setIsScoped(bool value) |
| void | setMetaType(QMetaType metaType) |
| int | value(int index) const |
Detailed Description
\inmoduleQtCore \internal
Member Function Documentation
int QMetaEnumBuilder::addKey(const QByteArray &name, int value)
Adds a new key called name to this enumerator, associated with value. Returns the index of the new key.
See also keyCount(), key(), value(), and removeKey().
QByteArray QMetaEnumBuilder::enumName() const
Returns the enum name of the enumerator (without the scope).
\since5.12
See also setEnumName().
bool QMetaEnumBuilder::isFlag() const
Returns true if this enumerator is used as a flag; otherwise returns false.
See also setIsFlag().
bool QMetaEnumBuilder::isScoped() const
Return true if this enumerator should be considered scoped (C++11 enum class).
See also setIsScoped().
QByteArray QMetaEnumBuilder::key(int index) const
Returns the key with the given index, or an empty QByteArray if no such key exists.
See also keyCount(), addKey(), and value().
int QMetaEnumBuilder::keyCount() const
Returns the number of keys.
QMetaType QMetaEnumBuilder::metaType() const
Returns the meta type of the enumerator.
\since6.6
See also setMetaType().
QByteArray QMetaEnumBuilder::name() const
Returns the type name of the enumerator (without the scope).
void QMetaEnumBuilder::removeKey(int index)
Removes the key at index from this enumerator.
See also addKey().
void QMetaEnumBuilder::setEnumName(const QByteArray &alias)
Sets this enumerator to have the enum name alias.
\since5.12
See also isFlag() and enumName().
void QMetaEnumBuilder::setIsFlag(bool value)
Sets this enumerator to be used as a flag if value is true.
See also isFlag().
void QMetaEnumBuilder::setIsScoped(bool value)
Sets this enumerator to be a scoped enum if
| Constant | Description |
|---|---|
is | true |
See also isScoped().
void QMetaEnumBuilder::setMetaType(QMetaType metaType)
Sets this enumerator to have the given metaType.
\since6.6
See also metaType().
int QMetaEnumBuilder::value(int index) const
Returns the value with the given index; or returns -1 if there is no such value.