Class View
Build from View.h
+Krita 4.0.0↻Krita master

View represents one view on a document. A document can be shown in more than one view at a time.

Methods

HDRExposure() ➞ float HDRGamma() ➞ float activateResource(resource: Resource) backGroundColor() ➞ ManagedColor backgroundColor() ➞ ManagedColor brushFade() ➞ float brushRotation() ➞ float brushSize() ➞ float canvas() ➞ Canvas currentBlendingMode() ➞ str currentBrushPreset() ➞ Resource currentGradient() ➞ Resource currentPattern() ➞ Resource disablePressure() ➞ bool document() ➞ Document eraserMode() ➞ bool flakeToCanvasTransform() ➞ QTransform flakeToDocumentTransform() ➞ QTransform flakeToImageTransform() ➞ QTransform foreGroundColor() ➞ ManagedColor foregroundColor() ➞ ManagedColor globalAlphaLock() ➞ bool paintingFlow() ➞ float paintingOpacity() ➞ float patternSize() ➞ float selectedNodes() ➞ list[Node] setBackGroundColor(color: ManagedColor) setBrushFade(brushFade: float) setBrushRotation(brushRotation: float) setBrushSize(brushSize: float) setCurrentBlendingMode(blendingMode: str) setCurrentBrushPreset(resource: Resource) setCurrentGradient(resource: Resource) setCurrentPattern(resource: Resource) setDisablePressure(value: bool) setDocument(document: Document) setEraserMode(value: bool) setForeGroundColor(color: ManagedColor) setGlobalAlphaLock(value: bool) setHDRExposure(exposure: float) setHDRGamma(gamma: float) setPaintingFlow(flow: float) setPaintingOpacity(opacity: float) setPatternSize(size: float) setVisible() showFloatingMessage(message: str, icon: QIcon, timeout: int, priority: int) visible() ➞ bool window() ➞ Window

Signals

backgroundColorChanged() currentBrushPresetChanged() currentToolChanged(str) foregroundColorChanged()

Member documentation

HDRExposure() ➞ float
+Krita 4.0.0↻Krita 6.0.0

Return

the current HDR Exposure value

HDRGamma() ➞ float
+Krita 4.0.0↻Krita 6.0.0

Return

the current HDR Gamma value

+Krita 4.0.0

activates the given resource.

Parameters

resource(no description provided)
+Krita 4.0.0

Return

(no description provided)

+Krita 4.0.2↻Krita 6.0.0

allows access to the currently active background color. This is nominally per canvas/view, but in practice per mainwindow.

Return

The current background color

+Krita 6.0.3

Emitted when this view's background color changes.

brushFade() ➞ float
+Krita master

return the current fade for brush

Return

the brush fade value (0.00 - 1.00)

brushRotation() ➞ float
+Krita 5.2.2↻Krita 6.0.0

return the current rotation for brush tip

Return

the brush tip rotation value (in degrees)

brushSize() ➞ float
+Krita 4.0.0↻Krita 6.0.0

return the current size for brush

Return

the brush size value (in pixels)

canvas() ➞ Canvas
+Krita 4.0.0

Return

the canvas this view is showing. The canvas controls things like zoom and rotation.

+Krita 4.0.0↻Krita 6.0.0

return the current blending mode for brush

Return

the current blending mode identifier

+Krita 4.0.0↻Krita 6.0.0

return the current selected preset

Return

the current preset (Resource type = 'preset')

+Krita 6.0.3

Emitted when the current brush preset for this view changes.

+Krita 4.0.0↻Krita 6.0.0

return the current selected gradient

Return

the current gradient (Resource type = 'gradient')

+Krita 4.0.0↻Krita 6.0.0

return the current selected pattern

Return

the current pattern (Resource type = 'pattern')

+Krita 6.0.3

Emitted when the active tool for this view changes.

Parameters

toolId

the identifier of the new active tool.

disablePressure() ➞ bool
+Krita 6.0.0

return current disabled pressure status

Return

True if is pressure is disabled, otherwise False

+Krita 4.0.0

Return

the document this view is showing.

eraserMode() ➞ bool
+Krita 6.0.0

return current eraser mode status (active/inactive)

Return

True if eraser mode is active, otherwise False

flakeToCanvasTransform() ➞ QTransform
+Krita 5.2.0

The transformation of the canvas relative to the view without rotation and mirroring

Return

QTransform

flakeToDocumentTransform() ➞ QTransform
+Krita 5.2.0

The transformation of the document relative to the view without rotation and mirroring

Return

QTransform

flakeToImageTransform() ➞ QTransform
+Krita 5.2.0

The transformation of the image relative to the view without rotation and mirroring

Return

QTransform

+Krita 4.0.0

allows access to the currently active color. This is nominally per canvas/view, but in practice per mainwindow.

color = Application.activeWindow().activeView().foreGroundColor()components = color.components()components[0] = 1.0components[1] = 0.6components[2] = 0.7color.setComponents(components)Application.activeWindow().activeView().setForeGroundColor(color)

Return

(no description provided)

+Krita 4.0.2↻Krita 6.0.0

allows access to the currently active foreground color. This is nominally per canvas/view, but in practice per mainwindow.

color = Application.activeWindow().activeView().foregroundColor()components = color.components()components[0] = 1.0components[1] = 0.6components[2] = 0.7color.setComponents(components)Application.activeWindow().activeView().setForeGroundColor(color)

Return

The current foreground color

+Krita 6.0.3

Emitted when this view's foreground color changes.

globalAlphaLock() ➞ bool
+Krita 6.0.0

return current global alpha lock mode (active/inactive)

Return

True if is active, otherwise False

paintingFlow() ➞ float
+Krita 4.0.0↻Krita 6.0.0

return the current flow for brush

Return

the brush flow value

paintingOpacity() ➞ float
+Krita 4.0.0↻Krita 6.0.0

return the current opacity for brush

Return

the brush opacity value (0.00=fully transparent - 1.00=fully opaque)

patternSize() ➞ float
+Krita 6.0.0

return the current pattern size for brush

Return

the brush pattern size value

selectedNodes() ➞ list[Node]
+Krita 4.0.0

returns a list of Nodes that are selected in this view.

from krita import *w = Krita.instance().activeWindow()v = w.activeView()selected_nodes = v.selectedNodes()print(selected_nodes)

Return

a list of Node objects which may be empty.

+Krita 4.0.0

Parameters

color(no description provided)
setBrushFade(brushFade: float)
+Krita master

set the current fade for brush

Parameters

brushFade

the brush fade (0.00 - 1.00)

setBrushRotation(brushRotation: float)
+Krita 5.2.2↻Krita 6.0.0

set the current rotation for brush tip

Parameters

brushRotation

the brush tip rotation (in degrees)

setBrushSize(brushSize: float)
+Krita 4.0.0↻Krita 6.0.0

set the current size for brush

Parameters

brushSize

the brush size (in pixels)

setCurrentBlendingMode(blendingMode: str)
+Krita 4.0.0↻Krita 6.0.0

set the current blending mode for brush

Parameters

blendingMode

the current belding mode identifier

+Krita 4.0.0↻Krita 6.0.0

set the current selected preset

Parameters

resource

the current preset to set (Resource type = 'preset')

+Krita 4.0.0↻Krita 6.0.0

set the current selected gradient

Parameters

resource

the current gradient to set (Resource type = 'gradient')

+Krita 4.0.0↻Krita 6.0.0

set the current selected pattern

Parameters

resource

the current pattern to set (Resource type = 'pattern')

setDisablePressure(value: bool)
+Krita 6.0.0

set current disabled pressure status

Parameters

value

Set to True to disable pressure, False to enabled pressure

setDocument(document: Document)
+Krita 4.3.0

Reset the view to show document.

Parameters

document(no description provided)
setEraserMode(value: bool)
+Krita 6.0.0

set current eraser active/inactive

Parameters

value

Set to True to activate eraser mode, False to deactivate

+Krita 4.0.0

Parameters

color(no description provided)
setGlobalAlphaLock(value: bool)
+Krita 6.0.0

set current global alpha lock mode active/inactive

Parameters

value

Set to True to lock global alpha mode, False to unlock

setHDRExposure(exposure: float)
+Krita 4.0.0↻Krita 6.0.0

set the current HDR Exposure value

Parameters

exposure

the HDR Exposure to set

setHDRGamma(gamma: float)
+Krita 4.0.0↻Krita 6.0.0

set the current HDR Gamma value

Parameters

gamma(no description provided)
setPaintingFlow(flow: float)
+Krita 4.0.0↻Krita 6.0.0

set the current flow value for brush

Parameters

flow

the brush flow

setPaintingOpacity(opacity: float)
+Krita 4.0.0↻Krita 6.0.0

set the current opacity for brush

Parameters

opacity

the opacity value (0.00=fully transparent - 1.00=fully opaque)

setPatternSize(size: float)
+Krita 6.0.0

set the current pattern size value for brush

Parameters

size(no description provided)
+Krita 4.0.0

Make the current view visible.

showFloatingMessage(message: str, icon: QIcon, timeout: int, priority: int)
+Krita 4.4.0↻Krita 5.0.0

displays a floating message box on the top-left corner of the canvas

Parameters

message(no description provided)
icon(no description provided)
timeout(no description provided)
priority(no description provided)
visible() ➞ bool
+Krita 4.0.0↻Krita 6.0.0

Return

True if the current view is visible, False if not.

window() ➞ Window
+Krita 4.0.0

Return

the window this view is shown in.