Files
create/docs/examples/example-addon/example_addon/panel.py
forbes-0023 2f89f8cbb0
All checks were successful
Build and Test / build (pull_request) Successful in 30m3s
docs: add example addon template (#395)
- Create docs/examples/example-addon/ with a complete, copy-paste-ready
  addon skeleton demonstrating command registration, context injection,
  dock panels, lifecycle hooks, and event bus subscription
- Add Examples section to docs/src/SUMMARY.md
- Add quick-start cross-reference in writing-an-addon.md
2026-03-05 10:32:12 -06:00

22 lines
651 B
Python

"""Example addon dock panel.
The factory function is passed to ``kindred_sdk.register_dock_panel()``
and called once after the configured delay to create the widget.
"""
def create_panel():
"""Create the example dock panel widget.
Must return a QWidget. The widget is embedded in a QDockWidget and
managed by FreeCAD's DockWindowManager.
"""
from PySide6 import QtWidgets
widget = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout(widget)
layout.addWidget(QtWidgets.QLabel("Example Addon Panel"))
layout.addWidget(QtWidgets.QLabel("Replace this with your content."))
layout.addStretch()
return widget