Results 1 to 3 of 3

Thread: QSqlField real type name

  1. #1
    Join Date
    Mar 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default QSqlField real type name

    i'm looking for a way to retrieve real database type name from qtsql model.

    Unfortunately

    Qt Code:
    1. QVariant::typeToName(field.type())
    To copy to clipboard, switch view to plain text mode 
    Where field is
    Qt Code:
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QSqlField real type name

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QSqlField real type name

    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.

Similar Threads

  1. Replies: 2
    Last Post: 27th November 2013, 01:56
  2. Replies: 2
    Last Post: 22nd December 2009, 21:52
  3. QVariant not returning proper type for SQLite REAL
    By rakkar in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2009, 21:25
  4. QSqlField.requiredStatus returns unknown - Sqlite.
    By Avrohom in forum Qt Programming
    Replies: 0
    Last Post: 16th June 2009, 21:24
  5. QSqlField discovery auto_increment int value
    By patrik08 in forum Qt Programming
    Replies: 6
    Last Post: 3rd December 2006, 12:19

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.