First, your initial question did not contain enough information for anyone to help you without wildly guessing
Second, you complained about not getting a response within not even 5 hours of your first posting. That alone will make a lot of people just ignore you.
Regarding the solution you found on the internet:
QtDBus is a module in Qt that allows Qt programs to interact with the D-Bus message passing system. On Linux this is used for communication between processes of the same user session (so called session bus) and between system services and end user programs (so called system bus).
The example you have is a usage of the second type, e.g. the program interacting with the UDev system service.
The UDev system service seems to have a D-Bus API that emits a signal when a new device is attached. Using QtDBus you can map this signal to a Qt signal or, as in your example, connect it to a Qt slot.
Cheers,
_
Bookmarks