How to Setup External Documentation for Qt.py in PyCharm
PyCharm has a nice feature where you can to click on (put your caret over) any Qt class or function, press Shift+F1 and open up the web documentation for that class or function.
I’m going to be focusing on Qt.py, but you could do the same for PySide2 and PyQt5 though newer version of PyCharm already have them configured. I’m using the Qt C++ documentation because:
- It lends itself to PyCharm’s external docs parameterization.
- It is more complete than QtForPython’s documentation at the moment.
- I find it easier to navigate and find inherited members.
The Setup#
- First, you’ll want to start out by making sure you’re using PyCharm 2018.3 or newer. These macros aren’t working in older versions.
- Open the settings: click File->Settings.
- Click on Tools->Python External Documentation.
- Add a new entry by clicking the “+” button.
- Set the module name to:
Qt
- Set URL/Path Pattern to:
https://doc.qt.io/qt-5/{class.name.lower}.html#{element.name.lower}
- Click OK
Try It Out#
Click on a Qt.py class or function and then press Shift+F1 or click on View->External Documentation. It will open up a new tab in your browser with the documentation.