本文整理汇总了C++中PlotCurve::nearestCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ PlotCurve::nearestCoord方法的具体用法?C++ PlotCurve::nearestCoord怎么用?C++ PlotCurve::nearestCoord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlotCurve
的用法示例。
在下文中一共展示了PlotCurve::nearestCoord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: highlightPoint
void PlotScene::highlightPoint(float timeValue, const QVariant &trackId)
{
PlotCurve* targetPlotCurve = NULL;
// Find the curve associate to trackId of the point selected on the mapping
for(int i(0); targetPlotCurve == NULL && i < this->curves.count(); i++)
if (this->curves.at(i)->id() == trackId)
targetPlotCurve = this->curves[i];
if (targetPlotCurve == NULL)
{
qDebug() << "No PlotCurve associate to the trackId found";
return;
}
CoordinateItem* nearestCoord = targetPlotCurve->nearestCoord(timeValue);
if (nearestCoord == NULL)
return;
TickItem* tick = new TickItem(true);
tick->setPos(nearestCoord->pos());
/* Create the group that will contain all the GraphicsItem corresponding
* to the selected zone or point */
if (this->selectedGroup == NULL)
{
this->selectedGroup = new QGraphicsItemGroup;
this->addItem(this->selectedGroup);
}
this->selectedGroup->addToGroup(tick);
tick->launchAnimation();
}