QObject::connect: Cannot queue arguments of type 'std::string' (Make sure 'std::string' is registered using qRegisterMetaType().)
-
I encounter this error when doing Signal-Slot method.
QObject::connect: Cannot queue arguments of type 'std::string'
(Make sure 'std::string' is registered using qRegisterMetaType().)How could I resolve this?
-
@reddy9pp
like the error says, register it to the methadones system viaqRegisterMetaType
or easier, use QString@J-Hilk
mainWindow.h
public: void A(std:string data); signals: void dataReceived(std:string data); private slots: void B(std:string data); private: Ui::MainWindow *ui;
How could I do this without the use of QString?
I also have to implement for cv::Mat type data -
@J-Hilk
mainWindow.h
public: void A(std:string data); signals: void dataReceived(std:string data); private slots: void B(std:string data); private: Ui::MainWindow *ui;
How could I do this without the use of QString?
I also have to implement for cv::Mat type data -
@J-Hilk
mainWindow.h
public: void A(std:string data); signals: void dataReceived(std:string data); private slots: void B(std:string data); private: Ui::MainWindow *ui;
How could I do this without the use of QString?
I also have to implement for cv::Mat type data@reddy9pp said in QObject::connect: Cannot queue arguments of type 'std::string' (Make sure 'std::string' is registered using qRegisterMetaType().):
I also have to implement for cv::Mat type data
Be very careful as
cv::Mat
is not implicitly shared, it is just shared (i.e. a copy of acv::Mat
object will point to the same data as the copied from item) so it might cause problems if you try to queue arguments of that tipe