You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
word at the mouse position (if enabled in settings, see below) OR
word at the text cursor position
Behavior is slighltly different for the Python Console (and editors) and for the others generic QgsCodeEditorPython (e.g Expression Editor).
Generic editors
This PR only improves the already existing "Search in PyQGIS Documentation" action in the context menu to add the F1 shortcut and the word under mouse logic. Besides, if the text hovered matches a Qt class name, the Qt API is opened at the correct page. PyQGIS documentation urls cannot be deduced from the class name only as they also include the module name, so pressing F1 will only search the PyQGIS documentation.
Python console (where the PR truly shines)
Add a widget in the devtools panel to display the API documentation (PyQGIS and Qt)
The buttons at the top of the widget access the home pages of the APIs.
The button at the top right opens the current URL in the system web browser
When pressing F1 while hovering a symbol on the Python Console or Editors tab, the object is evaluated to get its class and module. The relevant API (PyQGIS or Qt) is then opened at the correct page. It works for class names, class, or even objects
Consider the following snippet:
myLayer=iface.activeLayer()
ifisinstance(myLayer, QgsRasterLayer):
print("It is a QgsRasterLayer")
a=QLabel()
Let's say the active layer is a vector layer. With the text cursor at the following words, pressing F1 will
myLayer: open the PyQGIS api page for QgsVectorLayer.
iface: open the PyQGIS api page for QgisInterface.
QLabel: open the Qt api page for QLabel
QgsRasterLayer (in the print statement or in the type check): open the Qt api page for QgsRasterLayer
If the symbol is not recognized, open the PyQGIS API home page.
Settings
Open In: how should the API html page be displayed?
Embedded Webview
Default system Web browser
F1 on Hover: whether pressing F1 should trigger the context help for the hovered word or for the word at the textCursor
Demo
Commits tagged with [need-docs] or [FEATURE]
The text was updated successfully, but these errors were encountered:
Request for documentation
From pull request qgis/QGIS#58962
Author: @YoannQDQ
QGIS version: 3.42
Python console interactive help
PR Description:
Description
Add a shortcut in python editors to open the API
When pressing F1, open the API page matching
Behavior is slighltly different for the Python Console (and editors) and for the others generic QgsCodeEditorPython (e.g Expression Editor).
Generic editors
This PR only improves the already existing "Search in PyQGIS Documentation" action in the context menu to add the F1 shortcut and the word under mouse logic. Besides, if the text hovered matches a Qt class name, the Qt API is opened at the correct page. PyQGIS documentation urls cannot be deduced from the class name only as they also include the module name, so pressing F1 will only search the PyQGIS documentation.
Python console (where the PR truly shines)
Add a widget in the devtools panel to display the API documentation (PyQGIS and Qt)
The buttons at the top of the widget access the home pages of the APIs.
The button at the top right opens the current URL in the system web browser
When pressing F1 while hovering a symbol on the Python Console or Editors tab, the object is evaluated to get its class and module. The relevant API (PyQGIS or Qt) is then opened at the correct page. It works for class names, class, or even objects
Consider the following snippet:
Let's say the active layer is a vector layer. With the text cursor at the following words, pressing F1 will
myLayer
: open the PyQGIS api page for QgsVectorLayer.iface
: open the PyQGIS api page for QgisInterface.If the symbol is not recognized, open the PyQGIS API home page.
Settings
Demo
Commits tagged with [need-docs] or [FEATURE]
The text was updated successfully, but these errors were encountered: