Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register QUsbDevice::DeviceStatus #57

Closed
digitalaspirin opened this issue Aug 12, 2020 · 1 comment
Closed

Register QUsbDevice::DeviceStatus #57

digitalaspirin opened this issue Aug 12, 2020 · 1 comment
Assignees

Comments

@digitalaspirin
Copy link
Contributor

Hello,
I think it will be rather better if QUsbDevice class registers QUsbDevice::DeviceStatus enum, using qRegisterMetaType() instead of having to do it at the application level when trying to connect statusChanged signal to handle a USB error.

qRegisterMetaType<QUsbDevice::DeviceStatus>("QUsbDevice::DeviceStatus"); // Needed so that the following connection does not fail at run time.
connect(m_usb_dev,&QUsbDevice::statusChanged,this,[](QUsbDevice::DeviceStatus status) {
    qDebug () << "USB ERROR: " << qint32(status) << " deal with it";
});
@fpoussin fpoussin self-assigned this Aug 31, 2020
@fpoussin
Copy link
Owner

Good catch, this has been fixed.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants