DictionarySymbolStyle

81
2
02-07-2020 09:04 AM
Highlighted
New Contributor II

So the thing is i get this dictionary https://www.arcgis.com/home/item.html?id=c78b149a1d52414682c86a5feeb13d30

and create the dictinary symbol as:

QString styleLocation = local from stylx;

m_dictionarySymbolStyle = DictionarySymbolStyle::createFromFile(styleLocation, this);

and works fine it shows the symbols perfectly

but when i call the function to see the fields names:

QStringList whatever = DictionarySymbolStyle::symbologyFieldNames();

whatever is empty.

its a normal behavior or i am doing something wrong?

There is another way to discover those fields names?

speaking of which how do i change the stylx configuration in cpp? like "condition" instead of 'PRIMARY' i want to change it


Reply
0 Kudos
2 Replies
Highlighted
New Contributor II

Regarding stylx config, ive open the file with SQLite and found all my answers but the access with code inside Qt remain still.

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

I tried this out and it works for me. Did you ensure you are loading the DictionarySymbolStyle first?

// create DictionarySymbolStyle with arcade style file
auto styleArcade = DictionarySymbolStyle::createFromFile("/Users/luca6804/ArcGIS/Runtime/Data/styles/arcade_style/mil2525d.stylx", this);
connect(styleArcade, &DictionarySymbolStyle::doneLoading, this, [styleArcade](Error)
{
qDebug() << "arcade style done loading:" << styleArcade->symbologyFieldNames();
// output is ("context", "identity", "symbolset", "status", "operationalcondition", "indicator", "echelon", "mobility", "array", "symbolentity", "modifier1", "modifier2", "specialentitysubtype", "civilian", "direction", "sidc")
});
styleArcade->load();

// create DictionarySymbolStyle with old, deprecated style file
auto style = new DictionarySymbolStyle("mil2525d", "/Users/luca6804/Downloads/mil2525d.stylx", this);
connect(style, &DictionarySymbolStyle::doneLoading, this, [style](Error)
{
qDebug() << "old style done loading:" << style->symbologyFieldNames();
// output is ("identity", "symbolset", "symbolentity", "modifier1", "modifier2", "echelon", "mobility", "array", "context", "indicator", "status", "operationalcondition", "specialentitysubtype", "civilian", "sidc")
});
style->load();
Reply
0 Kudos