ImageDocument QML Type

An ImageDocument is the base class of the ImageEditor. More...

Import Statement: import org.kde.kquickimageeditor

Properties

Methods

  • void cancel()
  • void crop(int x, int y, int width, int height)
  • void mirror(bool horizontal, bool vertical)
  • void resize(int width, int height)
  • void rotate(int angle)
  • bool save()
  • bool saveSas(url location)
  • void undo()

Detailed Description

This class handles various image manipulation and contains an undo stack to allow reverting the last actions. This class does not display the image, use ImageItem for this task.

KQuickImageEditor.ImageDocument {
   id: imageDocument
   path: myModel.image
}

Kirigami.Actions {
   iconName: "object-rotate-left"
   onTriggered: imageDocument.rotate(-90);
}

KQuickImageEditor.ImageItem {
    image: imageDocument.image
}

Property Documentation

edited : bool

Whether the document was changed or not.

Allows to change the edited value.


image : image

The image was is displayed.

This property is updated when the path changes or commands are applied.


path : url

The path to the image.


Method Documentation

void cancel()

Cancel all edits.


void crop(int x, int y, int width, int height)

Crop the image.

Requires specifying the initial x and y coordinates for the crop in the old image as well as the width and height of the crop selection.


void mirror(bool horizontal, bool vertical)

Mirror the image horizontally and/or vertically.


void resize(int width, int height)

Resize the image to the new width and height.


void rotate(int angle)

Rotate the image with the given angle.


bool save()

Save current edited image in place.

This is a destructive operation and can't be reverted.

Returns true if the file saving operation was successful.


bool saveSas(url location)

Save current edited image as a new image in location.

Returns true if the file saving operation was successful.


void undo()

Undo the last edit on the images.