4 #ifndef BPSPROPERTYOBJECT_H
5 #define BPSPROPERTYOBJECT_H
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
This class is a generic editable object.
Definition: bpspropertyobject.h:21
BpsPropertyObject(QObject *aParent=nullptr)
Constructor for BpsPropertyObject.
BpsPropertyObject(const QString &aName, QObject *aParent=nullptr)
Constructor for BpsPropertyObject.
void clear()
Removes all dynamic properties and deletes all children.
void addAttribute(const char *aProperty, const char *aAttribute, const QVariant &aValue=true)
Adds or remove an attribute to/from an existing property.
void appendChild(BpsPropertyObject *aChild)
Appends a child to the end of the children list.
BpsPropertyObject & operator=(const BpsPropertyObject &aOther)
Assignment operator.
void insertChild(int aIndex, BpsPropertyObject *aChild)
Insert a child at the specified position in the children list.
void childMoved(int aOldIndex, int aNewIndex)
This signal is emitted when a child is moved.
void addProperty(const char *aName, const QVariant &aValue)
Add or remove a property.
BpsPropertyObject * parent() const
Get the parent of this object.
void modifiedChanged(bool aModified)
This signal is emitted when the modification status is changed.
virtual QString xmlTagName(int aLevel) const
Define a XML tag for the element of the level.
void loadXml(const QString &aDocType, const QString &aXml)
Load the object from XML.
bool isValid(BpsPropertyObject *aObject) const
void propertyChanged(const QByteArray &aName, const QVariant &aNewValue, const QVariant &aOldValue)
This signal is emitted whenever a property changes, or after emitValues().
QVariant attribute(const char *aProperty, const char *aAttribute) const
Get the attributes value.
void setModified(bool aModified=true)
Set or clear the modification status.
bool hasProperty(const char *aName) const
Check if a property with given name has been added by BpsPropertyObject::addProperty().
BpsPropertyObject * removeChild(BpsPropertyObject *aChild)
Remove a child.
QList< QByteArray > attributeNames(const char *aProperty) const
Get a list of all attributes defined for a certain property.
BpsPropertyObject * removeChild(int aIndex)
Remove a child.
int childIndex(BpsPropertyObject *aChild) const
Get index of a child.
bool setPropertyAsString(const char *aName, const QString &aValue)
Set the value of a property by converting from a string.
void emitValues()
Emits valueChanged() for all properties.
QString makeXml(const QString &aDocType, bool aFormat=false) const
Creates XML to save the object and its children.
void childInserted(int aIndex, BpsPropertyObject *aChild)
This signal is emitted when a new child is inserted.
BpsPropertyObject * childAt(int aIndex) const
Get pointer to indexed child element.
BpsPropertyObject(const BpsPropertyObject &aOther)
Copy-constructor for BpsPropertyObject.
virtual bool setProperty(const char *aName, const QVariant &aValue)
Set the value of a property.
QList< BpsPropertyObject * > children() const
void moveChild(int aOldIndex, int aNewIndex)
Move a child in the list.
void childRemoved(int aIndex, BpsPropertyObject *aChild)
This signal is emitted when a child is removed.
virtual BpsPropertyObject * xmlCreateObject(const QString &aTagName, int aLevel) const
Create a new object while processing loadXml().
void objectChanged()
This signal is emitted whenever anything in the object or any of its descendants (children,...
QString propertyAsString(const char *aName) const
Gets a string representation of the value.