Hi,

Im playing with sql and found some strange things

Qt Code:
  1. mSqlModel.setTable("test");
  2. mSqlModel.setEditStrategy(QSqlTableModel::OnManualSubmit);
  3. mSqlModel.select();
  4.  
  5. for(int row=0;row<500;row++)
  6. {
  7. QSqlRecord record = mSqlModel.record();
  8. record.setValue("str1",QVariant("blah"));
  9. record.setValue("value",QVariant(row));
  10. record.setValue("str2",QVariant("123abc"));
  11. mSqlModel.insertRecord(-1,record);
  12. if(!mSqlModel.submitAll())
  13. std::cout << "Can't add row=" << std::endl;
  14. }
To copy to clipboard, switch view to plain text mode 

Maybe someone can help me here:
- mSqlModel.submitAll() returns always false
- If I run the code twice or more I only get 756 records (500 through the first run).
- If I run that in a seperate thread I get max 256 records
- if I use
Qt Code:
  1. mSqlModel.insertRecord(row,record);
To copy to clipboard, switch view to plain text mode 
I get sometimes only 256 records added

Can someone tell me what I'm doing wrong here?
Thanks a lot.