当前位置: 首页 > news >正文

QCustomPlot获取选点坐标

QCustomPlot版本:Version: 2.1.1

  1. 设置点选择模式
customPlot->setInteractions(QCP::iSelectPlottables);

2.绑定点击事件

connect(customPlot,  &QCustomPlot::plottableClick, this, &CCustomPlot::onPlotClick);

3.读取点位置

void CustomPlot::onPlotClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
{QStringList nameList = plottable->name().split(" ");if( nameList.count()>1 &&  nameList.at(1).toInt()>0){int graphId = nameList.at(1).toInt();const QCPGraphData *ghd = customPlot->graph(graphId-1)->data()->at(dataIndex);qDebug()  << "key:"<< ghd->key  <<" value:"<< ghd->value;}
}
http://www.lryc.cn/news/107067.html

相关文章:

  • Qt配置Android开发
  • 花费7元训练自己的GPT 2模型
  • 性能分析工具
  • 1.netty介绍
  • 【Jmeter】压测mysql数据库中间件mycat
  • leetcode原题 路径总和 I II III(递归实现)
  • 【css】css设置表格样式-边框线合并
  • 使用Flutter的image_picker插件实现设备的相册的访问和拍照
  • 数学建模体系
  • 13.7 CentOS 7 环境下大量创建帐号的方法
  • HTML5 Canvas(画布)
  • io的异常处理以及properties
  • Linux下基于Dockerfile构建镜像应用(1)
  • JS中常见的模块管理规范梳理
  • 3维空间下按平面和圆柱面上排版设计
  • 【Spring框架】Spring AOP
  • 寻找旋转排序数组中的最小值——力扣153
  • 安卓逆向 - 基础入门教程
  • 验证码安全志:AIGC+集成环境信息信息检测
  • R-Meta分析教程
  • 【3维视觉】3D空间常用算法(点到直线距离、面法线、二面角)
  • Nodejs 第四章(Npm install 原理)
  • [深度学习] GPU处理能力(TFLOPS/TOPS)
  • js:获取浏览器默认语言
  • 【U8+】用友U8重新注册加密锁,提示:写卡失败,请重新配置客户端控件。
  • uniapp小程序console.log在微信开发者工具中不打印问题
  • 从零基础开始开发自己的第一个微信小程序
  • 无涯教程-Lua - Arrays(数组)
  • 0基础学习VR全景平台篇 第76篇:全景相机-圆周率全景相机如何直播推流
  • 超详细|ChatGPT论文润色教程