We have a label item showing the info about a track on the 3D SceneGraphicsView, just as below. There are many tracks on scene and each track has its own label.
Esri::ArcGISRuntime::Graphic *mpLabelItem = nullptr;
Esri::ArcGISRuntime::TextSymbol *mpTextSymbol = nullptr;
mpTextSymbol = new TextSymbol("", QColor(Qt::white), 10.0, HorizontalAlignment::Center, VerticalAlignment::Bottom, this);
mpTextSymbol->setOffsetX(10);
mpTextSymbol->setOffsetY(10);
mpLabelItem = new Graphic(Point(0, 0), mpTextSymbol, this);
QString labelStr(GetSource());
labelStr.append("-label");
mpLabelItem->attributes()->insertAttribute("source", labelStr);
mpLabelItem->attributes()->insertAttribute("id", pId);
mpMapViewer->AddToTracksOverlay(mpLabelItem);
However when we try to set text of this textSmbol once in every second, we face the problem of all labels disappearing from the scene after one day.
void PpiTrackItem::SetText()
{
QString mText = QString("T").append(attributes()->attributeValue("id").toString());
mText.append("\n");
mText.append("R:");
mText.append(QString::number(AstrxUnitConverter::ConvertMeterToNM(attributes()->attributeValue("range").toDouble()), 'f', 2));
mText.append("nm ");
mText.append("B:");
mText.append(QString::number(attributes()->attributeValue("bearing").toDouble(), 'f', 2));
mText.append("\u00B0");
mText.append("\n");
mText.append("S:");
mText.append(QString::number(Calculations::CovertMsToKnots(attributes()->attributeValue("speed").toDouble()), 'f', 2) + " knot");
attributes()->replaceAttribute("text", mText);
mpTextSymbol->setText(mText);
}