Class DockWidget
Build from DockWidget.h
+Krita 4.0.0

DockWidget is the base class for custom Dockers. Dockers are created by a factory class which needs to be registered by calling Application.addDockWidgetFactory:

class HelloDocker(DockWidget): def __init__(self): super().__init__() label = QLabel("Hello", self) self.setWidget(label) self.label = label self.setWindowTitle("Hello Docker")def canvasChanged(self, canvas): self.label.setText("Hellodocker: canvas changed");Application.addDockWidgetFactory(DockWidgetFactory("hello", DockWidgetFactoryBase.DockRight, HelloDocker))

One docker per window will be created, not one docker per canvas or view. When the user switches between views/canvases, canvasChanged will be called. You can override that method to reset your docker's internal state, if necessary.

Methods

canvas() ➞ Canvas

Re-implemented methods

canvasChanged(canvas: Canvas)

Member documentation

canvas() ➞ Canvas
+Krita 4.0.0

Return

the canvas object that this docker is currently associated with

+Krita 4.0.0

is called whenever the current canvas is changed in the mainwindow this dockwidget instance is shown in.

Parameters

canvas

The new canvas.