![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qmetaobjectbuilder_p.h>
Public Member Functions | |
QMetaEnumBuilder () | |
int | index () const |
Returns the index of this enumerator within its QMetaObjectBuilder. | |
QByteArray | name () const |
Returns the type name of the enumerator (without the scope). | |
QByteArray | enumName () const |
Returns the enum name of the enumerator (without the scope). | |
void | setEnumName (const QByteArray &alias) |
Sets this enumerator to have the enum name alias . | |
QMetaType | metaType () const |
Returns the meta type of the enumerator. | |
void | setMetaType (QMetaType metaType) |
Sets this enumerator to have the given metaType . | |
bool | isFlag () const |
Returns true if this enumerator is used as a flag; otherwise returns false. | |
void | setIsFlag (bool value) |
Sets this enumerator to be used as a flag if value is true. | |
bool | isScoped () const |
Return true if this enumerator should be considered scoped (C++11 enum class). | |
void | setIsScoped (bool value) |
Sets this enumerator to be a scoped enum if \value is true. | |
bool | is64Bit () const |
Return true if this enumerations in this enumerator are 64-bit. | |
void | setIs64Bit (bool value) |
Sets this enumerator to be 64-bit wide if value is true. | |
int | keyCount () const |
Returns the number of keys. | |
QByteArray | key (int index) const |
Returns the key with the given index, or an empty QByteArray if no such key exists. | |
int | value (int index) const |
Returns the value with the given index; or returns -1 if there is no such value. | |
std::optional< quint64 > | value64 (int index) const |
int | addKey (const QByteArray &name, int value) |
Adds a new key called name to this enumerator, associated with value. | |
int | addKey (const QByteArray &name, quint64 value) |
void | removeKey (int index) |
Removes the key at index from this enumerator. | |
Friends | |
class | QMetaObjectBuilder |
\inmodule QtCore
The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder.
Definition at line 249 of file qmetaobjectbuilder_p.h.
|
inline |
Definition at line 252 of file qmetaobjectbuilder_p.h.
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.
Definition at line 2511 of file qmetaobjectbuilder.cpp.
int QMetaEnumBuilder::addKey | ( | const QByteArray & | name, |
quint64 | value ) |
Adds a new key called name to this enumerator, associated with value. Returns the index of the new key.
Using the 64-bit version of this function automatically makes this enumeration be stored as 64-bit.
Definition at line 2532 of file qmetaobjectbuilder.cpp.
QByteArray QMetaEnumBuilder::enumName | ( | ) | const |
Returns the enum name of the enumerator (without the scope).
Definition at line 2306 of file qmetaobjectbuilder.cpp.
|
inline |
Returns the index of this enumerator within its QMetaObjectBuilder.
Definition at line 254 of file qmetaobjectbuilder_p.h.
bool QMetaEnumBuilder::is64Bit | ( | ) | const |
Return true
if this enumerations in this enumerator are 64-bit.
This flag is autoamtically enabled if a 64-bit value is added with addKey().
Definition at line 2415 of file qmetaobjectbuilder.cpp.
bool QMetaEnumBuilder::isFlag | ( | ) | const |
Returns true
if this enumerator is used as a flag; otherwise returns false.
Definition at line 2362 of file qmetaobjectbuilder.cpp.
bool QMetaEnumBuilder::isScoped | ( | ) | const |
Return true
if this enumerator should be considered scoped (C++11 enum class).
Definition at line 2388 of file qmetaobjectbuilder.cpp.
QByteArray QMetaEnumBuilder::key | ( | int | index | ) | const |
Returns the key with the given index, or an empty QByteArray if no such key exists.
Definition at line 2458 of file qmetaobjectbuilder.cpp.
int QMetaEnumBuilder::keyCount | ( | ) | const |
Returns the number of keys.
Definition at line 2443 of file qmetaobjectbuilder.cpp.
QMetaType QMetaEnumBuilder::metaType | ( | ) | const |
Returns the meta type of the enumerator.
Definition at line 2333 of file qmetaobjectbuilder.cpp.
QByteArray QMetaEnumBuilder::name | ( | ) | const |
Returns the type name of the enumerator (without the scope).
Definition at line 2292 of file qmetaobjectbuilder.cpp.
void QMetaEnumBuilder::removeKey | ( | int | index | ) |
Removes the key at index from this enumerator.
Definition at line 2547 of file qmetaobjectbuilder.cpp.
void QMetaEnumBuilder::setEnumName | ( | const QByteArray & | alias | ) |
Sets this enumerator to have the enum name alias
.
Definition at line 2321 of file qmetaobjectbuilder.cpp.
void QMetaEnumBuilder::setIs64Bit | ( | bool | value | ) |
Sets this enumerator to be 64-bit wide if value is true.
If value is false, any stored 64-bit keys will be truncated to 32 bits.
This flag is autoamtically enabled if a 64-bit value is added with addKey().
Definition at line 2431 of file qmetaobjectbuilder.cpp.
void QMetaEnumBuilder::setIsFlag | ( | bool | value | ) |
Sets this enumerator to be used as a flag if value is true.
Definition at line 2376 of file qmetaobjectbuilder.cpp.
void QMetaEnumBuilder::setIsScoped | ( | bool | value | ) |
Sets this enumerator to be a scoped enum if \value is true.
Definition at line 2401 of file qmetaobjectbuilder.cpp.
Sets this enumerator to have the given metaType
.
The is64Bit() flag will be set to match metaType's size.
Definition at line 2347 of file qmetaobjectbuilder.cpp.
int QMetaEnumBuilder::value | ( | int | index | ) | const |
Returns the value with the given index; or returns -1 if there is no such value.
If this is a 64-bit enumeration (see is64Bit()), this function returns the low 32-bit portion of the value. Use value64() to obtain the full value instead.
Definition at line 2477 of file qmetaobjectbuilder.cpp.
std::optional< quint64 > QMetaEnumBuilder::value64 | ( | int | index | ) | const |
Returns the value with the given index if it exists; or returns a disengaged {std::optional} if it doesn't.
qmetaenum-32bit-signextend-64bit
Definition at line 2492 of file qmetaobjectbuilder.cpp.
|
friend |
Definition at line 286 of file qmetaobjectbuilder_p.h.