void OPMapWidget::SetShowDiagnostics(bool const & value) { showDiag = value; if (!showDiag) { if (diagGraphItem != 0) { delete diagGraphItem; diagGraphItem = 0; } if (diagTimer != 0) { delete diagTimer; diagTimer = 0; } if (GPS != 0) { GPS->DeleteTrail(); delete GPS; GPS = 0; } } else { diagTimer = new QTimer(); connect(diagTimer, SIGNAL(timeout()), this, SLOT(diagRefresh())); diagTimer->start(500); if (GPS == 0) { GPS = new GPSItem(map, this); GPS->setParentItem(map); GPS->setOpacity(overlayOpacity); setOverlayOpacity(overlayOpacity); } } }
void OPMapWidget::SetShowDiagnostics(bool const& value) { showDiag = value; if(!showDiag) { if(diagGraphItem != 0) { delete diagGraphItem; diagGraphItem=0; } if(diagTimer != 0) { delete diagTimer; diagTimer=0; } } else { diagTimer = new QTimer(); connect(diagTimer, SIGNAL(timeout()), this, SLOT(diagRefresh())); diagTimer->start(500); } }