Nope! You are wrong!
QSqlTableModel inharits form QSqlQueryModel. One version of setQuery is repated in QSqlTableModel to make it protected for some reason. Second version is still public and you can and should use it.