Ok, so this may not be the 'best' method but it was easy enough and does the job as far as I am concerned.
Looking at the QByteArray there is a method 'fromPercentEncoding', I used it like
seperator
= QByteArray::fromPercentEncoding(ui
->yourInput
->text
().
toAscii(),
'\\');
lineEnd
= QByteArray::fromPercentEncoding(ui
->yourOtherInput
->text
().
toAscii(),
'\\');
seperator = QByteArray::fromPercentEncoding(ui->yourInput->text().toAscii(), '\\');
lineEnd = QByteArray::fromPercentEncoding(ui->yourOtherInput->text().toAscii(), '\\');
To copy to clipboard, switch view to plain text mode
Then to add it to output....
if(-1 != regExpMatcher.indexIn(regExpBuffer.constData()))
{
regExpBuffer.clear();
int numberOfCaps = captures.size();
if(numberOfCaps > 1)
{
captures.removeAt(0);
result += captures.join(seperator.constData()).toAscii();
}
else
result.append(captures.at(0));
result.append(lineEnd);
}
QByteArray result;
if(-1 != regExpMatcher.indexIn(regExpBuffer.constData()))
{
regExpBuffer.clear();
QStringList captures = regExpMatcher.capturedTexts();
int numberOfCaps = captures.size();
if(numberOfCaps > 1)
{
captures.removeAt(0);
result += captures.join(seperator.constData()).toAscii();
}
else
result.append(captures.at(0));
result.append(lineEnd);
}
To copy to clipboard, switch view to plain text mode
I would still be interested if anyone has other ideas, but this seemed simple enough to me.
Bookmarks