Q自定义-隐藏/显示所选图形
QCustomplot - Hide / Show selected graph
我想通过直接在绘图上选择来隐藏/显示图形。我的想法是这样的:
myPlot->graph(graphIdx)->setVisible(false);
其中CCD_ 1是CCD_。
我的问题是:有没有办法得到所选图的索引graphIdx
?这可能很琐碎,但老实说,我想不通。
提前感谢
A。
使用返回QList<QCPGraph *>
的函数QCustomPlot::selectedGraphs
(在您的情况下,它应该只有1个元素)。您可以在这些指针上直接调用setVisible
。您可能需要QCustomPlot::selectedPlottables
,如文档所示。
我认为您可以从QCustomPlot::selectedGraphs()中获取指针。
auto ololo = new QCustomPlot();
...
foreach(QCPGraph* gr, ololo->selectedGraphs()){
gr->setVisible(false);
}
相关文章:
- 直接显示手动图形内存泄漏
- 如何在没有第三方库的C 程序上显示图形
- Directx11 项目将不显示图形输出
- 如何显示图形邻接列表的元素?
- 图形没有显示何时使用IDXGISURFACE1使用的GDI兼容DC
- GDI+图形::DrawImage未显示
- 使用R创建图形/图/图表和GTK来显示和与它们进行交互
- gluPerspective with SFML:相同的编译,不同的结果.图形未显示
- QCustomPlot/Widget不显示图形/更新
- OpenGL代码显示人体图形,从二进制文件中读取顶点
- cpp 代码中的 gnuplot - 无法显示图形
- 要将QPushButton放置到图形视图上..但是没有显示按钮
- 在图形中显示成绩
- 使用c#或cli/c++在visual studio中的winforms中为图形中的数据点着色或高亮显示
- 在visual c++中单击按钮时显示和隐藏图形
- 在c++ Qt中显示2d矢量/2d数组到简单的图形
- 无法在Qt中显示图形场景
- 氧,没有显示在图形类层次结构
- 显示条形图(和其他时髦的图形)
- 使用DirectX11进行Direct2D绘图:在显示图形上对齐矩形