Mati Codes
# _  _ ____ ___ _    ____ ____ ___  ____ ____ #
# |\/| |__|  |  |    |    |  | |  \ |___ [__  #
# |  | |  |  |  |    |___ |__| |__/ |___ ___] #
#                                             #
# _  _ ____ ___ _    ____ ____ ___  ____ ____ #
# |\/| |__|  |  |    |    |  | |  \ |___ [__  #
# |  | |  |  |  |    |___ |__| |__/ |___ ___] #
#                                             #

June 23, 2020

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:

  1. It lends itself to PyCharm's external docs parameterization.
  2. It is more complete than QtForPython's documentation at the moment.
  3. I find it easier to navigate and find inherited members.

The Setup

  1. First, you'll want to start out by making sure you're using PyCharm 2018.3 or newer. This macros aren't working in older versions.
  2. Open the settings: click File->Settings.
  3. Click on Tools->Python External Documentation.
  4. Add a new entry by clicking the "+" button.
  5. Set the module name to:
    Qt
  6. Set "URL/Path Pattern" to:
    https://doc.qt.io/qt-5/{class.name.lower}.html#{element.name.lower}
PyCharm External Documentation Settings

  1. 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.

view_external_documentation.PNG

>>>

Tags

python, Qt.py, PySide2, PyQt5, pycharm, documentation

Comments

Leave a Reply

>>>
>>>
>>>
>>>
cancel