本文整理汇总了C++中ErrorList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorList::begin方法的具体用法?C++ ErrorList::begin怎么用?C++ ErrorList::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorList
的用法示例。
在下文中一共展示了ErrorList::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTests
void checkDock::runTests( ValidateType type )
{
for ( int i = 0; i < mTestTable->rowCount(); ++i )
{
QString testName = mTestTable->item( i, 0 )->text();
QString layer1Str = mTestTable->item( i, 3 )->text();
QString layer2Str = mTestTable->item( i, 4 )->text();
// test if layer1 is in the registry
if ( !( ( QgsVectorLayer * )QgsProject::instance()->mapLayers().contains( layer1Str ) ) )
{
QgsMessageLog::logMessage( tr( "Layer %1 not found in registry." ).arg( layer1Str ), tr( "Topology plugin" ) );
return;
}
QgsVectorLayer *layer1 = ( QgsVectorLayer * )QgsProject::instance()->mapLayer( layer1Str );
QgsVectorLayer *layer2 = nullptr;
if ( ( QgsVectorLayer * )QgsProject::instance()->mapLayers().contains( layer2Str ) )
layer2 = ( QgsVectorLayer * )QgsProject::instance()->mapLayer( layer2Str );
QProgressDialog progress( testName, tr( "Abort" ), 0, layer1->featureCount(), this );
progress.setWindowModality( Qt::WindowModal );
connect( &progress, &QProgressDialog::canceled, mTest, &topolTest::setTestCanceled );
connect( mTest, &topolTest::progress, &progress, &QProgressDialog::setValue );
// run the test
ErrorList errors = mTest->runTest( testName, layer1, layer2, type );
QList<TopolError *>::Iterator it;
QgsRubberBand *rb = nullptr;
for ( it = errors.begin(); it != errors.end(); ++it )
{
TopolError *te = *it;
te->conflict();
QgsSettings settings;
if ( te->conflict().type() == QgsWkbTypes::PolygonGeometry )
{
rb = new QgsRubberBand( qgsInterface->mapCanvas(), QgsWkbTypes::PolygonGeometry );
}
else
{
rb = new QgsRubberBand( qgsInterface->mapCanvas(), te->conflict().type() );
}
rb->setColor( "red" );
rb->setWidth( 4 );
rb->setToGeometry( te->conflict(), layer1 );
rb->show();
mRbErrorMarkers << rb;
}
disconnect( &progress, &QProgressDialog::canceled, mTest, &topolTest::setTestCanceled );
disconnect( mTest, &topolTest::progress, &progress, &QProgressDialog::setValue );
mErrorList << errors;
}
mToggleRubberband->setChecked( true );
mErrorListModel->resetModel();
}
示例2: showErrorList
//---------------------------------------------------------------------------
void TMultDispFrame::showErrorList( ErrorList &errs )
{
ErrList->Clear();
for ( ErrorIterator i = errs.begin(); i != errs.end(); i++ )
{
ErrList->Items->Add( ( *i ) ->errStr.c_str() );
}
ErrList->ItemIndex = 0;
}
示例3:
void
TfDiagnosticMgr::_SpliceErrors(ErrorList &src)
{
if (!HasActiveErrorMark()) {
for (ErrorList::const_iterator
i = src.begin(), end = src.end(); i != end; ++i) {
_ReportError(*i);
}
} else {
// Reassign new serial numbers to the errors.
size_t serial = _nextSerial.fetch_and_add(src.size());
for (auto& error : src) {
error._data->_serial = serial++;
}
// Now splice them into the main list.
ErrorList &errorList = _errorList.local();
// We store the begin iterator from the new list. This iterator remains
// valid *after the splice*, and iterates the spliced elements from src
// in errorList.
ErrorList::iterator newErrorsBegin = src.begin();
errorList.splice(errorList.end(), src);
_AppendErrorsToLogText(newErrorsBegin);
}
}
示例4: p
MemCheckIterTools::ErrorListIterator::ErrorListIterator(ErrorList & l, const IterTool & iterTool)
: p(l.begin()), m_end(l.end()), m_iterTool(iterTool)
{
while (p != m_end && m_iterTool.omitSuppressed && p->suppressed)
++p;
}
示例5: runTests
void checkDock::runTests( ValidateType type )
{
for ( int i = 0; i < mTestTable->rowCount(); ++i )
{
QString testName = mTestTable->item( i, 0 )->text();
QString toleranceStr = mTestTable->item( i, 3 )->text();
QString layer1Str = mTestTable->item( i, 4 )->text();
QString layer2Str = mTestTable->item( i, 5 )->text();
// test if layer1 is in the registry
if ( !(( QgsVectorLayer* )mLayerRegistry->mapLayers().contains( layer1Str ) ) )
{
QgsMessageLog::logMessage( tr( "Layer %1 not found in registry." ).arg( layer1Str ), tr( "Topology plugin" ) );
return;
}
QgsVectorLayer* layer1 = ( QgsVectorLayer* )mLayerRegistry->mapLayers()[layer1Str];
QgsVectorLayer* layer2 = 0;
if (( QgsVectorLayer* )mLayerRegistry->mapLayers().contains( layer2Str ) )
layer2 = ( QgsVectorLayer* )mLayerRegistry->mapLayers()[layer2Str];
QProgressDialog progress( testName, tr( "Abort" ), 0, layer1->featureCount(), this );
progress.setWindowModality( Qt::WindowModal );
connect( &progress, SIGNAL( canceled() ), mTest, SLOT( setTestCancelled() ) );
connect( mTest, SIGNAL( progress( int ) ), &progress, SLOT( setValue( int ) ) );
// run the test
ErrorList errors = mTest->runTest( testName, layer1, layer2, type, toleranceStr.toDouble() );
QList<TopolError*>::Iterator it;
QgsRubberBand* rb = 0;
for ( it = errors.begin(); it != errors.end(); ++it )
{
TopolError* te = *it;
te->conflict();
QSettings settings;
if ( te->conflict()->type() == QGis::Polygon )
{
rb = new QgsRubberBand( qgsInterface->mapCanvas(), true );
}
else
{
rb = new QgsRubberBand( qgsInterface->mapCanvas(), te->conflict()->type() );
}
rb->setColor( "red" );
rb->setWidth( 4 );
rb->setToGeometry( te->conflict(), layer1 );
rb->show();
mRbErrorMarkers << rb;
}
disconnect( &progress, SIGNAL( canceled() ), mTest, SLOT( setTestCancelled() ) );
disconnect( mTest, SIGNAL( progress( int ) ), &progress, SLOT( setValue( int ) ) );
mErrorList << errors;
}
mMarkersVisible = true;
mErrorListModel->resetModel();
}