PDA

View Full Version : QSqlField real type name



Krycho
11th March 2014, 15:14
i'm looking for a way to retrieve real database type name from qtsql model.

Unfortunately


QVariant::typeToName(field.type())
Where field is
QSqlField

type gives me already mapped type to some Qt type. Is it possible to get real names using Qt?

wysota
20th March 2014, 17:28
The whole point behind the sql module is to abstract the actual dbms differences. You can try looking into what QSqlDriver has to offer, that's the link between the abstraction and the actual dbms implementation. However I don't see anything in the public API which would return what you require.

Krycho
21st March 2014, 14:55
I've built my own interface on top of qtsql module and implemented sql queries to retrieve data from database separately for every driver. This is the only way i've found as qt does not provide this information.