Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QMetaType Class Reference

The QMetaType class manages named types in the meta-object system. More...

Inheritance diagram for QtCore.QMetaType:
Collaboration diagram for QtCore.QMetaType:

Public Types

enum  Type {
  Bool = 1, Char = 131, Double = 6, FirstCoreExtType = 128,
  FirstGuiType = 63, Float = 135, Int = 2, LastCoreExtType = 138,
  LastCoreType = 29, LastGuiType = 86, Long = 129, LongLong = 4,
  QBitArray = 13, QBitmap = 73, QBrush = 66, QByteArray = 12,
  QChar = 7, QColor = 67, QCursor = 74, QDate = 14,
  QDateTime = 16, QEasingCurve = 29, QFont = 64, QIcon = 69,
  QImage = 70, QKeySequence = 76, QLine = 23, QLineF = 24,
  QLocale = 18, QMatrix = 80, QMatrix4x4 = 82, QObjectStar = 136,
  QPalette = 68, QPen = 77, QPixmap = 65, QPoint = 25,
  QPointF = 26, QPolygon = 71, QQuaternion = 86, QReal = 6,
  QRect = 19, QRectF = 20, QRegExp = 27, QRegion = 72,
  QSize = 21, QSizeF = 22, QSizePolicy = 75, QString = 10,
  QStringList = 11, QTextFormat = 79, QTextLength = 78, QTime = 15,
  QTransform = 81, QUrl = 17, QVariant = 138, QVariantHash = 28,
  QVariantList = 9, QVariantMap = 8, QVector2D = 83, QVector3D = 84,
  QVector4D = 85, QWidgetStar = 137, Short = 130, UChar = 134,
  UInt = 3, ULong = 132, ULongLong = 5, UShort = 133,
  User = 256, Void = 0, VoidStar = 128
}
  More...
 

Public Member Functions

 QMetaType ()
 
 QMetaType (QMetaType copy)
 
virtual void CreateProxy ()
 
new void Dispose ()
 

Static Public Member Functions

static bool IsRegistered (int type)
 
 
static int RegisterTypedef (string typeName, int aliasId)
 
static int type (string typeName)
 
 
static string TypeName (int type)
 
 
static void UnregisterType (string typeName)
 
 

Protected Member Functions

 QMetaType (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QMetaType class manages named types in the meta-object system.

The class is used as a helper to marshall types in QVariant and in queued signals and slots connections. It associates a type name to a type so that it can be created and destructed dynamically at run-time. Declare new types with Q_DECLARE_METATYPE() to make them available to QVariant and other template-based functions. Call qRegisterMetaType() to make type available to non-template based functions, such as the queued signal and slot connections.

Any class or struct that has a public default constructor, a public copy constructor, and a public destructor can be registered.

The following code allocates and destructs an instance of MyClass:

int id = QMetaType::type("MyClass");

if (id != 0) {

void *myClassPtr = QMetaType::construct(id);

...

QMetaType::destroy(id, myClassPtr);

myClassPtr = 0;

}

If we want the stream operators operator<<() and operator>>() to work on QVariant objects that store custom types, the custom type must provide operator<<() and operator>>() operators.

See also Q_DECLARE_METATYPE(), QVariant::setValue(), QVariant::value(), and QVariant::fromValue().

Member Enumeration Documentation

These are the built-in types supported by QMetaType:

Additional types can be registered using Q_DECLARE_METATYPE().

See also type() and typeName().

Enumerator:
Bool 

Bool

Char 

Char

Double 

Double

FirstCoreExtType 
FirstGuiType 
Float 

Float

Int 

Int

LastCoreExtType 
LastCoreType 
LastGuiType 
Long 

Long

LongLong 

LongLong

QBitArray 

QBitArray

QBitmap 

QBitmap

QBrush 

QBrush

QByteArray 

QByteArray

QChar 

QChar

QColor 

QColor

QCursor 

QCursor

QDate 

QDate

QDateTime 

QDateTime

QEasingCurve 

QEasingCurve

QFont 

QFont

QIcon 

QIcon

QImage 

QImage

QKeySequence 

QKeySequence

QLine 

QLine

QLineF 

QLineF

QLocale 

QLocale

QMatrix 

QMatrix

QMatrix4x4 

QMatrix4x4

QObjectStar 

QObject *

QPalette 

QPalette

QPen 

QPen

QPixmap 

QPixmap

QPoint 

QPoint

QPointF 

QPointF

QPolygon 

QPolygon

QQuaternion 

QQuaternion

QReal 
QRect 

QRect

QRectF 

QRectF

QRegExp 

QRegExp

QRegion 

QRegion

QSize 

QSize

QSizeF 

QSizeF

QSizePolicy 

QSizePolicy

QString 

QString

QStringList 

QStringList

QTextFormat 

QTextFormat

QTextLength 

QTextLength

QTime 

QTime

QTransform 

QTransform

QUrl 

QUrl

QVariant 

QVariant

QVariantHash 

QVariantHash

QVariantList 

QVariantList

QVariantMap 

QVariantMap

QVector2D 

QVector2D

QVector3D 

QVector3D

QVector4D 

QVector4D

QWidgetStar 

QWidget *

Short 

Short

UChar 

Unsigned char

UInt 

Unsigned int

ULong 

Unsigned long

ULongLong 

ULongLong

UShort 

Unsigned short

User 

Base value for user types

Void 

Void

VoidStar 

Void *

Constructor & Destructor Documentation

QtCore.QMetaType.QMetaType ( System.Type  dummy)
protected
QtCore.QMetaType.QMetaType ( )
QtCore.QMetaType.QMetaType ( QMetaType  copy)

Member Function Documentation

virtual void QtCore.QMetaType.CreateProxy ( )
virtual
new void QtCore.QMetaType.Dispose ( )
static bool QtCore.QMetaType.IsRegistered ( int  type)
static

Returns true if the datatype with ID type is registered; otherwise returns false.

See also type(), typeName(), and Type.

static int QtCore.QMetaType.RegisterTypedef ( string  typeName,
int  aliasId 
)
static
static int QtCore.QMetaType.type ( string  typeName)
static

Returns a handle to the type called typeName, or 0 if there is no such type.

See also isRegistered(), typeName(), and Type.

static string QtCore.QMetaType.TypeName ( int  type)
static

Returns the type name associated with the given type, or 0 if no matching type was found. The returned pointer must not be deleted.

See also type(), isRegistered(), and Type.

static void QtCore.QMetaType.UnregisterType ( string  typeName)
static

Unregisters a user type, with typeName.

This function was introduced in Qt 4.4.

See also type() and typeName().

Member Data Documentation

SmokeInvocation QtCore.QMetaType.interceptor
protected

Property Documentation

virtual System.IntPtr QtCore.QMetaType.SmokeObject
getset