QMetaEnum 类提供有关枚举器的元数据。 更多...
QMetaEnum 类提供有关枚举器的元数据。
使用 name () 为 enumerator's name. The enumerator's keys (names of each enumerated item) are returned by key ();使用 keyCount () to find the number of keys. isFlag () 返回 whether the enumerator is meant to be used as a flag, meaning that its values can be combined using the OR operator.
The conversion functions keyToValue (), valueToKey (), keysToValue (),和 valueToKeys () allow conversion between the integer representation of an enumeration or set value and its literal representation. The scope () function returns the class scope this enumerator was declared in.
Returns true if this enumerator is used as a flag; otherwise returns false.
When used as flags, enumerators can be combined using the OR operator.
另请参阅 keysToValue () 和 valueToKeys ().
Returns true if this enum is valid (has a name); otherwise returns false.
另请参阅 name ().
Returns the key with the given index , or 0 if no such key exists.
另请参阅 keyCount (), value (),和 valueToKey ().
返回键数。
另请参阅 key ().
Returns the value derived from combining together the values of the keys using the OR operator, or -1 if keys 不是 defined. Note that the strings in keys 必须是 '|'-separated.
另请参阅 isFlag (), valueToKey (),和 valueToKeys ().
Returns the integer value of the given enumeration key , or -1 if key is not defined.
For flag types, use keysToValue ().
另请参阅 valueToKey (), isFlag (),和 keysToValue ().
Returns the name of the enumerator (without the scope).
例如, Qt.AlignmentFlag enumeration has AlignmentFlag as the name and Qt as the scope.
Returns the scope this enumerator was declared in.
例如, Qt.AlignmentFlag enumeration has Qt as the scope and AlignmentFlag 作为 name.
另请参阅 name ().
Returns the value with the given index ; or returns -1 if there is no such value.
另请参阅 keyCount (), key (),和 keyToValue ().
Returns the string that is used as the name of the given enumeration value , or 0 if value is not defined.
For flag types, use valueToKeys ().
另请参阅 isFlag () 和 valueToKeys ().
Returns a byte array of '|'-separated keys that represents the given value .
另请参阅 isFlag (), valueToKey (),和 keysToValue ().