It's a const member function, and we need to do use non const members of QSqlQuery so this is the most convenient place to slip in a const_cast.