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

1.sloved a "resource" spelling error, we incidently spell "resource" to "reource"

2.sloved a geomarker graphics item click and dblclick mismatch. In old case, when mouse clicks, a dblclick message will be pumped.
上级 4a7d05c8
......@@ -404,7 +404,7 @@ bool qtvplugin_geomarker::cb_mousePressEvent(QMouseEvent * e)
if (m_bVisible && pwig && too_many_items()==false)
{
// Convert and deliver the mouse event to the scene.
QGraphicsSceneMouseEvent * pmouseEvent = new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseDoubleClick);
QGraphicsSceneMouseEvent * pmouseEvent = new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMousePress);
QGraphicsSceneMouseEvent & mouseEvent = * pmouseEvent;
mouseEvent.setWidget(pwig);
mouseEvent.setButtonDownScenePos(mouse_button, mouse_scene_pt);
......
......@@ -149,9 +149,9 @@ private:
QMap<QString, QVariant> func_save_xml (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_load_xml (const QMap<QString, QVariant> &);
//icon and its manage
QMap<QString, QVariant> func_add_reource (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_save_reources (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_load_reources (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_add_resource (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_save_resources (const QMap<QString, QVariant> &);
QMap<QString, QVariant> func_load_resources (const QMap<QString, QVariant> &);
//overloaded virtual funtions
protected:
layer_interface * load_initial_plugin(QString strSLibPath,viewer_interface * ptrviewer);
......
......@@ -23,9 +23,9 @@
* 9.mark_names return All mark names owned by this plugin.
* 10.mark return All styles and geo points for a special mark.
* 11.props return All user-defined properties for a special mark.
* 12.add_reource add an reource (eg, icon) to current resource list. icon mark can reference icons in current resource list.
* 13 save_reources save current resource list to disk files.
* 14 load_reources load previewsly saved list file from disk to current resource list.
* 12.add_resource add an resource (eg, icon) to current resource list. icon mark can reference icons in current resource list.
* 13 save_resources save current resource list to disk files.
* 14 load_resources load previewsly saved list file from disk to current resource list.
* @param paras the key-value style paraments.
* @return QMap<QString, QVariant> the key-value style return values.
*/
......@@ -64,9 +64,9 @@ void qtvplugin_geomarker::initialBindPluginFuntions()
m_map_pluginFunctions["props"] = std::bind(&qtvplugin_geomarker::func_props, this,std::placeholders::_1);
m_map_pluginFunctions["load_xml"] = std::bind(&qtvplugin_geomarker::func_load_xml, this,std::placeholders::_1);
m_map_pluginFunctions["save_xml"] = std::bind(&qtvplugin_geomarker::func_save_xml, this,std::placeholders::_1);
m_map_pluginFunctions["add_reource"] = std::bind(&qtvplugin_geomarker::func_add_reource, this,std::placeholders::_1);
m_map_pluginFunctions["save_reources"] = std::bind(&qtvplugin_geomarker::func_save_reources, this,std::placeholders::_1);
m_map_pluginFunctions["load_reources"] = std::bind(&qtvplugin_geomarker::func_load_reources, this,std::placeholders::_1);
m_map_pluginFunctions["add_resource"] = std::bind(&qtvplugin_geomarker::func_add_resource, this,std::placeholders::_1);
m_map_pluginFunctions["save_resources"] = std::bind(&qtvplugin_geomarker::func_save_resources, this,std::placeholders::_1);
m_map_pluginFunctions["load_resources"] = std::bind(&qtvplugin_geomarker::func_load_resources, this,std::placeholders::_1);
}
/**
......@@ -661,6 +661,11 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_props(const QMap<QStrin
}
scheduleRefreshMarks();
scheduleUpdateMap();
if (base->props_visible())
{
base->show_props(false);
base->show_props(true);
}
}
else
res["error"] = tr("name does not exist in scene.");
......@@ -801,6 +806,11 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_delete_props (const QMap<QSt
{
scheduleRefreshMarks();
scheduleUpdateMap();
if (base->props_visible())
{
base->show_props(false);
base->show_props(true);
}
}
return std::move(res);
}
......@@ -1063,14 +1073,14 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_load_xml (const QMap<QStrin
return res;
}
/**
* @brief func_add_reource is a internal function for plugin call_func "add_reource"
* @brief func_add_resource is a internal function for plugin call_func "add_resource"
*
* the paraments used by paras is listed below.
* function=add_reource;
* function=add_resource;
* @param paras The key-value style paraments.
* @return QMap<QString, QVariant> if error happens, a property called "error" will store the most possible reason.
*/
QMap<QString, QVariant> qtvplugin_geomarker::func_add_reource (const QMap<QString, QVariant> & paras)
QMap<QString, QVariant> qtvplugin_geomarker::func_add_resource (const QMap<QString, QVariant> & paras)
{
//!xml: user should specify xml filename or the function calll will fail;
QMap<QString, QVariant> res;
......@@ -1110,14 +1120,14 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_add_reource (const QMap<QStr
}
/**
* @brief func_save_reources is a internal function for plugin call_func "save_reources"
* @brief func_save_resources is a internal function for plugin call_func "save_resources"
*
* the paraments used by paras is listed below.
* function=save_reources;
* function=save_resources;
* @param paras The key-value style paraments.
* @return QMap<QString, QVariant> if error happens, a property called "error" will store the most possible reason.
*/
QMap<QString, QVariant> qtvplugin_geomarker::func_save_reources (const QMap<QString, QVariant> & paras)
QMap<QString, QVariant> qtvplugin_geomarker::func_save_resources (const QMap<QString, QVariant> & paras)
{
//!xml: user should specify xml filename or the function calll will fail;
QMap<QString, QVariant> res;
......@@ -1138,14 +1148,14 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_save_reources (const QMap<QS
return res;
}
/**
* @brief func_load_reources is a internal function for plugin call_func "load_reources"
* @brief func_load_resources is a internal function for plugin call_func "load_resources"
*
* the paraments used by paras is listed below.
* function=save_reources;
* function=save_resources;
* @param paras The key-value style paraments.
* @return QMap<QString, QVariant> if error happens, a property called "error" will store the most possible reason.
*/
QMap<QString, QVariant> qtvplugin_geomarker::func_load_reources (const QMap<QString, QVariant> & paras)
QMap<QString, QVariant> qtvplugin_geomarker::func_load_resources (const QMap<QString, QVariant> & paras)
{
//!xml: user should specify xml filename or the function call will fail;
QMap<QString, QVariant> res;
......
......@@ -457,13 +457,13 @@ void testcontainer::on_pushButton_test_xml_clicked()
void testcontainer::on_pushButton_test_resource_clicked()
{
QString res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=add_reource;name=lena;filename=./lena.png;centerx=32;centery=32;").toString();
QMessageBox::information(this,"geomarker1::add_reource",res);
"function=add_resource;name=lena;filename=./lena.png;centerx=32;centery=32;").toString();
QMessageBox::information(this,"geomarker1::add_resource",res);
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=load_reources;xml=.//resource.xml;").toString();
QMessageBox::information(this,"geomarker1::load_reources",res);
"function=load_resources;xml=.//resource.xml;").toString();
QMessageBox::information(this,"geomarker1::load_resources",res);
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=save_reources;xml=.//resource.xml;").toString();
QMessageBox::information(this,"geomarker1::save_reources",res);
"function=save_resources;xml=.//resource.xml;").toString();
QMessageBox::information(this,"geomarker1::save_resources",res);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册