本文整理汇总了C++中QwtPlotMarker::label方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::label方法的具体用法?C++ QwtPlotMarker::label怎么用?C++ QwtPlotMarker::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::label方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markerLabel
/*!
\return a marker's label
\param key Marker key
*/
const QString QwtPlot::markerLabel(long key) const
{
QwtPlotMarker *m = d_markers->find(key);
if (m)
return m->label();
else
return QString::null;
}
示例2: reset
void QwtPlotPrintFilter::reset(QwtPlotItem *item) const
{
if ( d_data->cache == 0 )
return;
const PrivateData::Cache &cache = *d_data->cache;
switch(item->rtti())
{
case QwtPlotItem::Rtti_PlotGrid:
{
QwtPlotGrid *grid = (QwtPlotGrid *)item;
QPen pen = grid->majPen();
pen.setColor(cache.gridColors[0]);
grid->setMajPen(pen);
pen = grid->minPen();
pen.setColor(cache.gridColors[1]);
grid->setMinPen(pen);
break;
}
case QwtPlotItem::Rtti_PlotCurve:
{
QwtPlotCurve *c = (QwtPlotCurve *)item;
QwtSymbol symbol = c->symbol();
if ( cache.curveSymbolPenColors.contains(c) )
{
symbol.setPen(cache.curveSymbolPenColors[c]);
}
if ( cache.curveSymbolBrushColors.contains(c) )
{
QBrush brush = symbol.brush();
brush.setColor(cache.curveSymbolBrushColors[c]);
symbol.setBrush(brush);
}
c->setSymbol(symbol);
if ( cache.curveColors.contains(c) )
{
QPen pen = c->pen();
pen.setColor(cache.curveColors[c]);
c->setPen(pen);
}
break;
}
case QwtPlotItem::Rtti_PlotMarker:
{
QwtPlotMarker *m = (QwtPlotMarker *)item;
if ( cache.markerFonts.contains(m) )
{
QwtText label = m->label();
label.setFont(cache.markerFonts[m]);
m->setLabel(label);
}
if ( cache.markerLabelColors.contains(m) )
{
QwtText label = m->label();
label.setColor(cache.markerLabelColors[m]);
m->setLabel(label);
}
if ( cache.markerLineColors.contains(m) )
{
QPen pen = m->linePen();
pen.setColor(cache.markerLineColors[m]);
m->setLinePen(pen);
}
QwtSymbol symbol = m->symbol();
if ( cache.markerSymbolPenColors.contains(m) )
{
QPen pen = symbol.pen();
pen.setColor(cache.markerSymbolPenColors[m]);
symbol.setPen(pen);
}
if ( cache.markerSymbolBrushColors.contains(m) )
{
QBrush brush = symbol.brush();
brush.setColor(cache.markerSymbolBrushColors[m]);
symbol.setBrush(brush);
}
m->setSymbol(symbol);
break;
}
default:
break;
}
}
示例3: apply
void QwtPlotPrintFilter::apply(QwtPlotItem *item) const
{
PrivateData::Cache &cache = *d_data->cache;
switch(item->rtti())
{
case QwtPlotItem::Rtti_PlotGrid:
{
QwtPlotGrid *grid = (QwtPlotGrid *)item;
QPen pen = grid->majPen();
cache.gridColors[0] = pen.color();
pen.setColor(color(pen.color(), MajorGrid));
grid->setMajPen(pen);
pen = grid->minPen();
cache.gridColors[1] = pen.color();
pen.setColor(color(pen.color(), MinorGrid));
grid->setMinPen(pen);
break;
}
case QwtPlotItem::Rtti_PlotCurve:
{
QwtPlotCurve *c = (QwtPlotCurve *)item;
QwtSymbol symbol = c->symbol();
QPen pen = symbol.pen();
cache.curveSymbolPenColors.insert(c, pen.color());
pen.setColor(color(pen.color(), CurveSymbol));
symbol.setPen(pen);
QBrush brush = symbol.brush();
cache.curveSymbolBrushColors.insert(c, brush.color());
brush.setColor(color(brush.color(), CurveSymbol));
symbol.setBrush(brush);
c->setSymbol(symbol);
pen = c->pen();
cache.curveColors.insert(c, pen.color());
pen.setColor(color(pen.color(), Curve));
c->setPen(pen);
break;
}
case QwtPlotItem::Rtti_PlotMarker:
{
QwtPlotMarker *m = (QwtPlotMarker *)item;
QwtText label = m->label();
cache.markerFonts.insert(m, label.font());
label.setFont(font(label.font(), Marker));
cache.markerLabelColors.insert(m, label.color());
label.setColor(color(label.color(), Marker));
m->setLabel(label);
QPen pen = m->linePen();
cache.markerLineColors.insert(m, pen.color());
pen.setColor(color(pen.color(), Marker));
m->setLinePen(pen);
QwtSymbol symbol = m->symbol();
pen = symbol.pen();
cache.markerSymbolPenColors.insert(m, pen.color());
pen.setColor(color(pen.color(), MarkerSymbol));
symbol.setPen(pen);
QBrush brush = symbol.brush();
cache.markerSymbolBrushColors.insert(m, brush.color());
brush.setColor(color(brush.color(), MarkerSymbol));
symbol.setBrush(brush);
m->setSymbol(symbol);
break;
}
default:
break;
}
}