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. Type conversion already registered warnings at runtime
Forum Updated to NodeBB v4.3 + New Features

Type conversion already registered warnings at runtime

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 470 Views 2 Watching
  • 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by ocgltd
    #1

    I sometimes see this type of error when my app starts:

    Type conversion already registered from type QList<QPair<QString,QString> > to type QtMetaTypePrivate::QSequentialIterableImpl
    Type conversion already registered from type QList<QSslError> to type QtMetaTypePrivate::QSequentialIterableImpl
    

    And my code does make use of QList<QPair<QString,QString> > and QList<QSslError>, and I do register these metatypes. Why are these errors appearing? (I sometimes get similar warnings for other types...but same question)

    Pl45m4P 1 Reply Last reply
    0
    • ocgltdO ocgltd

      I sometimes see this type of error when my app starts:

      Type conversion already registered from type QList<QPair<QString,QString> > to type QtMetaTypePrivate::QSequentialIterableImpl
      Type conversion already registered from type QList<QSslError> to type QtMetaTypePrivate::QSequentialIterableImpl
      

      And my code does make use of QList<QPair<QString,QString> > and QList<QSslError>, and I do register these metatypes. Why are these errors appearing? (I sometimes get similar warnings for other types...but same question)

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @ocgltd said in Type conversion already registered warnings at runtime:

      I do register these metatypes

      In fact, you don't need to, see:

      Some types are registered automatically and do not need this macro:

      • Pointers to classes derived from QObject
      • QList<T>, QVector<T>, QQueue<T>, QStack<T>, QSet<T> or QLinkedList<T> where T is a registered meta type
      • QHash<T1, T2>, QMap<T1, T2> or std::pair<T1, T2> where T1 and T2 are registered meta types

      QPair<T1, T2> is just a typedef for std::pair<T1, T2>
      So you don't have to declare or register the type when using simple QString data as template type.
      Different story when using your own custom type. Then you need to register and declare your new metatype.
      And because the pair type is registered already, you don't have to worry when using it as QList type...
      Remove your declaration of these types and check if it breaks anything or the warning disappears.

      (https://doc.qt.io/qt-6/qmetatype.html#Q_DECLARE_METATYPE)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2

      • Login

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