Results 1 to 2 of 2

Thread: SQL Query column names

  1. #1
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default SQL Query column names

    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?

  2. #2
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: SQL Query column names

    Finally found it.

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

Similar Threads

  1. SQL query - navigation buttons
    By apffal in forum Qt Programming
    Replies: 1
    Last Post: 5th August 2009, 09:38
  2. MS SQL Query
    By baray98 in forum General Programming
    Replies: 0
    Last Post: 14th July 2009, 05:25
  3. QTableWidget Sql Query 25.000 records
    By aekilic in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2008, 15:54
  4. Sql Query Problem
    By MrShahi in forum Qt Programming
    Replies: 6
    Last Post: 30th May 2008, 10:16
  5. Sql Server cannot retrieve data from select
    By Atomino in forum Qt Programming
    Replies: 10
    Last Post: 7th September 2006, 17:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.