Add a web UI
Use a web UI when a QGIS plugin needs a page hosted in QWebEngineView. The
Python plugin still owns its actions; the page calls them over the bridge.
Install the developer kit and a JavaScript
package manager first.
Scaffold a web project
Section titled “Scaffold a web project”qgis-sdk new field_tools --web vanilla --placement dock --package-manager bun --no-inputcd field_toolsThe scaffold writes a Python plugin and a web/ page with a generated bridge
schema. Install its JavaScript dependencies before running the page’s scripts.
The project scaffold reference describes
other framework, placement and package-manager options.
Test the two sides
Section titled “Test the two sides”qgis-sdk checkqgis-sdk testcd webbun installbun run testcd ..Python tests exercise the plugin on fakes. Page tests use a scripted bridge, not a live QGIS host; see testing against a scripted host.
Connect the page
Section titled “Connect the page”The generated page creates a QgisSdk from bridge.schema.ts and invokes
methods declared by the plugin. After changing declarations, regenerate the
schema with qgis-sdk bridge generate; see
the schema module and QgisSdk
and the host-side bridge.
Run on QGIS Desktop
Section titled “Run on QGIS Desktop”qgis-sdk devA supported QGIS Desktop and display are required. The developer command runs the plugin and its web dev server; edits reload during development. See developing against QGIS and supported targets.