Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QMap<QString,QByteArray> commands = {
- {"check durr",{0xF0,0xC0,0x4F}},
- {"check derp",{0xF0,0xC0,0x4F}},
- {"check hurr",{0xF0,0xC0,0x4F}}
- .....
- };
- if (database.open())
- for (auto q : commands) {
- QSqlQuery query(database);
- query.prepare("INSERT INTO :table (byteData,name) VALUES (:data,:command)");
- query.bindValue(":table", table);
- query.bindValue(":data",command.second, QSql::In | QSql::Binary);
- query.bindValue(":command",command.first);
- query.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment