Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 6.0 adaptation: warning: 'QSqlField' is deprecated: Use the constructor using a QMetaType instead. How to solve?
QtWS25 Last Chance

Qt 6.0 adaptation: warning: 'QSqlField' is deprecated: Use the constructor using a QMetaType instead. How to solve?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 198 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on last edited by
    #1

    Hello all!
    How to solve this kind of Qt 6.0 issue:

    warning: 'QSqlField' is deprecated: Use the constructor using a QMetaType instead [-Wdeprecated-declarations]
            QSqlField fld(q.value(1).toString(), qGetColumnType(typeName), tableName);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The answer is in the warning, see QSqlField's second constructor.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Dupe of https://forum.qt.io/topic/125644/qt-6-0-adaptation-warning-string-is-deprecated-use-qmetatype-type-instead-how-to-solve ... wonder why it's so hard to read the error message. It contains the answer...

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved