Can linux signal my Qt program when a particular USB device is connected?

泄露秘密 提交于 2019-12-06 16:48:34

Haven't tried Qt's DBUS implementation, but the general details of how to get a USB notification are in this tutorial

The QtDBus function names probably map onto these fairly easily

You might want to take a look with qdbusviewer from qt4-dev-tools what kind of dbus interface your system has regarding device notification (be it HAL or udev). Than it is relatively simple to generate a c++ implementation with qdbusxml2cpp. You will just have to connect to whatever dbus signal your system is suppling for device notification purposes. Here is a quick start guide for qt and dbus QtDbus Tutorual.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!