Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Messaging service on mac on external drive detection .
vivekmalik2466 last edited by
messaging service on mac on external drive detection .
can any one let me know how to i find a signal on drive plugin and plugout
rcari last edited by
You should look at the Apple documentation on "I/O Kit":https://developer.apple.com/library/mac/#documentation/IOKit/Reference/IOKitLib_header_reference/Reference/reference.html
Look especially at @IONotificationPortCreate()@ and @IONotificationPortGetRunLoopSource()@
Then take a look at the CFRunloop API "here":https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFRunLoopRef/Reference/reference.html
Qt uses a NSRunloop/CFRunloop in the backend so you can safely call @CFRunLoopGetCurrent()@
and register your notification port source to that.
You can then get the plug/unplug events by overloading @QApplication::macEventFilter()@