Type conversion already registered warnings at runtime
-
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::QSequentialIterableImplAnd 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)
-
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::QSequentialIterableImplAnd 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)
@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 forstd::pair<T1, T2>
So you don't have to declare or register the type when using simpleQStringdata 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 asQListtype...
Remove your declaration of these types and check if it breaks anything or the warning disappears.