本文整理汇总了C++中ScaleDraw::minorTicksStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ ScaleDraw::minorTicksStyle方法的具体用法?C++ ScaleDraw::minorTicksStyle怎么用?C++ ScaleDraw::minorTicksStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScaleDraw
的用法示例。
在下文中一共展示了ScaleDraw::minorTicksStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawItems
void Plot::drawItems (QPainter *painter, const QRect &rect,
const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const
{
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
for (int i=0; i<QwtPlot::axisCnt; i++){
if (!axisEnabled(i))
continue;
drawBreak(painter, rect, map[i], i);
}
painter->restore();
for (int i=0; i<QwtPlot::axisCnt; i++){
if (!axisEnabled(i))
continue;
ScaleEngine *sc_engine = (ScaleEngine *)axisScaleEngine(i);
if (!sc_engine->hasBreak())
continue;
QwtScaleMap m = map[i];
int lb = m.transform(sc_engine->axisBreakLeft());
int rb = m.transform(sc_engine->axisBreakRight());
int start = lb, end = rb;
if (sc_engine->testAttribute(QwtScaleEngine::Inverted)){
end = lb;
start = rb;
}
QRegion cr(rect);
if (i == QwtPlot::xBottom || i == QwtPlot::xTop)
painter->setClipRegion(cr.subtracted(QRegion(start, rect.y(), abs(end - start), rect.height())), Qt::IntersectClip);
else if (i == QwtPlot::yLeft || i == QwtPlot::yRight)
painter->setClipRegion(cr.subtracted(QRegion(rect.x(), end, rect.width(), abs(end - start))), Qt::IntersectClip);
}
QwtPlot::drawItems(painter, rect, map, pfilter);
for (int i=0; i<QwtPlot::axisCnt; i++){
if (!axisEnabled(i))
continue;
ScaleDraw *sd = (ScaleDraw *) axisScaleDraw (i);
int majorTicksType = sd->majorTicksStyle();
int minorTicksType = sd->minorTicksStyle();
bool min = (minorTicksType == ScaleDraw::In || minorTicksType == ScaleDraw::Both);
bool maj = (majorTicksType == ScaleDraw::In || majorTicksType == ScaleDraw::Both);
if (min || maj)
drawInwardTicks(painter, rect, map[i], i, min, maj);
}
}
示例2: axisScaleDraw
QValueList <int> Plot::getMinorTicksType()
{
QValueList <int> minorTicksType;
for (int axis=0; axis<QwtPlot::axisCnt; axis++)
{
if (axisEnabled(axis))
{
ScaleDraw *sd = (ScaleDraw *) axisScaleDraw (axis);
minorTicksType << sd->minorTicksStyle();
}
else
minorTicksType << ScaleDraw::Out;
}
return minorTicksType;
}
示例3: drawItems
void Plot::drawItems (QPainter *painter, const QRect &rect,
const QwtArray< QwtScaleMap > &map, const QwtPlotPrintFilter &pfilter) const
{
QwtPlot::drawItems(painter, rect, map, pfilter);
for (int i=0; i<QwtPlot::axisCnt; i++)
{
if (!axisEnabled(i))
continue;
ScaleDraw *sd = (ScaleDraw *) axisScaleDraw (i);
int majorTicksType = sd->majorTicksStyle();
int minorTicksType = sd->minorTicksStyle();
bool min = (minorTicksType == ScaleDraw::In || minorTicksType == ScaleDraw::Both);
bool maj = (majorTicksType == ScaleDraw::In || majorTicksType == ScaleDraw::Both);
if (min || maj)
drawInwardTicks(painter, rect, map[i], i, min, maj);
}
}