AnnotationDocument QML Type

This class is used to render an image with annotations. More...

Import Statement: import org.kde.kquickimageeditor

Properties

Methods

Detailed Description

The annotations are vector graphics and image effects created from a stack of history items that can be undone or redone.

paint() and renderToImage() will be used by clients (e.g., AnnotationViewport) to render their own content.

There can be any amount of clients sharing the same AnnotationDocument.

Property Documentation

ContinueOption : enumeration

ConstantValue
NoOptions
Snap
CenterResize

RepaintType : enumeration

ConstantValue
NoTypes
BaseImage
Annotations
All

canvasRect : rect


imageDpr : real


imageSize : size


inputTransform : matrix4x4


modified : bool

This property holds whether the document has been modified by the user.

By default, this property is false.


redoStackDepth : int


renderTransform : matrix4x4


selectedItem : SelectedItemWrapper



transform : matrix4x4


undoStackDepth : int


Method Documentation

void applyTransform(matrix4x4 matrix)

Apply a transform and combine it with the existing transform. This is not part of the `transform` property. It adds an item to history and we don't want this to be rapidly called through bindings.


void clear()

Clear all annotations and the image. Cannot be undone.


void clearAnnotations()

Clear all annotations. Cannot be undone.


void cropCanvas(rect cropRect)

Hide annotations that do not intersect with the rectangle and crop the image.


void deleteSelectedItem()


void deselectItem()


bool saveImage(string path)

Render to an image and save it to the given path.


void selectItem(rect rect)


void setBaseImage(string path)

Set the base image from the given file path.


void setBaseImage(url localFile)

Set the base image from the given local file URL.

We only support local files because QImage can only load directly from local files. This overload exists so that we don't have to convert URLs into path strings.


void undo()