Guest User

Untitled

a guest
May 23rd, 2014
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1.  
  2. QMap<QString,QByteArray> commands = {
  3.    {"check durr",{0xF0,0xC0,0x4F}},
  4.    {"check derp",{0xF0,0xC0,0x4F}},
  5.    {"check hurr",{0xF0,0xC0,0x4F}}
  6.    .....
  7. };
  8.  
  9. if (database.open())
  10.     for (auto q : commands) {
  11.         QSqlQuery query(database);
  12.  
  13.         query.prepare("INSERT INTO :table (byteData,name) VALUES (:data,:command)");
  14.         query.bindValue(":table", table);
  15.         query.bindValue(":data",command.second, QSql::In | QSql::Binary);
  16.         query.bindValue(":command",command.first);
  17.  
  18.         return query.exec();
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment