本文整理汇总了C++中Plot::addGuidelines方法的典型用法代码示例。如果您正苦于以下问题:C++ Plot::addGuidelines方法的具体用法?C++ Plot::addGuidelines怎么用?C++ Plot::addGuidelines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plot
的用法示例。
在下文中一共展示了Plot::addGuidelines方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
//---------------------------------------------------------------------------
Plots::Plots( QWidget *parent, FileInformation* fileInformation ) :
QWidget( parent ),
m_zoomFactor ( 0 ),
m_fileInfoData( fileInformation ),
m_dataTypeIndex( Plots::AxisSeconds )
{
setlocale(LC_NUMERIC, "C");
QGridLayout* layout = new QGridLayout( this );
layout->setSpacing( 1 );
layout->setContentsMargins( 0, 0, 0, 0 );
// bottom scale
m_scaleWidget = new PlotScaleWidget();
m_scaleWidget->setFormat( Plots::AxisTime );
setVisibleFrames( 0, numFrames() - 1 );
// plots and legends
m_plots = new Plot**[m_fileInfoData->Stats.size()];
m_plotsCount = 0;
for ( size_t streamPos = 0; streamPos < m_fileInfoData->Stats.size(); streamPos++ )
{
if (m_fileInfoData->Stats[streamPos])
{
size_t type = m_fileInfoData->Stats[streamPos]->Type_Get();
size_t countOfGroups = PerStreamType[type].CountOfGroups;
m_plots[streamPos] = new Plot*[countOfGroups + 1]; //+1 for axix
for ( size_t group = 0; group < countOfGroups; group++ )
{
if (m_fileInfoData->ActiveFilters[PerStreamType[type].PerGroup[group].ActiveFilterGroup])
{
Plot* plot = new Plot( streamPos, type, group, fileInformation, this );
plot->addGuidelines(m_fileInfoData->BitsPerRawSample());
if(type == Type_Video)
adjustGroupMax(group, m_fileInfoData->BitsPerRawSample());
// we allow to shrink the plot below height of the size hint
plot->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Expanding );
plot->setAxisScaleDiv( QwtPlot::xBottom, m_scaleWidget->scaleDiv() );
initYAxis( plot );
updateSamples( plot );
connect( plot, SIGNAL( cursorMoved( int ) ), SLOT( onCursorMoved( int ) ) );
plot->canvas()->installEventFilter( this );
layout->addWidget( plot, m_plotsCount, 0 );
layout->addWidget( plot->legend(), m_plotsCount, 1 );
m_plots[streamPos][group] = plot;
m_plotsCount++;
qDebug() << "g: " << plot->group() << ", t: " << plot->type() << ", m_plotsCount: " << m_plotsCount;
}
else
{
m_plots[streamPos][group] = NULL;
}
}
}
else
{
m_plots[streamPos]=NULL;
}
}
layout->addWidget( m_scaleWidget, m_plotsCount, 0, 1, 2 );
// combo box for the axis format
XAxisFormatBox* xAxisBox = new XAxisFormatBox();
xAxisBox->setCurrentIndex( Plots::AxisTime );
connect( xAxisBox, SIGNAL( currentIndexChanged( int ) ),
this, SLOT( onXAxisFormatChanged( int ) ) );
int axisBoxRow = layout->rowCount() - 1;
#if 1
// one row below to have space enough for bottom scale tick labels
layout->addWidget( xAxisBox, m_plotsCount + 1, 1 );
#else
layout->addWidget( xAxisBox, layout_y, 1 );
#endif
layout->setColumnStretch( 0, 10 );
layout->setColumnStretch( 1, 0 );
m_scaleWidget->setScale( m_timeInterval.from, m_timeInterval.to);
setCursorPos( framePos() );
}