Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QDeclarativeValueTypeFactory Class Reference

#include <qdeclarativevaluetype_p.h>

Public Functions

QDeclarativeValueTypeoperator[] (int idx) const
 
 QDeclarativeValueTypeFactory ()
 
 ~QDeclarativeValueTypeFactory ()
 

Static Public Functions

static bool isValueType (int)
 
static void registerValueTypes ()
 
static void registerValueTypesCompat ()
 
static QDeclarativeValueTypevalueType (int)
 

Properties

QDeclarativeValueTypevalueTypes [QVariant::UserType - 1]
 

Detailed Description

Definition at line 84 of file qdeclarativevaluetype_p.h.

Constructors and Destructors

◆ QDeclarativeValueTypeFactory()

QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory ( )

Definition at line 81 of file qdeclarativevaluetype.cpp.

82 {
83  // ### Optimize
84  for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
85  valueTypes[ii] = valueType(ii);
86 }
static QDeclarativeValueType * valueType(int)
QDeclarativeValueType * valueTypes[QVariant::UserType - 1]

◆ ~QDeclarativeValueTypeFactory()

QDeclarativeValueTypeFactory::~QDeclarativeValueTypeFactory ( )

Definition at line 88 of file qdeclarativevaluetype.cpp.

89 {
90  for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
91  delete valueTypes[ii];
92 }
QDeclarativeValueType * valueTypes[QVariant::UserType - 1]

Functions

◆ isValueType()

bool QDeclarativeValueTypeFactory::isValueType ( int  idx)
static

◆ operator[]()

QDeclarativeValueType* QDeclarativeValueTypeFactory::operator[] ( int  idx) const
inline

Definition at line 95 of file qdeclarativevaluetype_p.h.

95  {
96  if (idx < 0 || idx >= (int)QVariant::UserType) return 0;
97  else return valueTypes[idx];
98  }
QDeclarativeValueType * valueTypes[QVariant::UserType - 1]

◆ registerValueTypes()

void QDeclarativeValueTypeFactory::registerValueTypes ( )
static

Definition at line 101 of file qdeclarativevaluetype.cpp.

Referenced by QDeclarativeEnginePrivate::QDeclarativeEnginePrivate().

102 {
103  qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("QtQuick",1,0,"Easing");
104  qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("QtQuick",1,0,"Font");
105 }

◆ registerValueTypesCompat()

void QDeclarativeValueTypeFactory::registerValueTypesCompat ( )
static

Definition at line 107 of file qdeclarativevaluetype.cpp.

Referenced by QDeclarativeMetaType::isModule().

108 {
110  return;
111 
112  qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("Qt",4,7,"Easing");
113  qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("Qt",4,7,"Font");
114 }
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).

◆ valueType()

QDeclarativeValueType * QDeclarativeValueTypeFactory::valueType ( int  t)
static

Definition at line 116 of file qdeclarativevaluetype.cpp.

Referenced by QDeclarativeVMEMetaObject::metaCall(), QDeclarativeProperty::name(), QDeclarativeProperty::propertyTypeName(), QDeclarativeValueTypeFactory(), QDeclarativePropertyPrivate::readValueProperty(), and QDeclarativePropertyPrivate::writeValueProperty().

117 {
118  QDeclarativeValueType *rv = 0;
119 
120  switch (t) {
121  case QVariant::Point:
123  break;
124  case QVariant::PointF:
126  break;
127  case QVariant::Size:
128  rv = new QDeclarativeSizeValueType;
129  break;
130  case QVariant::SizeF:
132  break;
133  case QVariant::Rect:
134  rv = new QDeclarativeRectValueType;
135  break;
136  case QVariant::RectF:
138  break;
139  case QVariant::Vector2D:
141  break;
142  case QVariant::Vector3D:
144  break;
145  case QVariant::Vector4D:
147  break;
150  break;
151  case QVariant::Matrix4x4:
153  break;
156  break;
157  case QVariant::Font:
158  rv = new QDeclarativeFontValueType;
159  break;
160  default:
161  break;
162  }
163 
164  Q_ASSERT(!rv || rv->metaObject()->propertyCount() < 32);
165  return rv;
166 }
int propertyCount() const
Returns the number of properties in this class, including the number of properties provided by each b...
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

Properties

◆ valueTypes

QDeclarativeValueType* QDeclarativeValueTypeFactory::valueTypes[QVariant::UserType - 1]
private

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