Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created February 1, 2012 20:19
Show Gist options
  • Save Alir3z4/1719069 to your computer and use it in GitHub Desktop.
Save Alir3z4/1719069 to your computer and use it in GitHub Desktop.
const std::vector<std::string> fromQVector(const QVector<QString> &qVect)
{
std::vector<std::string> stdVect;
for (int i = 0; i < qVect.size(); ++i) {
stdVect.push_back(qVect[i].toStdString());
}
return stdVect;
}
const std::map<std::string, std::string> Aria2c::fromQMap(const QMap<QString, QString> &qMap)
{
std::map<std::string, std::string> stdMap;
QMap<QString, QString>::const_iterator i = qMap.constBegin();
while (i != qMap.constEnd()) {
stdMap.insert(std::pair<std::string, std::string>(i.key().toStdString(), i.value().toStdString()));
}
return stdMap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment