我想用“QextSerialPort”打开我的Huwawei USB加密狗。QWinEventNotifier:只能用于用QThread启动的线程
我的端口详情如下
Port Name:
Product ID:
Physical Name: \Device\000000ca
Vendor Id:
Friend Name: SB
Port Name:
Product ID:?
Physical Name: \Device\USBPDO-10
Vendor Id: ?
Friend Name: TH
Port Name: COM3
Product ID:
Physical Name: \Device\BthModem0
Vendor Id:
Friend Name: Standard Serial over Bluetooth link (COM3)
Port Name: COM4
Product ID:
Physical Name: \Device\BthModem2
Vendor Id:
Friend Name: Standard Serial over Bluetooth link (COM4)
Port Name: COM5
Product ID:
Physical Name: \Device\BthModem1
Vendor Id:
Friend Name: Standard Modem over Bluetooth link
Port Name: COM6
Product ID:?
Physical Name: \Device\000000e2
Vendor Id: ?
Friend Name: HUAWEI Mobile Connect - 3G Application Interface (COM6)
Port Name: COM7
Product ID:?
Physical Name: \Device\000000e0
Vendor Id: ?
Friend Name: HUAWEI Mobile Connect - 3G Modem
Port Name: COM8
Product ID:?
Physical Name: \Device\000000e3
Vendor Id: ?
Friend Name: HUAWEI Mobile Connect - 3G PC UI Interface (COM8)
我试图打开我的USB加密狗,这样我就可以发送短信。以下是我开
#include "MyClass.h"
#include <qstring.h>
#include <qdebug.h>
int main()
{
QextSerialPort *port = new QextSerialPort("COM7");
port->open(QIODevice::ReadWrite);
cout << port->isOpen();
system("pause");
return 0;
}
代码,当我运行这段代码,我得到的是
QWinEventNotifier: Can only be used with threads started with QThread
1
这显示了端口ID打开,但对于该消息?这是否意味着我无法继续使用其他代码?在我编写任何其他代码之前,我想知道这一点。请帮忙!
而且,我会打电话到正确的端口?我对QT和USB编程非常陌生' – 2013-05-06 08:40:32
任何不使用QtSerialPort(官方Qt 5插件)的原因,顺便说一句? – lpapp 2013-11-13 16:07:58