I do not use mysql but postgresql and the syntax is different.
I do not understand why you need Transaction, for this short commands you can write as follows:

QSqlQuery query;
query.exec("INSERT INTO table1 VALUES(2250, 0, .9, .99)");
query.exec("INSERT INTO table2 VALUES('jhon','jfdd', '2018-01-01 00:00:00', LAST_INSERT_ID())");