I need to detect when an HDMI cable has been plugged or unplugged. Getting a notification would be best, but polling would also do. I am using Qt (and Qt Creator as IDE). I don't need this to be cross platform, I can use OS-specific system calls.
Just from the top of my head: you can write a udev
rule which sends a message via dbus
to your application.