PDA

View Full Version : SQL Query column names



rakkar
9th September 2009, 18:24
I've been looking for an hour and am about to tear my hair out and explode into a million bloody pieces. Given an QSqlQuery and a QSqlQueryModel, how the heck do I get the column names returned from the query?

rakkar
9th September 2009, 19:06
Finally found it.

const QVariant &v = model.record().field(columnIndex).type();
model.record().fieldName(columnIndex);