fix: 修复模型位置显示未随鼠标刷新

feature/Fix-Plot-20261028
lvjunjie 2 weeks ago
parent d1102ecc07
commit 5f0a91569e

@ -26,6 +26,9 @@ public slots:
signals:
// 鼠标在绘图区内的位置,使用模型坐标。
void sigPointerPos(double x, double y);
protected:
// 拖拽支持

@ -15,6 +15,8 @@ ZX_DEFINE_DYNAMIC(mPlotView, nmPlotView)
nmPlotView::nmPlotView()
{
// 未按下鼠标时也接收视口移动事件,实时更新模型位置。
viewport()->setMouseTracking(true);
}
void nmPlotView::onPrepareContextMenu(QMenu* pMenu,
@ -140,6 +142,8 @@ void nmPlotView::mouseMoveEvent(QMouseEvent* e)
// 状态栏
if (rt.contains(pos))
{
// 复用坐标轴换算结果,通知模型位置窗口刷新坐标。
emit sigPointerPos(dX, dY);
s = tr(" Current Pos:%1-%2").arg(sValueX).arg(sValueY);
if (!sValueY2.isEmpty())
s += QString("-%1").arg(sValueY2);

Loading…
Cancel
Save