How to send a Qt signal containing a cv::Mat?

后端 未结 1 1876
梦如初夏
梦如初夏 2021-02-14 11:39

In short, I get following error:

QObject::connect: Cannot queue arguments of type \'cv::Mat\'
(Make sure \'cv::Mat\' is registered using qRegisterMetaType().)
<         


        
1条回答
  •  再見小時候
    2021-02-14 12:11

    You need to call qRegisterMetaType in addition to the macro (or instead of it, depending on your needs). This is necessary for the signals to be able to marshal your data across threads. However, it might be a wiser idea to pass by reference or smart pointer, or raw pointer if you are using the QObject hierarchy to manage the object lifetime.

    0 讨论(0)
提交回复
热议问题