[Qt]请问 信号的类型为啥不能是std::vector<QString>的?

QObject::connect(pManager, SIGNAL(sglSendAllUseblePortName(std::vector)), this, SLOT(sltGetAllUseblePortName(std::vector)), Qt::QueuedConnection);


connect(pManager, SIGNAL(sglSendAllUseblePortName(std::vector)), this, SLOT(sltGetAllUseblePortName(std::vector)), Qt::QueuedConnection);

改成:

 connect(pManager, SIGNAL(sglSendAllUseblePortName(std::vector<QString> )), this, SLOT(sltGetAllUseblePortName(std::vector<QString> )), Qt::QueuedConnection);

可以的 需要注册一下qRegisterMetaType<std::vector<QString>>(“std::vector<QString>”);然后就可以了

https://blog.csdn.net/panpan_jiang1/article/details/84062034