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. Qt6 Trying to construct an instance of an invalid type, type id: 1024

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt6qvariant
4 Posts 3 Posters 954 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 3 Apr 2021, 11:14 last edited by
    #1

    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

    1 Reply Last reply
    1
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 3 Apr 2021, 15:41 last edited by
      #2

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

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

      D 1 Reply Last reply 3 Apr 2021, 16:27
      0
      • C Christian Ehrlicher
        3 Apr 2021, 15:41

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

        D Offline
        D Offline
        Dariusz
        wrote on 3 Apr 2021, 16:27 last edited by Dariusz 4 Mar 2021, 16:29
        #3

        @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 :/

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Martin Burchell
          wrote on 15 Oct 2022, 06:16 last edited by
          #4

          @Dariusz Did you ever figure out the problem? I'm seeing something similar having moved to Qt6.2

          1 Reply Last reply
          0

          • Login

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