Qt 4.8
Public Functions | Friends | List of all members
QDeclarativeVisualDataModelDataMetaObject Class Reference
Inheritance diagram for QDeclarativeVisualDataModelDataMetaObject:
QDeclarativeOpenMetaObject QAbstractDynamicMetaObject QMetaObject

Public Functions

virtual int createProperty (const char *, const char *)
 
virtual QVariant initialValue (int)
 
 QDeclarativeVisualDataModelDataMetaObject (QObject *parent, QDeclarativeOpenMetaObjectType *type)
 
- Public Functions inherited from QDeclarativeOpenMetaObject
int count () const
 
bool hasValue (int) const
 
QByteArray name (int) const
 
QObjectobject () const
 
QVariantoperator[] (const QByteArray &)
 
QVariantoperator[] (int)
 
 QDeclarativeOpenMetaObject (QObject *, bool=true)
 
 QDeclarativeOpenMetaObject (QObject *, QDeclarativeOpenMetaObjectType *, bool=true)
 
void setCached (bool)
 
void setValue (const QByteArray &, const QVariant &)
 
void setValue (int, const QVariant &)
 
QDeclarativeOpenMetaObjectTypetype () const
 
QVariant value (const QByteArray &) const
 
QVariant value (int) const
 
 ~QDeclarativeOpenMetaObject ()
 
- Public Functions inherited from QAbstractDynamicMetaObject
virtual ~QAbstractDynamicMetaObject ()
 
- Public Functions inherited from QMetaObject
QObjectcast (QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
const QObjectcast (const QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
QMetaClassInfo classInfo (int index) const
 Returns the meta-data for the item of class information with the given index. More...
 
int classInfoCount () const
 Returns the number of items of class information in this class. More...
 
int classInfoOffset () const
 Returns the class information offset for this class; i.e. More...
 
const char * className () const
 Returns the class name. More...
 
QMetaMethod constructor (int index) const
 Returns the meta-data for the constructor with the given index. More...
 
int constructorCount () const
 Returns the number of constructors in this class. More...
 
QMetaEnum enumerator (int index) const
 Returns the meta-data for the enumerator with the given index. More...
 
int enumeratorCount () const
 Returns the number of enumerators in this class. More...
 
int enumeratorOffset () const
 Returns the enumerator offset for this class; i.e. More...
 
int indexOfClassInfo (const char *name) const
 Finds class information item name and returns its index; otherwise returns -1. More...
 
int indexOfConstructor (const char *constructor) const
 Finds constructor and returns its index; otherwise returns -1. More...
 
int indexOfEnumerator (const char *name) const
 Finds enumerator name and returns its index; otherwise returns -1. More...
 
int indexOfMethod (const char *method) const
 Finds method and returns its index; otherwise returns -1. More...
 
int indexOfProperty (const char *name) const
 Finds property name and returns its index; otherwise returns -1. More...
 
int indexOfSignal (const char *signal) const
 Finds signal and returns its index; otherwise returns -1. More...
 
int indexOfSlot (const char *slot) const
 Finds slot and returns its index; otherwise returns -1. More...
 
QMetaMethod method (int index) const
 Returns the meta-data for the method with the given index. More...
 
int methodCount () const
 Returns the number of methods known to the meta-object system in this class, including the number of properties provided by each base class. More...
 
int methodOffset () const
 Returns the method offset for this class; i.e. More...
 
QObjectnewInstance (QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument()) const
 Constructs a new instance of this class. More...
 
QMetaProperty property (int index) const
 Returns the meta-data for the property with the given index. More...
 
int propertyCount () const
 Returns the number of properties in this class, including the number of properties provided by each base class. More...
 
int propertyOffset () const
 Returns the property offset for this class; i.e. More...
 
int static_metacall (Call, int, void **) const
 
const QMetaObjectsuperClass () const
 Returns the meta-object of the superclass, or 0 if there is no such object. More...
 
QString tr (const char *s, const char *c) const
 
QString tr (const char *s, const char *c, int n) const
 
QString trUtf8 (const char *s, const char *c) const
 
QString trUtf8 (const char *s, const char *c, int n) const
 
QMetaProperty userProperty () const
 Returns the property that has the USER flag set to true. More...
 

Friends

class QDeclarativeVisualDataModelData
 

Additional Inherited Members

- Public Types inherited from QMetaObject
enum  Call {
  InvokeMetaMethod, ReadProperty, WriteProperty, ResetProperty,
  QueryPropertyDesignable, QueryPropertyScriptable, QueryPropertyStored, QueryPropertyEditable,
  QueryPropertyUser, CreateInstance
}
 
- Static Public Functions inherited from QMetaObject
static void activate (QObject *sender, int signal_index, void **argv)
 
static void activate (QObject *sender, int from_signal_index, int to_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int local_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv)
 
static void addGuard (QObject **ptr)
 
static void changeGuard (QObject **ptr, QObject *o)
 
static bool checkConnectArgs (const char *signal, const char *method)
 Returns true if the signal and method arguments are compatible; otherwise returns false. More...
 
static bool connect (const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
 
static void connectSlotsByName (QObject *o)
 Searches recursively for all child objects of the given object, and connects matching signals from them to slots of object that follow the following form: More...
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool disconnectOne (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 Invokes the member (a signal or a slot name) on the object obj. More...
 
static bool invokeMethod (QObject *obj, const char *member, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType type, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static int metacall (QObject *, Call, int, void **)
 
static QByteArray normalizedSignature (const char *method)
 Normalizes the signature of the given method. More...
 
static QByteArray normalizedType (const char *type)
 Normalizes a type. More...
 
static void removeGuard (QObject **ptr)
 
- Public Variables inherited from QMetaObject
struct {
   const uint *   data
 
   const void *   extradata
 
   const char *   stringdata
 
   const QMetaObject *   superdata
 
d
 
- Protected Functions inherited from QDeclarativeOpenMetaObject
virtual int metaCall (QMetaObject::Call _c, int _id, void **_a)
 
QAbstractDynamicMetaObjectparent () const
 
virtual void propertyCreated (int, QMetaPropertyBuilder &)
 
virtual void propertyRead (int)
 
virtual void propertyWrite (int)
 
virtual void propertyWritten (int)
 

Detailed Description

Definition at line 419 of file qdeclarativevisualitemmodel.cpp.

Constructors and Destructors

◆ QDeclarativeVisualDataModelDataMetaObject()

QDeclarativeVisualDataModelDataMetaObject::QDeclarativeVisualDataModelDataMetaObject ( QObject parent,
QDeclarativeOpenMetaObjectType type 
)
inline

Definition at line 422 of file qdeclarativevisualitemmodel.cpp.

423  : QDeclarativeOpenMetaObject(parent, type) {}
QDeclarativeOpenMetaObject(QObject *, bool=true)

Functions

◆ createProperty()

int QDeclarativeVisualDataModelDataMetaObject::createProperty ( const char *  name,
const char *  type 
)
virtual

Reimplemented from QDeclarativeOpenMetaObject.

Definition at line 481 of file qdeclarativevisualitemmodel.cpp.

482 {
484  static_cast<QDeclarativeVisualDataModelData *>(object());
485 
486  if (!data->m_model)
487  return -1;
488 
490  if (data->m_index < 0 || data->m_index >= model->modelCount())
491  return -1;
492 
493  if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
495  model->ensureRoles();
496  if (qstrcmp(name,"modelData") == 0)
498  }
499  }
500  return -1;
501 }
QDeclarativeOpenMetaObjectType * type() const
static QDeclarativeVisualDataModelPrivate * get(QDeclarativeVisualDataModel *m)
virtual int createProperty(const char *, const char *)
QDeclarativeGuard< QAbstractItemModel > m_abstractItemModel
const uint * data
Definition: qobjectdefs.h:471
QDeclarativeGuard< QDeclarativeVisualDataModel > m_model
QDeclarativeGuard< QListModelInterface > m_listModelInterface
int qstrcmp(const QByteArray &str1, const char *str2)
Definition: qbytearray.cpp:336

◆ initialValue()

QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue ( int  propId)
virtual

Reimplemented from QDeclarativeOpenMetaObject.

Definition at line 503 of file qdeclarativevisualitemmodel.cpp.

504 {
506  static_cast<QDeclarativeVisualDataModelData *>(object());
507 
508  Q_ASSERT(data->m_model);
510 
511  QByteArray propName = name(propId);
512  if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
513  if (propName == "modelData") {
515  QObject *object = model->m_listAccessor->at(0).value<QObject*>();
516  return object->metaObject()->property(1).read(object); // the first property after objectName
517  }
518  return model->m_listAccessor->at(data->m_index);
519  } else {
520  // return any property of a single object instance.
521  QObject *object = model->m_listAccessor->at(data->m_index).value<QObject*>();
522  return object->property(propName);
523  }
524  } else if (model->m_listModelInterface) {
525  model->ensureRoles();
527  if (it != model->m_roleNames.end()) {
528  QVariant value = model->m_listModelInterface->data(data->m_index, *it);
529  return value;
530  } else if (model->m_roles.count() == 1 && propName == "modelData") {
531  //for compatibility with other lists, assign modelData if there is only a single role
532  QVariant value = model->m_listModelInterface->data(data->m_index, model->m_roles.first());
533  return value;
534  }
535  } else if (model->m_abstractItemModel) {
536  model->ensureRoles();
537  QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root);
538  if (propName == "hasModelChildren") {
539  return model->m_abstractItemModel->hasChildren(index);
540  } else {
542  if (it != model->m_roleNames.end()) {
543  return model->m_abstractItemModel->data(index, *it);
544  } else if (model->m_roles.count() == 1 && propName == "modelData") {
545  //for compatibility with other lists, assign modelData if there is only a single role
546  return model->m_abstractItemModel->data(index, model->m_roles.first());
547  }
548  }
549  }
550  Q_ASSERT(!"Can never be reached");
551  return QVariant();
552 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
virtual QVariant data(int index, int role) const =0
Returns the data at the given index for the specified roles.
#define it(className, varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
static QDeclarativeVisualDataModelPrivate * get(QDeclarativeVisualDataModel *m)
QVariant value(const QByteArray &) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
QDeclarativeGuard< QAbstractItemModel > m_abstractItemModel
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
const uint * data
Definition: qobjectdefs.h:471
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
QDeclarativeGuard< QDeclarativeVisualDataModel > m_model
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
QDeclarativeGuard< QListModelInterface > m_listModelInterface
The QModelIndex class is used to locate data in a data model.
QVariant read(const QObject *obj) const
Reads the property&#39;s value from the given object.
quint16 index
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
QMetaProperty property(int index) const
Returns the meta-data for the property with the given index.

Friends and Related Functions

◆ QDeclarativeVisualDataModelData

Definition at line 429 of file qdeclarativevisualitemmodel.cpp.


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