Identify Graphic Attributes

2612
1
10-30-2013 09:10 AM
praveennarayandas
New Contributor
Hi,

I am working on graphics using arcgis runtime sdk for qt.i have added graphics dynamically
and they are displaying fine.this dynamic graphic layer is having attribute info.

When i am trying read this attributes using  EsriRuntimeQt::Graphic::attributeNames,EsriRuntimeQt::Graphic::attributes,
EsriRuntimeQt::Graphic::attributeValue  it is returning zero.

Kindly letme know which function i have to use to read and display attributes of the graphic.

also noticed that no signals/events to handle the graphic.

thanks in advance.

Praveen
0 Kudos
1 Reply
JeanneTrieu
Occasional Contributor
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,
0 Kudos