I am trying to make an application in QML (Qt 5.5) that is always running and shows up when the user presses alt+space
.
I have tried using the Action
class in QML, but it only works when the window has the focus, not when the window is not visible.
I've also tried QShortcut (which is not ideal, since my application is not based on QWidget) but I had no results.
Also using eventFilter
on QApplication
doesn't seem to work when the window is not visible.
Is there a way of doing it?
I have resorted to use XGrab and create a subclass of QThread (because of the separate event loop) to integrate it with the Qt signals.
shortcutactivator.h
shortcutactivator.cpp