if (geoPositionInfo.hasAttribute(QGeoPositionInfo::GroundSpeed)) { speed = geoPositionInfo.attribute(QGeoPositionInfo::GroundSpeed); ui->label_4->setNum(speed); }