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

add a item hover auto show labels function.

上级 c7456382
......@@ -473,7 +473,38 @@ void qtvplugin_geomarker::addSelection(QRectF rectWorld)
bool qtvplugin_geomarker::cb_event(const QMap<QString, QVariant> para)
{
return false;
if (para["source"]==this->get_name() && para["name"]=="ITEM_MOUSE_ENTER")
{
if (ui->checkBox_QTV_hoverEvt_AutoLabel->isChecked())
{
const QString key = para["id"].toString();
if (key.length())
{
QTVP_GEOMARKER::geoItemBase * base = m_pScene->geoitem_by_name(key);
if (base)
{
base->show_props(true);
scheduleUpdateMap();
}
}
}
}
if (para["source"]==this->get_name() && para["name"]=="ITEM_MOUSE_LEAVE")
{
if (ui->checkBox_QTV_hoverEvt_AutoLabel->isChecked())
{
const QString key = para["id"].toString();
if (key.length())
{
QTVP_GEOMARKER::geoItemBase * base = m_pScene->geoitem_by_name(key);
if (base)
{
base->show_props(false);
scheduleUpdateMap();
}
}
}
} return false;
}
/*! qtvplugin_geomarker::cb_mouseXXXEvent tranfer mouse events from main view to
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>465</height>
<width>559</width>
<height>449</height>
</rect>
</property>
<property name="windowTitle">
......@@ -128,6 +128,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_QTV_hoverEvt_AutoLabel">
<property name="text">
<string>Auto Collapse Labels</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -150,7 +157,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>160</width>
<width>173</width>
<height>194</height>
</rect>
</property>
......@@ -194,8 +201,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>174</width>
<height>186</height>
<width>187</width>
<height>177</height>
</rect>
</property>
<attribute name="icon">
......@@ -351,7 +358,7 @@
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="../qtvplugin_grid/resources.qrc">
<iconset resource="resources.qrc">
<normaloff>:/icons/delete-21.png</normaloff>:/icons/delete-21.png</iconset>
</property>
</widget>
......@@ -710,7 +717,7 @@
<string>add</string>
</property>
<property name="icon">
<iconset resource="../qtvplugin_grid/resources.qrc">
<iconset resource="resources.qrc">
<normaloff>:/icons/Add to favourites.png</normaloff>:/icons/Add to favourites.png</iconset>
</property>
</widget>
......@@ -1057,7 +1064,7 @@
<string>Delete Prop</string>
</property>
<property name="icon">
<iconset resource="../qtvplugin_grid/resources.qrc">
<iconset resource="resources.qrc">
<normaloff>:/icons/delete-21.png</normaloff>:/icons/delete-21.png</iconset>
</property>
</widget>
......@@ -1086,7 +1093,6 @@
</layout>
</widget>
<resources>
<include location="../qtvplugin_grid/resources.qrc"/>
<include location="resources.qrc"/>
</resources>
<connections/>
......
......@@ -179,6 +179,7 @@ void qtvplugin_geomarker::ini_save()
settings.setValue("ui/lineEdit_QTV_icon_scale",ui->lineEdit_QTV_icon_scale->text());
settings.setValue("ui/checkBox_QTV_multiline",ui->checkBox_QTV_multiline->isChecked()?-1:0);
settings.setValue("ui/checkBox_QTV_acceptHoverEvent",ui->checkBox_QTV_acceptHoverEvent->isChecked()?-1:0);
settings.setValue("ui/checkBox_QTV_hoverEvt_AutoLabel",ui->checkBox_QTV_hoverEvt_AutoLabel->isChecked()?-1:0);
}
void qtvplugin_geomarker::ini_load()
......@@ -276,7 +277,8 @@ void qtvplugin_geomarker::ini_load()
int checkBox_QTV_acceptHoverEvent = settings.value("ui/checkBox_QTV_acceptHoverEvent",0).toInt();
ui->checkBox_QTV_acceptHoverEvent->setChecked(checkBox_QTV_acceptHoverEvent?true:false);
}
int checkBox_QTV_hoverEvt_AutoLabel = settings.value("ui/checkBox_QTV_hoverEvt_AutoLabel",1).toInt();
ui->checkBox_QTV_hoverEvt_AutoLabel->setChecked(checkBox_QTV_hoverEvt_AutoLabel?true:false);}
void qtvplugin_geomarker::style_save()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册