本文整理汇总了C++中QwtPlotMarker::font方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::font方法的具体用法?C++ QwtPlotMarker::font怎么用?C++ QwtPlotMarker::font使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::font方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markerFont
/*!
\return the font of a marker
*/
QFont QwtPlot::markerFont(long key) const
{
QwtPlotMarker *m = d_markers->find(key);
if (m)
return m->font();
else
return QFont();
}
示例2: apply
/*!
Change color and fonts of a plot
\sa QwtPlotPrintFilter::apply
*/
void QwtPlotPrintFilter::apply(QwtPlot *plot) const
{
QwtPlotPrintFilter *that = (QwtPlotPrintFilter *)this;
delete that->d_cache;
that->d_cache = new QwtPlotPrintFilterCache;
QwtPlotPrintFilterCache &cache = *that->d_cache;
if ( plot->d_lblTitle )
{
QPalette palette = plot->d_lblTitle->palette();
cache.titleColor = palette.color(
QPalette::Active, QColorGroup::Foreground);
palette.setColor(QPalette::Active, QColorGroup::Foreground,
color(cache.titleColor, Title));
plot->d_lblTitle->setPalette(palette);
cache.titleFont = plot->d_lblTitle->font();
plot->d_lblTitle->setFont(font(cache.titleFont, Title));
}
if ( plot->d_legend )
{
QIntDictIterator<QWidget> it = plot->d_legend->itemIterator();
for ( QWidget *w = it.toFirst(); w != 0; w = ++it)
{
const int key = it.currentKey();
cache.legendFonts.insert(it.currentKey(), new QFont(w->font()));
w->setFont(font(w->font(), Legend, key));
if ( w->inherits("QwtLegendButton") )
{
QwtLegendButton *btn = (QwtLegendButton *)w;
QwtSymbol symbol = btn->symbol();
QPen pen = symbol.pen();
QBrush brush = symbol.brush();
pen.setColor(color(pen.color(), CurveSymbol, key));
brush.setColor(color(brush.color(), CurveSymbol, key));
symbol.setPen(pen);
symbol.setBrush(brush);
btn->setSymbol(symbol);
pen = btn->curvePen();
pen.setColor(color(pen.color(), Curve, key));
btn->setCurvePen(pen);
}
}
}
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
{
QwtScale *scale = plot->d_scale[axis];
if ( scale )
{
cache.scaleColor[axis] = scale->palette().color(
QPalette::Active, QColorGroup::Foreground);
QPalette palette = scale->palette();
palette.setColor(QPalette::Active, QColorGroup::Foreground,
color(cache.scaleColor[axis], AxisScale, axis));
scale->setPalette(palette);
cache.scaleFont[axis] = scale->font();
scale->setFont(font(cache.scaleFont[axis], AxisScale, axis));
cache.scaleTitleColor[axis] = scale->titleColor();
scale->setTitleColor(
color(cache.scaleTitleColor[axis], AxisTitle, axis));
cache.scaleTitleFont[axis] = scale->titleFont();
scale->setTitleFont(
font(cache.scaleTitleFont[axis], AxisTitle, axis));
int startDist, endDist;
scale->minBorderDist(startDist, endDist);
scale->setBorderDist(startDist, endDist);
}
}
cache.widgetBackground = plot->backgroundColor();
plot->setBackgroundColor(color(cache.widgetBackground, WidgetBackground));
cache.canvasBackground = plot->canvasBackground();
plot->setCanvasBackground(color(cache.canvasBackground, CanvasBackground));
QPen pen = plot->d_grid->majPen();
cache.gridColors[0] = pen.color();
pen.setColor(color(pen.color(), MajorGrid));
plot->d_grid->setMajPen(pen);
pen = plot->d_grid->minPen();
cache.gridColors[1] = pen.color();
pen.setColor(color(pen.color(), MinorGrid));
plot->d_grid->setMinPen(pen);
//.........这里部分代码省略.........