Well, here is how I ended up working around it, although it still is strange that bindValue doesn't replace all of the same placeholders with the same thing if you reference them by name.

Qt Code:
  1. querystring = "insert into table (col1, col2, col3) values ";
  2. for (int i = 0; i < uniquevaluelist.size(); ++i) {
  3.  
  4. querystring += "(:item1, :item2, :item3)";
  5.  
  6. if (i == uniquevaluelist.size() - 1) {
  7.  
  8. } else {
  9. querystring += ", ";
  10. }
  11. }
  12. query.prepare(querystring);
  13.  
  14. int j = 0;
  15. for (int i = 0; i < uniquevaluelist.size(); ++i) {
  16. j = i * 3;
  17. query.bindValue((j + 0), uniquevaluelist.at(i));
  18. query.bindValue((j + 1), "some not unique value");
  19. query.bindValue((j + 2), "some other not unique value");
  20.  
  21. }
  22.  
  23. query.exec();
To copy to clipboard, switch view to plain text mode