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