Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>We have been using the QtSql classes for a couple of years now, we are currently using the ODBC driver to connect to MSSql instance. Overall the the whole interface performs it's taks reasonably well. It insulates you completely from the Database driver <code>QSqlDatabase</code>, <code>QSqlQuery</code> and <code>QSqlResult</code> at the forefront, there are some abstractions that also insulate you from actual SQL <code>QSqlTableModel</code> and <code>QSqlRelationalTableModel</code> but those are geared for use in any of the Qt views. There is also a class <code>QDataWidgetMapper</code> that helps you map data to non table views. Also QVariant does an excelent job of wrapping SQL data, and providing typed access to the result of a query. While all of this is very helpful, unless your application is small in scope it won't save you from having to come up with a decent DAO layer, none of the Qt classes provide that. </p> <p>We have a process where we turn a - custom made - xml description into a sql script for creating a table, a qt wrapper class for <code>QSqlRecord</code> and we use <code>QSqlTableModel</code> for most of our CRUD work. That work reasonably well but there is a lot of overhead in these classes so I would not repeat this approach. </p> <p>We did find some quirks with the ODBC driver, I am sure there are some other quirks with the oracle driver. OTOH we are reasonably sure that we will be able to switch from MS-SQL to ORACLE within a short amount of time.</p> <p>As for starting points, I think there is a simple example in the qt examples.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload