本文整理汇总了C++中QwtPlotItem::testItemInterest方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotItem::testItemInterest方法的具体用法?C++ QwtPlotItem::testItemInterest怎么用?C++ QwtPlotItem::testItemInterest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotItem
的用法示例。
在下文中一共展示了QwtPlotItem::testItemInterest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAxes
//! Rebuild the scales
void QwtPlot::updateAxes()
{
// Find bounding interval of the item data
// for all axes, where autoscaling is enabled
QwtInterval intv[axisCnt];
const QwtPlotItemList& itmList = itemList();
QwtPlotItemIterator it;
for ( it = itmList.begin(); it != itmList.end(); ++it )
{
const QwtPlotItem *item = *it;
if ( !item->testItemAttribute( QwtPlotItem::AutoScale ) )
continue;
if ( !item->isVisible() )
continue;
if ( axisAutoScale( item->xAxis() ) || axisAutoScale( item->yAxis() ) )
{
const QRectF rect = item->boundingRect();
if ( rect.width() >= 0.0 )
intv[item->xAxis()] |= QwtInterval( rect.left(), rect.right() );
if ( rect.height() >= 0.0 )
intv[item->yAxis()] |= QwtInterval( rect.top(), rect.bottom() );
}
}
// Adjust scales
for ( int axisId = 0; axisId < axisCnt; axisId++ )
{
AxisData &d = *d_axisData[axisId];
double minValue = d.minValue;
double maxValue = d.maxValue;
double stepSize = d.stepSize;
if ( d.doAutoScale && intv[axisId].isValid() )
{
d.isValid = false;
minValue = intv[axisId].minValue();
maxValue = intv[axisId].maxValue();
d.scaleEngine->autoScale( d.maxMajor,
minValue, maxValue, stepSize );
}
if ( !d.isValid )
{
d.scaleDiv = d.scaleEngine->divideScale(
minValue, maxValue,
d.maxMajor, d.maxMinor, stepSize );
d.isValid = true;
}
QwtScaleWidget *scaleWidget = axisWidget( axisId );
scaleWidget->setScaleDiv( d.scaleDiv );
int startDist, endDist;
scaleWidget->getBorderDistHint( startDist, endDist );
scaleWidget->setBorderDist( startDist, endDist );
}
for ( it = itmList.begin(); it != itmList.end(); ++it )
{
QwtPlotItem *item = *it;
if ( item->testItemInterest( QwtPlotItem::ScaleInterest ) )
{
item->updateScaleDiv( axisScaleDiv( item->xAxis() ),
axisScaleDiv( item->yAxis() ) );
}
}
}