Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. migration from Qt 4.8 to Qt 5.0.2 qmetatype error

migration from Qt 4.8 to Qt 5.0.2 qmetatype error

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 701 Views 1 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.
  • N Offline
    N Offline
    NinDza
    wrote on last edited by
    #1

    I just moved to Qt 5.0.2. I am developing app on embedded linux with linaro-gnueabihf toolchain and I am struggling with compile error:

                   from ../../cashless2_new/mgplayer/playlistdata.h:5,
                     from moc_playlistdata.cpp:9:
    ../../../Downloads/QT_build/5.02/include/QtCore/qmetatype.h: In instantiation of ‘int qMetaTypeId(T*) [with T = QVector<ResourceData*>*]’:
    ../../../Downloads/QT_build/5.02/include/QtCore/qmetatype.h:656:29:   required from ‘int qRegisterMetaType(T*) [with T = QVector<ResourceData*>*]’
    moc_playlistdata.cpp:144:95:   required from here
    ../../../Downloads/QT_build/5.02/include/QtCore/qmetatype.h:642:5: error: invalid application of ‘sizeof’ to incomplete type ‘QStaticAssertFailure<false>’
    make[1]: *** [moc_playlistdata.o] Error 1
    make[1]: Leaving directory `/home/nindza/TortoiseWork/build-cashless_app-new_A20_new-Release/mgplayer'
    make: *** [sub-mgplayer-make_first-ordered] Error 2
    18:07:47: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project cashless_app (kit: new A20)
    When executing step "Make"
    

    I tried to qRegisterMetaType<QVector<ResourceData*>>("QVector<ResourceData>"); in main or in ResourceData constructor and Q_DECLARE_METATYPE(QVector<ResourceData>*) outside ResourceData class declaraion in header, but nothing worked for me

    I am using slots and signals

    public slots:
    .....
        void setResources(QVector<ResourceData*>* arg);
    
    
    signals:
    ......
        void resourcesChanged(QVector<ResourceData*>* arg);
    

    class declaration

    class class : public QObject
    {
        Q_OBJECT
    
    ........
    

    QtCreator points error in qmetatype.h line 642 Q_STATIC_ASSERT_X

    {
        Q_STATIC_ASSERT_X(QMetaTypeId2<T>::Defined, "Type is not registered, please use the Q_DECLARE_METATYPE macro to make it known to Qt's meta-object system");
        return QMetaTypeId2<T>::qt_metatype_id();
    }
    

    any idea what should I do?

    thanks for any help

    I am cross compiling on ubuntu 14 on arm device

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      It seems you are not registering the same types you are using in your classes and you are trying to lie to the system.

      With Qt 5, remove the string from the qRegisterMetaType calls.

      On a side note, why 5.0.2 ? The current version of Qt is 5.8 with 5.9 hitting beta. If you need LTS then theres Qt 5.6.

      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
      0

      • Login

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