Qt 4.8
Classes | Public Functions | Static Public Functions | Public Variables | Friends | List of all members
QDeclarativeVisualDataModelPrivate Class Reference
Inheritance diagram for QDeclarativeVisualDataModelPrivate:
QObjectPrivate QObjectData

Classes

class  Cache
 
struct  ObjectRef
 

Public Functions

void createMetaData ()
 
QDeclarativeVisualDataModelDatadata (QObject *item)
 
void ensureRoles ()
 
int modelCount () const
 
 QDeclarativeVisualDataModelPrivate (QDeclarativeContext *)
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static QDeclarativeVisualDataModelPrivateget (QDeclarativeVisualDataModel *m)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

QDeclarativeGuard< QAbstractItemModelm_abstractItemModel
 
Cache m_cache
 
bool m_completePending: 1
 
QDeclarativeGuard< QDeclarativeContextm_context
 
QDeclarativeComponentm_delegate
 
VDMDelegateDataTypem_delegateDataType
 
bool m_delegateValidated: 1
 
QDeclarativeListAccessorm_listAccessor
 
QDeclarativeGuard< QListModelInterfacem_listModelInterface
 
bool m_metaDataCacheable: 1
 
bool m_metaDataCreated: 1
 
int m_modelDataPropId
 
QVariant m_modelVariant
 
QHash< QObject *, QDeclarativePackage * > m_packaged
 
QString m_part
 
QDeclarativeVisualDataModelPartsm_parts
 
QHash< QByteArray, int > m_roleNames
 
QList< int > m_roles
 
QHash< int, int > m_roleToPropId
 
QModelIndex m_root
 
QDeclarativeGuard< QDeclarativeVisualDataModelm_visualItemModel
 
QList< int > watchedRoleIds
 
QList< QByteArraywatchedRoles
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Friends

class QDeclarativeVisualDataModelData
 
class QDeclarativeVisualItemParts
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Detailed Description

Definition at line 275 of file qdeclarativevisualitemmodel.cpp.

Constructors and Destructors

◆ QDeclarativeVisualDataModelPrivate()

QDeclarativeVisualDataModelPrivate::QDeclarativeVisualDataModelPrivate ( QDeclarativeContext ctxt)

Definition at line 634 of file qdeclarativevisualitemmodel.cpp.

638 {
639 }
QDeclarativeGuard< QDeclarativeContext > m_context
QDeclarativeGuard< QDeclarativeVisualDataModel > m_visualItemModel
QDeclarativeGuard< QAbstractItemModel > m_abstractItemModel
QDeclarativeGuard< QListModelInterface > m_listModelInterface
QDeclarativeVisualDataModelParts * m_parts

Functions

◆ createMetaData()

void QDeclarativeVisualDataModelPrivate::createMetaData ( )
inline

Definition at line 324 of file qdeclarativevisualitemmodel.cpp.

Referenced by QDeclarativeVisualDataModelData::ensureProperties().

324  {
325  if (!m_metaDataCreated) {
326  ensureRoles();
327  if (m_roleNames.count()) {
329  while (it != m_roleNames.end()) {
331  m_roleToPropId.insert(*it, propId);
332  ++it;
333  }
334  // Add modelData property
335  if (m_roles.count() == 1)
337  m_metaDataCreated = true;
338  }
339  }
340  }
int createProperty(const QByteArray &name)
#define it(className, varName)
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
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
int count(const Key &key) const
Returns the number of items associated with the key.
Definition: qhash.h:719

◆ data()

QDeclarativeVisualDataModelData * QDeclarativeVisualDataModelPrivate::data ( QObject item)

Definition at line 641 of file qdeclarativevisualitemmodel.cpp.

642 {
645  Q_ASSERT(dataItem);
646  return dataItem;
647 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
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.
Definition: qobject.h:158

◆ ensureRoles()

void QDeclarativeVisualDataModelPrivate::ensureRoles ( )
inline

Definition at line 293 of file qdeclarativevisualitemmodel.cpp.

Referenced by QDeclarativeVisualDataModelDataMetaObject::createProperty(), and QDeclarativeVisualDataModelDataMetaObject::initialValue().

293  {
294  if (m_roleNames.isEmpty()) {
295  if (m_listModelInterface) {
297  for (int ii = 0; ii < m_roles.count(); ++ii)
299  } else if (m_abstractItemModel) {
301  it != m_abstractItemModel->roleNames().end(); ++it) {
302  m_roles.append(it.key());
303  m_roleNames.insert(*it, it.key());
304  }
305  if (m_roles.count())
306  m_roleNames.insert("hasModelChildren", -1);
307  } else if (m_listAccessor) {
308  m_roleNames.insert("modelData", 0);
310  if (QObject *object = m_listAccessor->at(0).value<QObject*>()) {
311  int count = object->metaObject()->propertyCount();
312  for (int ii = 1; ii < count; ++ii) {
313  const QMetaProperty &prop = object->metaObject()->property(ii);
314  m_roleNames.insert(prop.name(), 0);
315  }
316  }
317  }
318  }
319  }
320  }
#define it(className, varName)
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
virtual QString toString(int role) const =0
Returns a string description of the specified role.
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
QDeclarativeGuard< QAbstractItemModel > m_abstractItemModel
const QHash< int, QByteArray > & roleNames() const
Returns the model&#39;s role names.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
const char * name() const
Returns this property&#39;s name.
QDeclarativeGuard< QListModelInterface > m_listModelInterface
virtual QList< int > roles() const =0
Returns the list of roles for which the list model interface provides data.
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
The QMetaProperty class provides meta-data about a property.
Definition: qmetaobject.h:176
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332

◆ get()

static QDeclarativeVisualDataModelPrivate* QDeclarativeVisualDataModelPrivate::get ( QDeclarativeVisualDataModel m)
inlinestatic

◆ modelCount()

int QDeclarativeVisualDataModelPrivate::modelCount ( ) const
inline

Definition at line 384 of file qdeclarativevisualitemmodel.cpp.

Referenced by QDeclarativeVisualDataModelDataMetaObject::createProperty().

384  {
385  if (m_visualItemModel)
386  return m_visualItemModel->count();
388  return m_listModelInterface->count();
391  if (m_listAccessor)
392  return m_listAccessor->count();
393  return 0;
394  }
virtual int count() const =0
Returns the number of data entries in the model.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QDeclarativeGuard< QDeclarativeVisualDataModel > m_visualItemModel
QDeclarativeGuard< QAbstractItemModel > m_abstractItemModel
QDeclarativeGuard< QListModelInterface > m_listModelInterface

Friends and Related Functions

◆ QDeclarativeVisualDataModelData

Definition at line 403 of file qdeclarativevisualitemmodel.cpp.

◆ QDeclarativeVisualItemParts

friend class QDeclarativeVisualItemParts
friend

Definition at line 400 of file qdeclarativevisualitemmodel.cpp.

Properties

◆ m_abstractItemModel

QDeclarativeGuard<QAbstractItemModel> QDeclarativeVisualDataModelPrivate::m_abstractItemModel

◆ m_cache

Cache QDeclarativeVisualDataModelPrivate::m_cache

Definition at line 396 of file qdeclarativevisualitemmodel.cpp.

◆ m_completePending

bool QDeclarativeVisualDataModelPrivate::m_completePending

Definition at line 407 of file qdeclarativevisualitemmodel.cpp.

◆ m_context

QDeclarativeGuard<QDeclarativeContext> QDeclarativeVisualDataModelPrivate::m_context

Definition at line 290 of file qdeclarativevisualitemmodel.cpp.

◆ m_delegate

QDeclarativeComponent* QDeclarativeVisualDataModelPrivate::m_delegate

Definition at line 289 of file qdeclarativevisualitemmodel.cpp.

◆ m_delegateDataType

VDMDelegateDataType* QDeclarativeVisualDataModelPrivate::m_delegateDataType

Definition at line 402 of file qdeclarativevisualitemmodel.cpp.

◆ m_delegateValidated

bool QDeclarativeVisualDataModelPrivate::m_delegateValidated

Definition at line 406 of file qdeclarativevisualitemmodel.cpp.

◆ m_listAccessor

QDeclarativeListAccessor* QDeclarativeVisualDataModelPrivate::m_listAccessor

◆ m_listModelInterface

QDeclarativeGuard<QListModelInterface> QDeclarativeVisualDataModelPrivate::m_listModelInterface

◆ m_metaDataCacheable

bool QDeclarativeVisualDataModelPrivate::m_metaDataCacheable

◆ m_metaDataCreated

bool QDeclarativeVisualDataModelPrivate::m_metaDataCreated

◆ m_modelDataPropId

int QDeclarativeVisualDataModelPrivate::m_modelDataPropId

◆ m_modelVariant

QVariant QDeclarativeVisualDataModelPrivate::m_modelVariant

Definition at line 411 of file qdeclarativevisualitemmodel.cpp.

◆ m_packaged

QHash<QObject *, QDeclarativePackage*> QDeclarativeVisualDataModelPrivate::m_packaged

Definition at line 397 of file qdeclarativevisualitemmodel.cpp.

◆ m_part

QString QDeclarativeVisualDataModelPrivate::m_part

Definition at line 287 of file qdeclarativevisualitemmodel.cpp.

◆ m_parts

QDeclarativeVisualDataModelParts* QDeclarativeVisualDataModelPrivate::m_parts

Definition at line 399 of file qdeclarativevisualitemmodel.cpp.

◆ m_roleNames

QHash<QByteArray,int> QDeclarativeVisualDataModelPrivate::m_roleNames

◆ m_roles

QList<int> QDeclarativeVisualDataModelPrivate::m_roles

◆ m_roleToPropId

QHash<int,int> QDeclarativeVisualDataModelPrivate::m_roleToPropId

◆ m_root

QModelIndex QDeclarativeVisualDataModelPrivate::m_root

◆ m_visualItemModel

QDeclarativeGuard<QDeclarativeVisualDataModel> QDeclarativeVisualDataModelPrivate::m_visualItemModel

Definition at line 286 of file qdeclarativevisualitemmodel.cpp.

◆ watchedRoleIds

QList<int> QDeclarativeVisualDataModelPrivate::watchedRoleIds

Definition at line 416 of file qdeclarativevisualitemmodel.cpp.

◆ watchedRoles

QList<QByteArray> QDeclarativeVisualDataModelPrivate::watchedRoles

Definition at line 415 of file qdeclarativevisualitemmodel.cpp.


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