本文整理汇总了C++中QwtPlotItem::detach方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotItem::detach方法的具体用法?C++ QwtPlotItem::detach怎么用?C++ QwtPlotItem::detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotItem
的用法示例。
在下文中一共展示了QwtPlotItem::detach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeCurve
void Plot::removeCurve(int index)
{
QwtPlotItem *c = d_curves[index];
if (!c)
return;
if (c->rtti() == QwtPlotItem::Rtti_PlotSpectrogram)
{
Spectrogram *sp = (Spectrogram *)c;
QwtScaleWidget *colorAxis = axisWidget(sp->colorScaleAxis());
if (colorAxis)
colorAxis->setColorBarEnabled(false);
}
c->detach();
QwtPlotItem* p = d_curves.take (index);
// RNT: Making curve_key unique prevents clashes elsewhere
//--curve_key;
// MG: This is a rather crude but effective way of delaying the
// deletion of the curve objects. This is necessary because in
// a tight loop a curve may not have been completely removed
// but the object has been deleted.
Detacher *detacher = new Detacher(p);
detacher->deleteLater();
}
示例2: removeCurve
void Plot::removeCurve(int index)
{
QwtPlotItem *c = d_curves[index];
if (!c)
return;
if (c->rtti() == QwtPlotItem::Rtti_PlotSpectrogram)
{
Spectrogram *sp = (Spectrogram *)c;
QwtScaleWidget *colorAxis = axisWidget(sp->colorScaleAxis());
if (colorAxis)
colorAxis->setColorBarEnabled(false);
}
c->detach();
d_curves.remove (index);
}