本文整理汇总了C++中QwtPlotMarker::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::draw方法的具体用法?C++ QwtPlotMarker::draw怎么用?C++ QwtPlotMarker::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawCanvas
//! Redraw grid, curves, and markers. The draw code
// does not clear clipRegion prior to painting.
// \param p painter used for drawing
void QwtPlot::drawCanvas(QPainter *p)
{
QwtDiMap map[axisCnt];
for ( int axis = 0; axis < axisCnt; axis++ )
map[axis] = canvasMap(axis);
QRect rect = d_canvas->contentsRect();
//
// draw grid
//
if ( d_grid.enabled() &&
axisEnabled( d_grid.xAxis() ) &&
axisEnabled( d_grid.yAxis() ) )
{
d_grid.draw(p, rect, map[d_grid.xAxis()], map[d_grid.yAxis()]);
}
//
// draw curves
//
QIntDictIterator<QwtPlotCurve> itc(*d_curves);
for (QwtPlotCurve *curve = itc.toFirst(); curve != 0; curve = ++itc )
{
if ( curve->enabled() &&
axisEnabled( curve->xAxis() ) &&
axisEnabled( curve->yAxis() ) )
{
curve->draw(p, map[curve->xAxis()], map[curve->yAxis()]);
}
}
//
// draw markers
//
QIntDictIterator<QwtPlotMarker> itm(*d_markers);
for (QwtPlotMarker *marker = itm.toFirst(); marker != 0; marker = ++itm )
{
if ( marker->enabled() && axisEnabled( marker->xAxis() ) &&
axisEnabled( marker->yAxis() ) )
{
marker->draw(p,
map[marker->xAxis()].transform(marker->xValue()),
map[marker->yAxis()].transform(marker->yValue()),
rect);
}
}
}
示例2: drawCanvasItems
void QwtPlot::drawCanvasItems(QPainter *painter, const QRect &rect,
const QwtArray<QwtDiMap> &map, const QwtPlotPrintFilter &pfilter) const
{
//
// draw grid
//
if ( pfilter.options() & QwtPlotPrintFilter::PrintGrid )
{
if ( d_grid->enabled() )
{
d_grid->draw(painter, rect,
map[d_grid->xAxis()], map[d_grid->yAxis()]);
}
}
//
// draw curves
//
QwtPlotCurveIterator itc = curveIterator();
for (QwtPlotCurve *curve = itc.toFirst(); curve != 0; curve = ++itc )
{
if ( curve->enabled() )
{
curve->draw(painter,
map[curve->xAxis()], map[curve->yAxis()]);
}
}
//
// draw markers
//
QwtPlotMarkerIterator itm = markerIterator();
for (QwtPlotMarker *marker = itm.toFirst(); marker != 0; marker = ++itm )
{
if ( marker->enabled() )
{
marker->draw(painter,
map[marker->xAxis()].transform(marker->xValue()),
map[marker->yAxis()].transform(marker->yValue()),
rect);
}
}
}