Hi,
If you would like to get or set the attribute to the graphic before adding it to the graphic layer, you can use the following functions to get and set the attributes for the graphic from the graphic object:
QStringList attributeNames () const
Gets the name of all the attributes. Attributes are name-value pairs of fields and field values associated with the graphic.
QMap< QString, QVariant > attributes () const
Returns all attributes of the graphic as a read-only collection.
QVariant attributeValue (const QString &key) const
Gets the attribute value by the given name.
If you would like to get or set the attribute to the graphic after adding it to the graphic layer, you can use the following functions to get and set the attributes for the graphic from the graphic layer object:
void updateGraphic (const int &id, const QMap< QString, QVariant > &attributes)
Replaces the set of attributes of the identified Graphic with the supplied attributes.
Regards,