Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt6 Trying to construct an instance of an invalid type, type id: 1024



  • Hey

    I just ported to Qt6 and I'm getting bombarded with > Trying to construct an instance of an invalid type, type id: 1024 / + a lot more ids.

    In the past I was using stuff like >

        //qRegisterMetaTypeStreamOperators<icVecInt>("icVecInt");
        //qRegisterMetaTypeStreamOperators<icVecFloat>("icVecFloat");
        //qRegisterMetaTypeStreamOperators<icVecDouble>("icVecDouble");
    
    //qRegisterMetaTypeStreamOperators<QVector<int>>("QVector<int>");
    

    +a lot more registers. But they all seem to be deprecated now. But yet my QVariants break :- (

    How can I properly address it?

    Im totally lost with QVariant and QMetaType so this is all black magic to me :/

    TIa


  • Lifetime Qt Champion

    Then call qRegisterMetaType<> for them which you should also have done for Qt5 already.



  • @Christian-Ehrlicher Yes I had them set early in the code. They are still in Qt6 so I did not touch them. But I still got those issues. I'm stuck at it for an entire day now.
    When Im deserializing a byteArray and load it into QMap<int, QMap<int, QVariant>> I keep getting those issues. Im deserializing custom treeItem.
    hmmmm I need to make a standalone example & post it here. Any idea how to narrow down object type?>

    ######
    			WARNING: Trying to construct an instance of an invalid type, type id: 1024
     (\Users\qt\work\qt\qtbase\src\corelib\kernel\qmetatype.cpp:2901, const class QtPrivate::QMetaTypeInterface *__cdecl interfaceForType(int))
    ######
    
    
    ######
    			WARNING: Trying to construct an instance of an invalid type, type id: 1768117861
     (\Users\qt\work\qt\qtbase\src\corelib\kernel\qmetatype.cpp:2901, const class QtPrivate::QMetaTypeInterface *__cdecl interfaceForType(int))
    ######
    

    I got lots of these errors :/


Log in to reply