Qt 4.8
Public Types | Public Functions | Static Public Functions | Private Functions | Properties | List of all members
QScript::QScriptMetaType Class Reference

Public Types

enum  Kind {
  Invalid, Variant, MetaType, Unresolved,
  MetaEnum
}
 

Public Functions

int enumeratorIndex () const
 
bool isMetaEnum () const
 
bool isMetaType () const
 
bool isUnresolved () const
 
bool isValid () const
 
bool isVariant () const
 
Kind kind () const
 
QByteArray name () const
 
bool operator== (const QScriptMetaType &other) const
 
 QScriptMetaType ()
 
int typeId () const
 

Static Public Functions

static QScriptMetaType metaEnum (int enumIndex, const QByteArray &name)
 
static QScriptMetaType metaType (int typeId, const QByteArray &name)
 
static QScriptMetaType unresolved (const QByteArray &name)
 
static QScriptMetaType variant ()
 

Private Functions

 QScriptMetaType (Kind kind, int typeId=0, const QByteArray &name=QByteArray())
 

Properties

Kind m_kind
 
QByteArray m_name
 
int m_typeId
 

Detailed Description

Definition at line 364 of file qscriptqobject.cpp.

Enumerations

◆ Kind

Constructors and Destructors

◆ QScriptMetaType() [1/2]

QScript::QScriptMetaType::QScriptMetaType ( )
inline

◆ QScriptMetaType() [2/2]

QScript::QScriptMetaType::QScriptMetaType ( Kind  kind,
int  typeId = 0,
const QByteArray name = QByteArray() 
)
inlineprivate

Functions

◆ enumeratorIndex()

int QScript::QScriptMetaType::enumeratorIndex ( ) const
inline

Definition at line 400 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

401  { Q_ASSERT(isMetaEnum()); return m_typeId; }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ isMetaEnum()

bool QScript::QScriptMetaType::isMetaEnum ( ) const
inline

◆ isMetaType()

bool QScript::QScriptMetaType::isMetaType ( ) const
inline

◆ isUnresolved()

bool QScript::QScriptMetaType::isUnresolved ( ) const
inline

◆ isValid()

bool QScript::QScriptMetaType::isValid ( ) const
inline

◆ isVariant()

bool QScript::QScriptMetaType::isVariant ( ) const
inline

◆ kind()

Kind QScript::QScriptMetaType::kind ( ) const
inline

Definition at line 378 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

379  { return m_kind; }

◆ metaEnum()

static QScriptMetaType QScript::QScriptMetaType::metaEnum ( int  enumIndex,
const QByteArray name 
)
inlinestatic

Definition at line 414 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

◆ metaType()

static QScriptMetaType QScript::QScriptMetaType::metaType ( int  typeId,
const QByteArray name 
)
inlinestatic

◆ name()

QByteArray QScript::QScriptMetaType::name ( ) const

Definition at line 436 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

437 {
438  if (!m_name.isEmpty())
439  return m_name;
440  else if (m_kind == Variant)
441  return "QVariant";
442  return QMetaType::typeName(typeId());
443 }
static const char * typeName(int type)
Returns the type name associated with the given type, or 0 if no matching type was found...
Definition: qmetatype.cpp:406
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421

◆ operator==()

bool QScript::QScriptMetaType::operator== ( const QScriptMetaType other) const
inline

Definition at line 403 of file qscriptqobject.cpp.

404  {
405  return (m_kind == other.m_kind) && (m_typeId == other.m_typeId);
406  }

◆ typeId()

int QScript::QScriptMetaType::typeId ( ) const

Definition at line 429 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

430 {
431  if (isVariant())
432  return QMetaType::type("QVariant");
433  return isMetaEnum() ? 2/*int*/ : m_typeId;
434 }
static int type(const char *typeName)
Returns a handle to the type called typeName, or 0 if there is no such type.
Definition: qmetatype.cpp:607

◆ unresolved()

static QScriptMetaType QScript::QScriptMetaType::unresolved ( const QByteArray name)
inlinestatic

Definition at line 417 of file qscriptqobject.cpp.

Referenced by QScript::callQtMethod().

◆ variant()

static QScriptMetaType QScript::QScriptMetaType::variant ( )
inlinestatic

Properties

◆ m_kind

Kind QScript::QScriptMetaType::m_kind
private

Definition at line 424 of file qscriptqobject.cpp.

Referenced by operator==().

◆ m_name

QByteArray QScript::QScriptMetaType::m_name
private

Definition at line 426 of file qscriptqobject.cpp.

◆ m_typeId

int QScript::QScriptMetaType::m_typeId
private

Definition at line 425 of file qscriptqobject.cpp.

Referenced by operator==().


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