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. QObject::connect error / Make sure '...' is registered using qRegisterMetaType()

QObject::connect error / Make sure '...' is registered using qRegisterMetaType()

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 561 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.
  • M Offline
    M Offline
    makopo
    wrote on last edited by
    #1

    Hey there,

    for now I'am not really experienced in developing with Qt.
    I develop a little program that captures video from an external device. When I start the the program, it is running, but when I press the start button which should start the capture VS prints the following message to the console:

    QObject::connect: Cannot queue arguments of type 'CComPtr<IDeckLinkVideoFrame>'
    (Make sure 'CComPtr<IDeckLinkVideoFrame>' is registered using qRegisterMetaType().)
    

    I read about qRegisterMetaType() and try to implement it in the constructor of both classes, like this:

    qRegisterMetaType<IDeckLinkVideoFrame*>("IDeckLinkVideoFrame*");
    

    I also create a register function in an initializing class and call the function in the constructors too. I still get the error message.

    In the programm I use connect for the frame transfer:

    QObject::connect(m_emitFrame, &VideoScreenHelper::FrameChanged, this, &VideoScreen::HandleFrame, Qt::AutoConnection);
    

    FrameChanged is emitted in a function that is supported from the DeckLink API. This function should draw the video to the screen.

    /**
    * The method is called on every incoming frame and is derived from the IDeckLinkScreenPreviewCallback
    */
    HRESULT VideoScreenHelper::DrawFrame(IDeckLinkVideoFrame* theFrame) {
    
    	emit FrameChanged(CComPtr<IDeckLinkVideoFrame> (theFrame));
    	return S_OK;
    }
    

    HandleFrame() manages the setup of the frame.

    void VideoScreen::HandleFrame(CComPtr<IDeckLinkVideoFrame> theFrame) {
    	if (m_previewHelper != nullptr) {
    		m_previewHelper->SetFrame(theFrame);
    	}
    }
    

    Can someone of you tell me what is going wrong here? It is still confusing...

    Pl45m4P 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @makopo said in QObject::connect error / Make sure '...' is registered using qRegisterMetaType():

      CComPtr<IDeckLinkVideoFrame>
      Make sure 'CComPtr<IDeckLinkVideoFrame>' is registered using qRegisterMetaType().

      qRegisterMetaType<IDeckLinkVideoFrame*>("IDeckLinkVideoFrame*");

      This is not what the error message told you.

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

      1 Reply Last reply
      2
      • M makopo

        Hey there,

        for now I'am not really experienced in developing with Qt.
        I develop a little program that captures video from an external device. When I start the the program, it is running, but when I press the start button which should start the capture VS prints the following message to the console:

        QObject::connect: Cannot queue arguments of type 'CComPtr<IDeckLinkVideoFrame>'
        (Make sure 'CComPtr<IDeckLinkVideoFrame>' is registered using qRegisterMetaType().)
        

        I read about qRegisterMetaType() and try to implement it in the constructor of both classes, like this:

        qRegisterMetaType<IDeckLinkVideoFrame*>("IDeckLinkVideoFrame*");
        

        I also create a register function in an initializing class and call the function in the constructors too. I still get the error message.

        In the programm I use connect for the frame transfer:

        QObject::connect(m_emitFrame, &VideoScreenHelper::FrameChanged, this, &VideoScreen::HandleFrame, Qt::AutoConnection);
        

        FrameChanged is emitted in a function that is supported from the DeckLink API. This function should draw the video to the screen.

        /**
        * The method is called on every incoming frame and is derived from the IDeckLinkScreenPreviewCallback
        */
        HRESULT VideoScreenHelper::DrawFrame(IDeckLinkVideoFrame* theFrame) {
        
        	emit FrameChanged(CComPtr<IDeckLinkVideoFrame> (theFrame));
        	return S_OK;
        }
        

        HandleFrame() manages the setup of the frame.

        void VideoScreen::HandleFrame(CComPtr<IDeckLinkVideoFrame> theFrame) {
        	if (m_previewHelper != nullptr) {
        		m_previewHelper->SetFrame(theFrame);
        	}
        }
        

        Can someone of you tell me what is going wrong here? It is still confusing...

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @makopo

        As @Christian-Ehrlicher said above, you need to register the complete type (in your case CComPtr<IDeckLinkVideoFrame>).


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        1

        • Login

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