Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMetaEnumBuilder Class Reference

\inmodule QtCore More...

#include <qmetaobjectbuilder_p.h>

+ Collaboration diagram for QMetaEnumBuilder:

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.
 
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.
 
int addKey (const QByteArray &name, int value)
 Adds a new key called name to this enumerator, associated with value.
 
void removeKey (int index)
 Removes the key at index from this enumerator.
 

Friends

class QMetaObjectBuilder
 

Detailed Description

\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.

Constructor & Destructor Documentation

◆ QMetaEnumBuilder()

QMetaEnumBuilder::QMetaEnumBuilder ( )
inline

Definition at line 252 of file qmetaobjectbuilder_p.h.

Member Function Documentation

◆ addKey()

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(), removeKey()

Definition at line 2437 of file qmetaobjectbuilder.cpp.

References d, index(), and name().

Referenced by QQmlPropertyCache::toMetaObjectBuilder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enumName()

QByteArray QMetaEnumBuilder::enumName ( ) const

Returns the enum name of the enumerator (without the scope).

Since
5.12

Definition at line 2288 of file qmetaobjectbuilder.cpp.

References d, and QByteArray().

+ Here is the call graph for this function:

◆ index()

int QMetaEnumBuilder::index ( ) const
inline

Returns the index of this enumerator within its QMetaObjectBuilder.

Definition at line 254 of file qmetaobjectbuilder_p.h.

Referenced by addKey(), key(), and value().

+ Here is the caller graph for this function:

◆ isFlag()

bool QMetaEnumBuilder::isFlag ( ) const

Returns true if this enumerator is used as a flag; otherwise returns false.

See also
setIsFlag()

Definition at line 2341 of file qmetaobjectbuilder.cpp.

References d.

◆ isScoped()

bool QMetaEnumBuilder::isScoped ( ) const

Return true if this enumerator should be considered scoped (C++11 enum class).

See also
setIsScoped()

Definition at line 2367 of file qmetaobjectbuilder.cpp.

References d.

◆ key()

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(), value()

Definition at line 2407 of file qmetaobjectbuilder.cpp.

References d, index(), keys, and QByteArray().

+ Here is the call graph for this function:

◆ keyCount()

int QMetaEnumBuilder::keyCount ( ) const

Returns the number of keys.

See also
key(), addKey()

Definition at line 2392 of file qmetaobjectbuilder.cpp.

References d.

◆ metaType()

QMetaType QMetaEnumBuilder::metaType ( ) const

Returns the meta type of the enumerator.

Since
6.6

Definition at line 2315 of file qmetaobjectbuilder.cpp.

References d.

Referenced by setMetaType().

+ Here is the caller graph for this function:

◆ name()

QByteArray QMetaEnumBuilder::name ( ) const

Returns the type name of the enumerator (without the scope).

Definition at line 2274 of file qmetaobjectbuilder.cpp.

References d, and QByteArray().

Referenced by addKey(), and QMetaObjectBuilder::indexOfEnumerator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeKey()

void QMetaEnumBuilder::removeKey ( int index)

Removes the key at index from this enumerator.

See also
addKey()

Definition at line 2455 of file qmetaobjectbuilder.cpp.

References d, and keys.

◆ setEnumName()

void QMetaEnumBuilder::setEnumName ( const QByteArray & alias)

Sets this enumerator to have the enum name alias.

Since
5.12
See also
isFlag(), enumName()

Definition at line 2303 of file qmetaobjectbuilder.cpp.

References d.

◆ setIsFlag()

void QMetaEnumBuilder::setIsFlag ( bool value)

Sets this enumerator to be used as a flag if value is true.

See also
isFlag()

Definition at line 2355 of file qmetaobjectbuilder.cpp.

References d.

◆ setIsScoped()

void QMetaEnumBuilder::setIsScoped ( bool value)

Sets this enumerator to be a scoped enum if \value is true.

See also
isScoped()

Definition at line 2380 of file qmetaobjectbuilder.cpp.

References d.

Referenced by QQmlPropertyCache::toMetaObjectBuilder().

+ Here is the caller graph for this function:

◆ setMetaType()

void QMetaEnumBuilder::setMetaType ( QMetaType metaType)

Sets this enumerator to have the given metaType.

Since
6.6
See also
metaType()

Definition at line 2328 of file qmetaobjectbuilder.cpp.

References d, and metaType().

+ Here is the call graph for this function:

◆ value()

int QMetaEnumBuilder::value ( int index) const

Returns the value with the given index; or returns -1 if there is no such value.

See also
keyCount(), addKey(), key()

Definition at line 2422 of file qmetaobjectbuilder.cpp.

References d, index(), and keys.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QMetaObjectBuilder

friend class QMetaObjectBuilder
friend

Definition at line 281 of file qmetaobjectbuilder_p.h.


The documentation for this class was generated from the following files: