#include <diagramelementfactory.h>
Static Public Member Functions | |
| static AbstractDiagramElement * | create (MvcDiagram::ElementType type, qint32 instanceId, ElementDoc *parent) |
| static AbstractDiagramElement * | create (MvcDiagram::ElementType type, ElementDoc *parent) |
| static AbstractDiagramElement * | create (const QByteArray &key, qint32 instanceId, ElementDoc *parent) |
| static AbstractDiagramElement * | create (const QByteArray &key, ElementDoc *parent) |
| static const QList< QByteArray > & | keys () |
| static int | type (const QByteArray &key) |
| static const QString & | title (const QByteArray &key) |
Note that QByteArray is more than enough for keys. There is no need for QString, and we definitely don't want the keys to be language dependant.
Also on the topic of QByteArray, from the Qt 4.0.0 documentation: "Using QByteArray is much more convenient than using const char *. Behind the scenes, it always ensures that the data is followed by a '\0' terminator, and uses implicit sharing (copy-on-write) to reduce memory usage and avoid needless copying of data."
| AbstractDiagramElement * DiagramElementFactory::create | ( | MvcDiagram::ElementType | type, | |
| qint32 | instanceId, | |||
| ElementDoc * | parent | |||
| ) | [static] |
| AbstractDiagramElement * DiagramElementFactory::create | ( | MvcDiagram::ElementType | type, | |
| ElementDoc * | parent | |||
| ) | [static] |
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
The new element's instance ID will be automatically generated using ElementDoc::genElementInstanceId().
Asserts that parent is non-null.
| AbstractDiagramElement * DiagramElementFactory::create | ( | const QByteArray & | key, | |
| qint32 | instanceId, | |||
| ElementDoc * | parent | |||
| ) | [static] |
Note: This method is (intentionally) NOT case sensitive when it performs the key matching.
| AbstractDiagramElement * DiagramElementFactory::create | ( | const QByteArray & | key, | |
| ElementDoc * | parent | |||
| ) | [static] |
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
The new element's instance ID will be automatically generated using ElementDoc::genElementInstanceId().
Asserts that parent is non-null.
| const QList< QByteArray > & DiagramElementFactory::keys | ( | ) | [static] |
Warning! This method is not thread-safe until it returns from the first call.
| int DiagramElementFactory::type | ( | const QByteArray & | key | ) | [static] |
| const QString & DiagramElementFactory::title | ( | const QByteArray & | key | ) | [static] |
1.5.2