提交 ff6700e1 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

sloved a tiny bug in geomarker.

the map will be refreshed when items deleted from scene.
上级 5a32faf5
...@@ -200,7 +200,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_point (const QMap<QStr ...@@ -200,7 +200,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_point (const QMap<QStr
double lon = paras["lon"].toDouble(); double lon = paras["lon"].toDouble();
int tpn = paras["type"].toInt(); int tpn = paras["type"].toInt();
if (tpn > 1 || tpn <0) tpn = 0; if (tpn > 2 || tpn <1) tpn = 1;
QTVP_GEOMARKER::geo_item_type tpe = static_cast< QTVP_GEOMARKER::geo_item_type > (tpn); QTVP_GEOMARKER::geo_item_type tpe = static_cast< QTVP_GEOMARKER::geo_item_type > (tpn);
//update using same function in UI //update using same function in UI
if (tpe==QTVP_GEOMARKER::ITEAMTYPE_RECT_POINT) if (tpe==QTVP_GEOMARKER::ITEAMTYPE_RECT_POINT)
...@@ -606,6 +606,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt ...@@ -606,6 +606,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt
break; break;
set_names.insert(paras[keystr].toString()); set_names.insert(paras[keystr].toString());
}while (ct<1024*1024*1024); }while (ct<1024*1024*1024);
bool needUpdate = false;
if (set_names.size()) if (set_names.size())
{ {
ct = 0; ct = 0;
...@@ -617,6 +618,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt ...@@ -617,6 +618,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt
{ {
m_pScene->removeItem(base,0); m_pScene->removeItem(base,0);
res[keystr] = 1; res[keystr] = 1;
needUpdate = true;
} }
else else
res[keystr] = 0; res[keystr] = 0;
...@@ -629,6 +631,11 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt ...@@ -629,6 +631,11 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_marks (const QMap<QSt
m_pScene->removeItem(key,0); m_pScene->removeItem(key,0);
res["ALL"] = 1; res["ALL"] = 1;
} }
if (needUpdate)
{
scheduleRefreshMarks();
scheduleUpdateMap();
}
return std::move(res); return std::move(res);
} }
...@@ -662,6 +669,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_props (const QMap<QSt ...@@ -662,6 +669,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_props (const QMap<QSt
* prop0=TIME;prop1=Profit;Prop2=Address;Prop3=tel; * prop0=TIME;prop1=Profit;Prop2=Address;Prop3=tel;
*/ */
QTVP_GEOMARKER::geoItemBase * base = m_pScene->geoitem_by_name(name); QTVP_GEOMARKER::geoItemBase * base = m_pScene->geoitem_by_name(name);
bool needUpdate = false;
if (base) if (base)
{ {
int ct = 0; int ct = 0;
...@@ -671,11 +679,17 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_props (const QMap<QSt ...@@ -671,11 +679,17 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_props (const QMap<QSt
break; break;
QString prop_name = paras[keystr].toString(); QString prop_name = paras[keystr].toString();
base->del_prop(prop_name); base->del_prop(prop_name);
needUpdate = true;
}while (ct<1024*1024*1024); }while (ct<1024*1024*1024);
} }
else else
res["error"] = tr("the mark name.") + name + tr(" does not exist in current scene."); res["error"] = tr("the mark name.") + name + tr(" does not exist in current scene.");
if (needUpdate)
{
scheduleRefreshMarks();
scheduleUpdateMap();
}
return std::move(res); return std::move(res);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册