Hi,
I have to detect some hardware signals like the USB connected, Network availability etc. How can i achieve the above using Qt class refrence...???
Hi,
I have to detect some hardware signals like the USB connected, Network availability etc. How can i achieve the above using Qt class refrence...???
qt wont help you here. you have to use system specific api.
Thanks for the reply, but can you suggest how the same can be achieved ?? As to how can i approach this problem. What i want is to emit a signal and trap it in my UI application event loop can this be achieved in any ways...???
Design a QOBJECT class that detects hardware signals like the USB connected, Network availability etc and emits a signal upon those events. You can then connect those signals to relevent slots in your ui class.
Anything further than that is really outside the scope of this forum.
Qt Code:
{ Q_OBJECT public: Q_SIGNALS: USBDetect(); NetworkDetect(); };To copy to clipboard, switch view to plain text mode
then in a relevent function in your .cpp :
Last edited by squidge; 23rd November 2009 at 17:59.
The same implementation i have in mind but my problem is to pass the signal from Kernal space to the user space where i can emit Qt signals and take it to the UI. So my concern is to how can i detect the hardware signals using Qt??
If you're using Linux, you can use HAL through DBUS to interconnect with the hardware.
Yes i am using Linux system, but i dont have any idea of using dbus does qt provide an interface with dbus or how can i achieve the same...????
Thanks in advance.
regards,
sudhish kapoor
Yes, see the QtDbus module in the docs.
Bookmarks