Using Dash with Qt Creator

If you are developing on a Mac, then you may have heard of a great documentation tool called Dash. It's particularly helpful if you are developing with multiple languages at the same time and don't want to go a search engine for every little thing outside of Qt. It contains docsets for a pile of languages and frameworks and lets you easily search across all or some of them instantly (and offline).

Qt Creator has a builtin help system which is great, but it only contains documentation for Qt. Quite often when writing Qt apps I find myself looking at documentation for other languages or frameworks as well such as Javascript, Android, iOS and of course C++. With Dash you can create a Search Profile containing exactly these docsets and you can activate this Profile whenever Qt Creator becomes the foreground app.

profile.png

To make searching from Qt Creator as simple as possible, we can register Dash as an external tool by going to Preferences > Environment > External Tools. Dash registers a custom URL scheme with Mac OS X so we can open docs from the command line simply by using "open dash://QWidget". To emulate this behavior from Creator, we can add a new external tool like so:

external.png

The final step for documentation bliss is to register a key binding that automatically calls Dash with the currently selected text. From the same Environment page in Preferences, you can navigate to the Keyboard tab and enter the name of your external tool in the filter text. Next, simply record the key binding you like. As a big fan of the IDEA tools (Android Studio, WebStorm, etc.) I chose to use the same key binding that Dash uses in those tools which is cmd + shift + d, but to each his/her own.

keyboard.png

That's it! Now you can select text in Qt Creator and use your key binding to jump directly to the docs for that selection.