QCustomPlot - show item on QCPAxisRect below customPlot

天涯浪子 提交于 2019-12-04 00:50:47

Found the answer (thanks to the author of QCustomPlot). The missing components were

  1. Settings the clipAxisRect of the rectangle (already contained in the last update of question)
  2. Settings the axes, which the rectangle obeys.

Specifically,

 xRectItem->setClipAxisRect     ( xRect );

and

 xRectItem->topLeft     ->setAxes( xRect->axis(QCPAxis::atBottom), xRect->axis(QCPAxis::atLeft) );
 xRectItem->bottomRight ->setAxes( xRect->axis(QCPAxis::atBottom), xRect->axis(QCPAxis::atLeft) );
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!