En esta página

Los cambios introducidos en Qt SQL

Qt 6 son el resultado del esfuerzo consciente por hacer el framework más eficiente y fácil de usar.

Intentamos mantener la compatibilidad binaria y de código fuente de todas las API públicas en cada versión. Pero algunos cambios eran inevitables en un esfuerzo por hacer de Qt un framework mejor.

En este tema resumimos esos cambios en Qt SQL, y proporcionamos una guía para manejarlos.

La clase QSqlQuery

Firma de boundValues()

El tipo de retorno para boundValues() ha sido cambiado de QMap<QString, QVariant> a un QVariantList. Se puede confiar en el orden por lo que estará en el orden del binding en la consulta preparada. Cambie código como el siguiente

QMap<QString, QVariant> values = boundValues();
int id = values[":id"].value().toInt();
QList<QVariant> values = boundValues().values();
int id = values.at(0).toInt();

a:

QList<QVariant> values = boundValues().values();
int id = values.at(0).toInt();

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.