I have an application with a map, when I click on a map, I draw a Waypoint and save it to my struct WaypointData
Draw a Waypoint to the map
int MapViewClass::view_ObjectCallback(GlsMapView* self, DisplayEvent* ev) { Vector lonlatalt; _pickedLocation.GetGeodetic(&lonlatalt); WaypointData* w = new WaypointData(); w->iD = 0; w->state = 0; w->lng = lonlatalt.x; w->lat = lonlatalt.y; w->alt = lonlatalt.z; int iconType = 0; w->iconId = symbols->AddIcon(_pickedLocation,iconType); short nN = _dtedMapChartSource.GetElevationDataPoint(_pickedLocation); symbols->GetIcon(w->iconId)->SetResource("State", std::to_string(w->state).c_str()); symbols->GetIcon(w->iconId)->SetResource("ID", std::to_string(w->iD).c_str()); //Set Elevation Data symbols->GetIcon(w->iconId)->SetResource("NN", std::to_string(nN).c_str()); //Set Height over Ground symbols->GetIcon(w->iconId)->SetResource("Height", std::to_string(w->alt).c_str()); AddPathPoint(_pickedLocation); waypointData.push_back(*w); MainWindow *_MainWindor = new MainWindow(); _MainWindor->PMission_BKS(w); } my struckt
struct WaypointData { short iD; short iconId; double lng; double lat; double alt; int minAltitude; int state; }; All this is in my
namespace disti { class MapViewClass : public ComponentBase { public: In the same function where the Waypoint is drawn, a function is called from MainWindow
MainWindow *_MainWindor = new MainWindow(); _MainWindor->PMission_BKS(w); The PMission_BKS function is in public in
namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Here is my PMission_BKS function
void MainWindow::PMission_BKS(WaypointData* w) { std::stringstream str; str << w->lng; ui->PMission_uberschrift->setText(str.str().c_str()); } The problem is the following if I try to call qDebug() << w->lng; then I get the value for example 10.5112 , but if I try to print the text in QLabel or QPlainText then I just don’t see anything