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. QMetaType::metaObjectForType returns NULL
Forum Updated to NodeBB v4.3 + New Features

QMetaType::metaObjectForType returns NULL

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 1.7k Views 3 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.
  • V Offline
    V Offline
    VeNToR
    wrote on last edited by
    #1

    Hi;

    QMetaType::metaObjectForType(QMetaType::type("IChRSMSession*")) returns NULL.

    IChRSMSession is interface that defined in DLL/Library as above;

    class IChRSMSession
    {
    Q_GADGET
    ..
    };

    QT_BEGIN_NAMESPACE

    #define IChRSMSession_IID "com.motiontrue.plugins.IChRSMSession"

    Q_DECLARE_INTERFACE(IChRSMSession, IChRSMSession_IID)

    QT_END_NAMESPACE

    Q_DECLARE_METATYPE(IChRSMSession*)

    jsulmJ kshegunovK 2 Replies Last reply
    0
    • V VeNToR

      Hi;

      QMetaType::metaObjectForType(QMetaType::type("IChRSMSession*")) returns NULL.

      IChRSMSession is interface that defined in DLL/Library as above;

      class IChRSMSession
      {
      Q_GADGET
      ..
      };

      QT_BEGIN_NAMESPACE

      #define IChRSMSession_IID "com.motiontrue.plugins.IChRSMSession"

      Q_DECLARE_INTERFACE(IChRSMSession, IChRSMSession_IID)

      QT_END_NAMESPACE

      Q_DECLARE_METATYPE(IChRSMSession*)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @VeNToR Did you register it using http://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      1
      • jsulmJ jsulm

        @VeNToR Did you register it using http://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType ?

        V Offline
        V Offline
        VeNToR
        wrote on last edited by
        #3

        @jsulm Yes, I did. qRegisterMetaType<IChRSMSession*>();

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

          Hi,

          Because there are none. A Q_GADGET is not a QObject based class. You only have the staticMetaObject like describe in the macro documentation.

          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
          • V VeNToR

            Hi;

            QMetaType::metaObjectForType(QMetaType::type("IChRSMSession*")) returns NULL.

            IChRSMSession is interface that defined in DLL/Library as above;

            class IChRSMSession
            {
            Q_GADGET
            ..
            };

            QT_BEGIN_NAMESPACE

            #define IChRSMSession_IID "com.motiontrue.plugins.IChRSMSession"

            Q_DECLARE_INTERFACE(IChRSMSession, IChRSMSession_IID)

            QT_END_NAMESPACE

            Q_DECLARE_METATYPE(IChRSMSession*)

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            As @SGaist said there's no such thing, but to pile on IChRSMSession* isn't even a gadget it's simply a pointer.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • V Offline
              V Offline
              VeNToR
              wrote on last edited by
              #6

              Thanks your returns. I wrote virtual function to get QMetaObject of the up class of interface class.

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

                How did you do that ?

                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