Qt 4.8
Classes | Public Functions | Private Functions | Properties | Friends | List of all members
QDeclarativeBoundSignalParameters Class Reference
Inheritance diagram for QDeclarativeBoundSignalParameters:
QObject

Classes

struct  MetaObject
 

Public Functions

void clearValues ()
 
 QDeclarativeBoundSignalParameters (const QMetaMethod &, QObject *=0)
 
void setValues (void **)
 
 ~QDeclarativeBoundSignalParameters ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Private Functions

int metaCall (QMetaObject::Call, int _id, void **)
 

Properties

QMetaObjectmyMetaObject
 
int * types
 
void ** values
 

Friends

class MetaObject
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 59 of file qdeclarativeboundsignal.cpp.

Constructors and Destructors

◆ QDeclarativeBoundSignalParameters()

QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters ( const QMetaMethod method,
QObject parent = 0 
)

Definition at line 221 of file qdeclarativeboundsignal.cpp.

223 : QObject(parent), types(0), values(0)
224 {
225  MetaObject *mo = new MetaObject(this);
226 
227  // ### Optimize!
228  QMetaObjectBuilder mob;
230  mob.setClassName("QDeclarativeBoundSignalParameters");
231 
232  QList<QByteArray> paramTypes = method.parameterTypes();
233  QList<QByteArray> paramNames = method.parameterNames();
234  types = new int[paramTypes.count()];
235  for (int ii = 0; ii < paramTypes.count(); ++ii) {
236  const QByteArray &type = paramTypes.at(ii);
237  const QByteArray &name = paramNames.at(ii);
238 
239  if (name.isEmpty() || type.isEmpty()) {
240  types[ii] = 0;
241  continue;
242  }
243 
247  QMetaPropertyBuilder prop = mob.addProperty(name, "QObject*");
248  prop.setWritable(false);
249  } else {
250  QByteArray propType = type;
251  if (t >= QVariant::UserType || t == QVariant::Invalid) {
252  //copy of QDeclarativeObjectScriptClass::enumType()
253  QByteArray scope;
255  int scopeIdx = propType.lastIndexOf("::");
256  if (scopeIdx != -1) {
257  scope = propType.left(scopeIdx);
258  name = propType.mid(scopeIdx + 2);
259  } else {
260  name = propType;
261  }
262  const QMetaObject *meta;
263  if (scope == "Qt")
265  else
266  meta = parent->parent()->metaObject(); //### assumes parent->parent()
267  for (int i = meta->enumeratorCount() - 1; i >= 0; --i) {
268  QMetaEnum m = meta->enumerator(i);
269  if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope))) {
270  t = QVariant::Int;
271  propType = "int";
272  break;
273  }
274  }
275  }
277  types[ii] = t;
278  QMetaPropertyBuilder prop = mob.addProperty(name, propType);
279  prop.setWritable(false);
280  } else {
281  types[ii] = 0x80000000 | t;
282  QMetaPropertyBuilder prop = mob.addProperty(name, "QVariant");
283  prop.setWritable(false);
284  }
285  }
286  }
287  myMetaObject = mob.toMetaObject();
288  *static_cast<QMetaObject *>(mo) = *myMetaObject;
289 
290  d_ptr->metaObject = mo;
291 }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
int type
Definition: qmetatype.cpp:239
The QMetaEnum class provides meta-data about an enumerator.
Definition: qmetaobject.h:147
The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builde...
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setClassName(const QByteArray &name)
Sets the name of the class being constructed by this meta object builder.
static bool canCopy(int type)
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Definition: qobject.h:128
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const char * scope() const
Returns the scope this enumerator was declared in.
const char * name() const
Returns the name of the enumerator (without the scope).
int lastIndexOf(char c, int from=-1) const
Returns the index position of the last occurrence of character ch in the byte array, searching backward from index position from.
QList< QByteArray > parameterNames() const
Returns a list of parameter names.
QMetaPropertyBuilder addProperty(const QByteArray &name, const QByteArray &type, int notifierId=-1)
Adds a new readable/writable property to this class with the specified name and type.
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
Type
This enum type defines the types of variable that a QVariant can contain.
Definition: qvariant.h:95
int enumeratorCount() const
Returns the number of enumerators in this class.
QByteArray left(int len) const
Returns a byte array that contains the leftmost len bytes of this byte array.
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
QByteArray mid(int index, int len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos...
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QList< QByteArray > parameterTypes() const
Returns a list of parameter types.
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
QMetaObject * metaObject
Definition: qobject.h:107
QMetaEnum enumerator(int index) const
Returns the meta-data for the enumerator with the given index.
static const QMetaObject staticQtMetaObject
Definition: qobject.h:322
QScopedPointer< QObjectData > d_ptr
Definition: qobject.h:320
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
void setWritable(bool value)
Sets this property to writable if value is true.
QMetaObject * toMetaObject() const
Converts this meta object builder into a concrete QMetaObject.
void setSuperClass(const QMetaObject *meta)
Sets the superclass meta object of the class being constructed by this meta object builder to meta...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

◆ ~QDeclarativeBoundSignalParameters()

QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters ( )

Definition at line 293 of file qdeclarativeboundsignal.cpp.

294 {
295  delete [] types;
297 }
Q_CORE_EXPORT void qFree(void *ptr)
Definition: qmalloc.cpp:58

Functions

◆ clearValues()

void QDeclarativeBoundSignalParameters::clearValues ( )

Definition at line 304 of file qdeclarativeboundsignal.cpp.

Referenced by QDeclarativeBoundSignal::qt_metacall().

305 {
306  values = 0;
307 }

◆ metaCall()

int QDeclarativeBoundSignalParameters::metaCall ( QMetaObject::Call  c,
int  _id,
void **  a 
)
private

Definition at line 309 of file qdeclarativeboundsignal.cpp.

Referenced by QDeclarativeBoundSignalParameters::MetaObject::metaCall().

310 {
311  if (!values)
312  return -1;
313 
314  if (c == QMetaObject::ReadProperty && id >= 1) {
315  if (types[id - 1] & 0x80000000) {
316  *((QVariant *)a[0]) = QVariant(types[id - 1] & 0x7FFFFFFF, values[id]);
317  } else {
318  QDeclarativeMetaType::copy(types[id - 1], a[0], values[id]);
319  }
320  return -1;
321  } else {
322  return qt_metacall(c, id, a);
323  }
324 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
unsigned char c[8]
Definition: qnumeric_p.h:62
static bool copy(int type, void *data, const void *copy=0)
Copies copy into data, assuming they both are of type type.
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ setValues()

void QDeclarativeBoundSignalParameters::setValues ( void **  v)

Definition at line 299 of file qdeclarativeboundsignal.cpp.

Referenced by QDeclarativeBoundSignal::qt_metacall().

300 {
301  values = v;
302 }

Friends and Related Functions

◆ MetaObject

friend class MetaObject
friend

Definition at line 70 of file qdeclarativeboundsignal.cpp.

Referenced by QDeclarativeBoundSignalParameters().

Properties

◆ myMetaObject

QMetaObject* QDeclarativeBoundSignalParameters::myMetaObject
private

◆ types

int* QDeclarativeBoundSignalParameters::types
private

◆ values

void** QDeclarativeBoundSignalParameters::values
private

Definition at line 83 of file qdeclarativeboundsignal.cpp.

Referenced by clearValues(), metaCall(), and setValues().


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