summaryrefslogtreecommitdiffstats
path: root/src/modeling/qmodelingobject.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-11-23 23:14:28 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-11-24 03:10:11 +0100
commitf2221017f76feddc0bcab60b977a3b87b162c253 (patch)
tree4cf9f8165f6b82cb8e52209bb119f5c9bd3dc708 /src/modeling/qmodelingobject.cpp
parent3acf9500befce24a558bb42ce3640630150f4ccf (diff)
Fix QtModeling module documentation
Change-Id: Id63005968d788dedec9cb397f6f7a1b1cd7f0568 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/modeling/qmodelingobject.cpp')
-rw-r--r--src/modeling/qmodelingobject.cpp56
1 files changed, 54 insertions, 2 deletions
diff --git a/src/modeling/qmodelingobject.cpp b/src/modeling/qmodelingobject.cpp
index 9e7ba5c3..bb9b274c 100644
--- a/src/modeling/qmodelingobject.cpp
+++ b/src/modeling/qmodelingobject.cpp
@@ -45,6 +45,16 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class QModelingObject
+
+ \inmodule QtModeling
+
+ \brief The QModelingObject class acts as base class for all QObject-based representation of modeling elements.
+
+ \sa QModelingElement
+*/
+
QHash< QString, QHash< QString, QHash<QtModeling::MetaPropertyDataRole, QVariant> > > QModelingObject::propertyDataHash;
QModelingObjectPrivate::QModelingObjectPrivate()
@@ -56,6 +66,9 @@ QModelingObjectPrivate::~QModelingObjectPrivate()
qDeleteAll(groupProperties);
}
+/*!
+ Destroys the QModelingObject.
+*/
QModelingObject::~QModelingObject()
{
if (!property("deletingFromModelingObject").isValid()) {
@@ -64,17 +77,34 @@ QModelingObject::~QModelingObject()
}
}
+/*!
+ Returs true if \a metaProperty has been modified (dirty property) since object creation. This
+ function returns false if property has not been modified or its RESET function has been called.
+*/
bool QModelingObject::isPropertyModified(QMetaProperty metaProperty) const
{
Q_D(const QModelingObject);
return d->modifiedResettableProperties.contains(QString::fromLatin1(metaProperty.name()));
}
+/*!
+ Returns \a metaProperty's metadata identified by \a role and associated with \a className in the
+ pseudo inheritance tree.
+*/
QVariant QModelingObject::propertyData(QString className, QMetaProperty metaProperty, QtModeling::MetaPropertyDataRole role)
{
return QModelingObject::propertyDataHash[className][QString::fromLatin1(metaProperty.name())][role];
}
+/*!
+ \fn void QModelingObject::setPropertyData()
+
+ This virtual pure function allows for subclasses to define metaproperty metadata.
+*/
+
+/*!
+ Returns the index of the \a metaProperty's group in the QStringList returned by propertyGroups().
+*/
int QModelingObject::propertyGroupIndex(QMetaProperty metaProperty) const
{
Q_D(const QModelingObject);
@@ -88,32 +118,54 @@ int QModelingObject::propertyGroupIndex(QMetaProperty metaProperty) const
return -1;
}
+/*!
+ Returns the property groups (classes in the pseudo inheritance tree) for this QModelingObject.
+*/
const QStringList &QModelingObject::propertyGroups() const
{
Q_D(const QModelingObject);
return d->propertyGroups;
}
+/*!
+ Returns a QMultiHash containing all property groups and their corresponding properties.
+*/
const QMultiHash<QString, QMetaProperty *> &QModelingObject::groupProperties() const
{
Q_D(const QModelingObject);
return d->groupProperties;
}
+/*!
+ \fn void QModelingObject::setGroupProperties()
+
+ This virtual pure function allows for subclasses to define new metaproperty groups.
+*/
+
+/*!
+ Returns all QModelingObject's properties that have been modified since object creation.
+*/
QStringList &QModelingObject::modifiedResettableProperties()
{
Q_D(QModelingObject);
return d->modifiedResettableProperties;
}
+/*!
+ Returns true if the QModelingObject is a kind of \a type in the pseudo inheritance tree, otherwise returns false.
+*/
bool QModelingObject::isKindOf(QString type) const
{
Q_D(const QModelingObject);
return d->propertyGroups.contains(type);
}
-QModelingObject::QModelingObject()
- : QObject(*new QModelingObjectPrivate)
+/*!
+ Creates a new QModelingObject with the given \a parent. This is a protected constructor
+ since this class is not intended to be directly instantiated.
+*/
+QModelingObject::QModelingObject(QObject *parent)
+ : QObject(*new QModelingObjectPrivate, parent)
{
}