本文整理汇总了C++中qstringlist::iterator::toAscii方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::toAscii方法的具体用法?C++ iterator::toAscii怎么用?C++ iterator::toAscii使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::iterator
的用法示例。
在下文中一共展示了iterator::toAscii方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeImpl
bool muParserScript::executeImpl() {
if (!compile(scriptCode()))
return false;
try {
current = this;
for (QStringList::iterator i = muCode.begin(); i != muCode.end(); ++i) {
parser.SetExpr(i->toAscii().constData());
parser.Eval();
}
} catch (EmptySourceError *) {
return true;
} catch (mu::ParserError &e) {
emit error(e.GetMsg().c_str(), "", 0);
return false;
}
return true;
}
示例2: evaluateImpl
QVariant muParserScript::evaluateImpl() {
if (!compile(scriptCode())) {
return QVariant();
}
double val = 0.0;
try {
current = this;
for (QStringList::iterator i = muCode.begin(); i != muCode.end(); ++i) {
parser.SetExpr(i->toAscii().constData());
val = parser.Eval();
}
} catch (EmptySourceError *) {
return QVariant("");
} catch (ParserError &e) {
emit error(e.GetMsg().c_str(), "", 0);
return QVariant();
}
return QVariant(val);
}
示例3: load
bool OpenBook::load(const char * fname, const Board & i_board)
{
QFile qf(fname);
if ( !qf.open(QIODevice::ReadOnly) )
return false;
QTextStream sbook(&qf);
if ( sbook.status() != QTextStream::Ok )
return false;
UndoInfo tundo[Board::GameLength];
for ( ; !sbook.atEnd(); )
{
QString sline = sbook.readLine();
if ( sline.isEmpty() )
break;
Board board = i_board;
board.set_undoStack(tundo);
board.fromFEN(0);
MovesLine moves;
QStringList slist = sline.split( QObject::tr(" "), QString::SkipEmptyParts);
for (QStringList::iterator it = slist.begin(); it != slist.end(); ++it)
{
Move move;
if ( !strToMove(it->toAscii().data(), board, move) || !board.validateMove(move) )
break;
board.makeMove(move);
moves.push_back(move);
}
mtable_.push_back(moves);
}
return true;
}