update to propery check if string is empty

This commit is contained in:
AdenKoperczak 2024-10-06 12:55:21 -04:00
parent 0cfad82933
commit 3b8e0d8180

View file

@ -199,7 +199,7 @@ bool MarkerModel::setData(const QModelIndex& index,
QString str = value.toString();
bool ok;
double latitude = str.toDouble(&ok);
if (ok && str.isEmpty() && -90 <= latitude && latitude <= 90)
if (!str.isEmpty() && ok && -90 <= latitude && latitude <= 90)
{
markerInfo->latitude = latitude;
p->markerManager_->set_marker(index.row(), *markerInfo);
@ -214,7 +214,7 @@ bool MarkerModel::setData(const QModelIndex& index,
QString str = value.toString();
bool ok;
double longitude = str.toDouble(&ok);
if (str.isEmpty() && ok && -180 <= longitude && longitude <= 180)
if (!str.isEmpty() && ok && -180 <= longitude && longitude <= 180)
{
markerInfo->longitude = longitude;
p->markerManager_->set_marker(index.row(), *markerInfo);