Skip to content

Tag archive for: qt

Global hotkey

Let start by explaining the goal: we want to send a custom signal when the user press a combination of keys. Sound pretty easy, your are already thinking to override the keyPressEvent() and keyReleaseEvent() virtual methods of your QMainWindow with your custom code.

It’s a fair solution, but not the so elegant, and what’s happen if you have more than one QMainWindow instances or none at all?
Continue reading Global hotkey

Open URLs in external browser by Javascript in WebKit

It’s very simple with the QtWebKit APIs to open an link with your default browser from a QWebView (you can find some solutions like this in StackOverflow about that) but that works well only with <a> elements. If you are opening an external browser by a¬†window.open() JavaScript¬†function you need a whole different approach.

Continue reading Open URLs in external browser by Javascript in WebKit