I am using SymbolStyle and graphicsoverlay in ArcGIS qt 100.5 to read and display symbols from a style file. The code for the function is as follows. m_mapView is my MapGraphicsView object. The application is successfully built. The application crashes when this function is called. The debug statements display true status for both tw1.isValid() and for tw1.isDone() . Can somebody guide me why this problem is occurring??
void offlinemap2d::addPointsFromStyleFile()
{
//create a new graphicsoverlay
GraphicsOverlay* graphicsOverlay = new GraphicsOverlay(this);
// create a list of points
const QList<Point> pointsList
{
Point(72.852642647560347, 19.092812566811544, SpatialReference::wgs84()),
Point(72.8708416959572303, 19.08444173689877, SpatialReference::wgs84()),
Point(32.6697273884990937, 56.064250073402874, SpatialReference::wgs84()),
Point(32.6395150461199726, 56.06127916736989, SpatialReference::wgs84())
};
QStringList params {"tank","friendly"};
// create the symbology for the points
SymbolStyle* symbolstyle1 = new SymbolStyle("/home/developer/Desktop/stylx_files/mil2525d.stylx", this);
TaskWatcher tw1 = symbolstyle1->fetchSymbol(param);
qDebug()<<tw1.isValid();
while(tw1.isDone()==false)
{
for(int i=1;i<500;i++)
{
qDebug()<<i;
}
}
qDebug()<<tw1.isDone();
symbolstyle1->fetchSymbolCompleted(tw1.taskId(),symbol1);
foreach (const Point &buoyPoint, pointsList)
{
graphic = new Graphic(buoyPoint, this);
graphic->setSymbol(symbol1);
graphicsOverlay->graphics()->append(graphic);
}
//add overlay to the map
m_mapView->graphicsOverlays()->append(graphicsOverlay);
}