AbstractItem Class Reference
|
MathVizAnimator
0.0.1
|
An abstract class representing a visible item like a circle or a rectangle. More...
#include <abstractitem.h>
Signals | |
| void | nameChanged (const QString &new_name) |
Public Member Functions | |
| AbstractItem (const QString &qml_file, BasicItem *parent=nullptr) | |
| Constructor for MyClass. TODO. More... | |
| QString | name () const |
| void | setName (const QString &name) |
| virtual QJsonObject | toJson () const |
| virtual QStringList | editableProperties () const |
| Returns the properties which can be edited by the user in a QStringList. More... | |
| virtual QStringList | editablePropertiesParent () const |
| Returns the parents properties which can be edited by the user in a QStringList. More... | |
| PropertyMap | allItemProperties () const |
| PropertyMap | itemProperties () const |
| PropertyMap | parentItemProperties () const |
| void | paintItem (QPainter *painter) |
| Short explanation. More... | |
Properties | |
| QString | name |
| QString | file |
Detailed Description
An abstract class representing a visible item like a circle or a rectangle.
Add editable properties to the list
Constructor & Destructor Documentation
◆ AbstractItem()
|
explicit |
Constructor for MyClass. TODO.
Initializes the class with default values.
Member Function Documentation
◆ editableProperties()
|
inlinevirtual |
Returns the properties which can be edited by the user in a QStringList.
When you derive an item from AbstractItem (directly or via multiple inheritance) and your item has a property which should be editable by the user, you have to override this function and return your own properties. Don't forget to add the properties of your base class. Take a look at the GeometryItem::editableProperties() source code for an example.
- Returns
- Returns the editable properties as QStrings
Reimplemented in TextItem, and GeometryItem.
◆ editablePropertiesParent()
|
inlinevirtual |
Returns the parents properties which can be edited by the user in a QStringList.
The position (x,y) and the width and height of an AbstractItem are determined by the parent which is an object of type BasicItem.The position (x,y) of the AbstractItem is relative to the parent, the BasicItem. So changing these values by the user is not intended. Since the AbstractItem should always fill the whole parent (search for "anchors.fill: parent" in the item qml files, for example CircleItem.qml) it is also reasonable to change width and height of the BasicItem by the user and not the width and height of the AbstractItem.
- Returns
- Returns the editable properties as QStrings
Reimplemented in TextItem.
◆ paintItem()
| void AbstractItem::paintItem | ( | QPainter * | painter | ) |
Short explanation.
TODO
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_gui/include/items/abstractitem.h
- /home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_gui/src/items/abstractitem.cpp
Generated by