Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2011 23:40
Show Gist options
  • Select an option

  • Save anonymous/1536719 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/1536719 to your computer and use it in GitHub Desktop.
QVariantList LeoqDb::childNodes(int parentid)
{
QSqlQuery q("select EDGES.b, EDGES.pos, NODES.id, NODES.h from EDGES, NODES where EDGES.a = ? and NODES.id = EDGES.b order by EDGES.pos");
q.bindValue(0, QVariant(parentid));
doexec(q);
QVariantList res;
while (q.next()) {
QVariantMap ent;
ent["id"] = q.value(2);
ent["h"] = q.value(3);
qDebug() << ent;
res.append(ent);
}
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment