本文整理汇总了C++中qstringlist::Iterator::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::contains方法的具体用法?C++ Iterator::contains怎么用?C++ Iterator::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::Iterator
的用法示例。
在下文中一共展示了Iterator::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preprocessMessage
void KviWindow::preprocessMessage(QString & szMessage)
{
// FIXME: slow
if(!m_pConsole)
return;
if(!m_pConsole->connection())
return;
static QString szNonStandardLinkPrefix = QString::fromAscii("\r![");
if(szMessage.contains(szNonStandardLinkPrefix))
return; // contains a non standard link that may contain spaces, do not break it.
// FIXME: This STILL breaks $fmtlink() in certain configurations
QStringList strings = szMessage.split(" ");
for(QStringList::Iterator it = strings.begin(); it != strings.end(); ++it )
{
if(it->contains('\r'))
continue;
QString szTmp(*it);
szTmp = KviControlCodes::stripControlBytes(szTmp).trimmed();
if(szTmp.length() < 1)
continue;
if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().contains(szTmp[0]))
{
if((*it) == szTmp)
*it = QString("\r!c\r%1\r").arg(*it);
else
*it = QString("\r!c%1\r%2\r").arg(szTmp,*it);
}
}
szMessage = strings.join(" ");
}
示例2: run
//.........这里部分代码省略.........
{
QMessageBox::StandardButton ret = QMessageBox::question( 0, QStringLiteral( "Warning" ),
tr( "Output %1 exists! Overwrite?" ).arg( outputExists.join( QStringLiteral( "," ) ) ),
QMessageBox::Ok | QMessageBox::Cancel );
if ( ret == QMessageBox::Cancel )
return;
arguments.append( QStringLiteral( "--o" ) );
}
}
// Remember output maps
mOutputVector = mOptions->output( QgsGrassModuleOption::Vector );
QgsDebugMsg( QString( "mOutputVector.size() = %1" ).arg( mOutputVector.size() ) );
mOutputRaster = mOptions->output( QgsGrassModuleOption::Raster );
QgsDebugMsg( QString( "mOutputRaster.size() = %1" ).arg( mOutputRaster.size() ) );
mSuccess = false;
mViewButton->setEnabled( false );
QStringList list = mOptions->arguments();
list << arguments;
QStringList argumentsHtml;
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
QgsDebugMsg( "option: " + ( *it ) );
//command.append ( " " + *it );
arguments.append( *it );
//mProcess.addArgument( *it );
// Quote options with special characters so that user
// can copy-paste-run the command
if ( it->contains( QRegExp( "[ <>\\$|;&]" ) ) )
{
argumentsHtml.append( "\"" + *it + "\"" );
}
else
{
argumentsHtml.append( *it );
}
}
/* WARNING - TODO: there was a bug in GRASS 6.0.0 / 6.1.CVS (< 2005-04-29):
* db_start_driver set GISRC_MODE_MEMORY eviroment variable to 1 if
* G_get_gisrc_mode() == G_GISRC_MODE_MEMORY but the variable wasn't unset
* if G_get_gisrc_mode() == G_GISRC_MODE_FILE. Because QGIS GRASS provider starts drivers in
* G_GISRC_MODE_MEMORY mode, the variable remains set in variable when a module is run
* -> unset GISRC_MODE_MEMORY. Remove later once 6.1.x / 6.0.1 is widespread.
* */
putenv( ( char * ) "GISRC_MODE_MEMORY" ); // unset
mOutputTextBrowser->clear();
QProcessEnvironment environment = processEnvironment( mDirect );
environment.insert( QStringLiteral( "GRASS_HTML_BROWSER" ), QgsGrassUtils::htmlBrowserPath() );
// Warning: it is not useful to write requested region to WIND file and
// reset then to original because it is reset before
// the region is read by a module even if waitForStarted() is used
// -> necessary to pass region as environment variable
// but the feature is available in GRASS 6.1 only since 23.3.2006
if ( resetRegion )
{
QString reg = QgsGrass::regionString( &tempWindow );
QgsDebugMsg( "reg: " + reg );