I am trying to emit standard string with qt signal. The signal will be delivered as queued. I registered the type with qRegisterMetaType , like it says in the qt documentation, but no luck. I am registering it like this
qRegisterMetaType<std::string>("std::string")
You should also do:
Q_DECLARE_METATYPE (std::string)
Quoting Qt Doc
Adding a Q_DECLARE_METATYPE() makes the type known to all template based functions, including QVariant. Note that if you intend to use the type in queued signal and slot connections or in QObject's property system, you also have to call qRegisterMetaType() since the names are resolved at runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With