本文整理汇总了C++中QwtPlotCurve::title方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCurve::title方法的具体用法?C++ QwtPlotCurve::title怎么用?C++ QwtPlotCurve::title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotCurve
的用法示例。
在下文中一共展示了QwtPlotCurve::title方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scaleCurves
void LinePlot::scaleCurves(QwtPlotCurve *curve)
{
/// multiple curves based on units
const QwtPlotItemList &listPlotItem = m_qwtPlot->itemList();
QwtPlotCurve *plotCurve;
QwtPlotItemIterator itPlotItem;
int curveCount = numberOfCurves();
switch (curveCount)
{
case 0:
{
curve->setYAxis(QwtPlot::yLeft);
m_qwtPlot->enableAxis(QwtPlot::yRight, false);
break;
}
case 1:
{
curve->setYAxis(QwtPlot::yRight);
m_qwtPlot->enableAxis(QwtPlot::yRight, true);
break;
}
default: //scale
m_qwtPlot->enableAxis(QwtPlot::yRight, false);
// find min, max of all curves
// scale
int i;
for ( itPlotItem = listPlotItem.begin();itPlotItem!=listPlotItem.end();++itPlotItem)
{
if ( (*itPlotItem)->rtti() == QwtPlotItem::Rtti_PlotCurve)
{
plotCurve = (QwtPlotCurve*) (*itPlotItem);
if ((plotCurve->minYValue() != 0) || (plotCurve->maxYValue() != 1))
{
QwtArray<double> xData(plotCurve->dataSize());
QwtArray<double> yData(plotCurve->dataSize());
for (i = 0; i < plotCurve->dataSize(); i++)
{
xData[i] = plotCurve->x(i);
yData[i] = (plotCurve->y(i) - plotCurve->minYValue())/ (plotCurve->maxYValue() - plotCurve->minYValue());
}
// reset data
plotCurve->setTitle(plotCurve->title().text() + "[" + QString::number(plotCurve->minYValue()) + ", " + QString::number(plotCurve->maxYValue()) + "]");
plotCurve->setData(xData,yData);
}
}
}
break;
}
}
示例2: addCurveWithDataFromChannel
void RTVTPlotWindow::addCurveWithDataFromChannel(QVector<qreal> frequency, QVector<qreal> amplitude, unsigned int channel)
{
QwtPlotCurve *curve = new QwtPlotCurve(QString("Channel " + QString::number(channel)));
curve->setPen(selectPen());
curve->setSamples(frequency, amplitude);
curve->setAxes(QwtPlot::xBottom, QwtPlot::yLeft);
curves << curve;
channelStringList << curve->title().text();
channelListStringModel->setStringList(channelStringList);
}
示例3: enableLegend
/*!
\brief Enable or disable the legend
\param tf \c TRUE (enabled) or \c FALSE (disabled)
\param curveKey Key of a existing curve.
If curveKey < 0 the legends for all
curves will be updated.
\sa QwtPlot::setAutoLegend()
\sa QwtPlot::setLegendPos()
*/
void QwtPlot::enableLegend(
#ifndef QWT_NO_LEGEND
bool enable, long curveKey
#else
bool, long
#endif
)
{
#ifndef QWT_NO_LEGEND
QwtPlotCurve *curCurve;
bool isUpdateEnabled = d_legend->isUpdatesEnabled();
d_legend->setUpdatesEnabled(FALSE);
if ( curveKey < 0 ) // legends for all curves
{
if ( enable )
{
if ( d_legend->itemCnt() < d_curves->count() )
{
// not all curves have a legend
d_legend->clear();
QIntDictIterator<QwtPlotCurve> itc(*d_curves);
itc.toFirst();
while ((curCurve = itc.current()))
{
d_legend->appendItem(curCurve->title(),
curCurve->symbol(), curCurve->pen(), itc.currentKey());
++itc;
}
}
}
else
{
if ( d_legend->itemCnt() > 0 )
d_legend->clear();
}
}
else
{
uint index = d_legend->findFirstKey(curveKey);
if ( enable )
{
curCurve = d_curves->find(curveKey);
if ( curCurve && ( index >= d_legend->itemCnt() ) )
{
// curve exists and has no legend
d_legend->appendItem(curCurve->title(),
curCurve->symbol(), curCurve->pen(), curveKey);
}
}
else
{
if ( index < d_legend->itemCnt() )
d_legend->removeItem(index);
}
}
d_legend->setUpdatesEnabled(isUpdateEnabled);
updateLayout();
#endif
}