NDEVR
API Documentation
QTImageEditor

A full-featured image editor widget with drawing tools, undo/redo, and image manipulation. More...

Inheritance diagram for QTImageEditor:
[legend]

Public Member Functions

 QTImageEditor (QWidget *parent=nullptr)
 Constructs a QTImageEditor widget.
virtual ~QTImageEditor ()
 Destroys this QTImageEditor widget.
void editedSignal ()
 Emitted when the image has been edited.
const StringView imageID () const
 Returns the resource identifier of the currently loaded image.
QTImageEditorViewimageView () const
 Returns the underlying image editor view widget.
bool isEditing () const
 Returns whether a drawing or text editing operation is currently in progress.
virtual void keyReleaseEvent (QKeyEvent *event) override
 Handles key release events for shortcuts such as undo and redo.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this widget.
void mousePressLocation (const Vector< 2, fltp08 > &end_point)
 Handles a mouse press at the given normalized location.
void mouseReleaseLocation (const Vector< 2, fltp08 > &end_point)
 Handles a mouse release at the given normalized location.
void pushUpdate ()
 Pushes the current image state as a saved update to the resource system.
void refreshToImage (const StringView &image)
 Reloads the image from the given resource identifier, discarding unsaved changes.
void setEditMode (QTImageEditorView::EditMode mode)
 Sets the active editing mode for the image editor view.
void setImage (const TranslatedString title, const StringView &image)
 Sets the image to edit from a resource identifier.
void setOptimalScale ()
 Calculates and applies the optimal scale to fit the image in the view.
void setVertical (bool vertical)
 Sets the layout orientation of the editor toolbar.
void showEvent (QShowEvent *event) override
 Handles the show event to initialize the editor view.
QSize sizeHint () const override
 Returns the recommended size for this widget.
void updateCursorLocation (const Vector< 2, fltp08 > &end_point)
 Updates the cursor position during a drag operation.

Protected Member Functions

void colorsEdited ()
 Slot called when pen or fill colors have been changed by the user.
void editedSlot ()
 Slot called when the image has been edited, to update undo state.
void sizeChangedSlot ()
 Slot called when the image size has changed.

Detailed Description

A full-featured image editor widget with drawing tools, undo/redo, and image manipulation.


Definition at line 243 of file QTImageEditor.h.

Constructor & Destructor Documentation

◆ QTImageEditor()

QTImageEditor::QTImageEditor ( QWidget * parent = nullptr)

Constructs a QTImageEditor widget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ imageID()

const StringView QTImageEditor::imageID ( ) const
inline

Returns the resource identifier of the currently loaded image.

Returns
The image resource identifier.

Definition at line 320 of file QTImageEditor.h.

◆ imageView()

QTImageEditorView * QTImageEditor::imageView ( ) const

Returns the underlying image editor view widget.

Returns
The image editor view.

◆ isEditing()

bool QTImageEditor::isEditing ( ) const

Returns whether a drawing or text editing operation is currently in progress.

Returns
True if editing is active.

◆ keyReleaseEvent()

virtual void QTImageEditor::keyReleaseEvent ( QKeyEvent * event)
overridevirtual

Handles key release events for shortcuts such as undo and redo.

Parameters
[in]eventThe key event.

◆ minimumSizeHint()

QSize QTImageEditor::minimumSizeHint ( ) const
override

Returns the minimum recommended size for this widget.

Returns
The minimum size hint.

◆ mousePressLocation()

void QTImageEditor::mousePressLocation ( const Vector< 2, fltp08 > & end_point)

Handles a mouse press at the given normalized location.

Parameters
[in]end_pointThe press location in normalized coordinates.

◆ mouseReleaseLocation()

void QTImageEditor::mouseReleaseLocation ( const Vector< 2, fltp08 > & end_point)

Handles a mouse release at the given normalized location.

Parameters
[in]end_pointThe release location in normalized coordinates.

◆ refreshToImage()

void QTImageEditor::refreshToImage ( const StringView & image)

Reloads the image from the given resource identifier, discarding unsaved changes.

Parameters
[in]imageThe resource identifier of the image to reload.

◆ setEditMode()

void QTImageEditor::setEditMode ( QTImageEditorView::EditMode mode)

Sets the active editing mode for the image editor view.

Parameters
[in]modeThe edit mode to activate.

◆ setImage()

void QTImageEditor::setImage ( const TranslatedString title,
const StringView & image )

Sets the image to edit from a resource identifier.

Parameters
[in]titleThe display title for the editor.
[in]imageThe resource identifier of the image to load.

◆ setVertical()

void QTImageEditor::setVertical ( bool vertical)

Sets the layout orientation of the editor toolbar.

Parameters
[in]verticalWhether to use a vertical toolbar layout.

◆ showEvent()

void QTImageEditor::showEvent ( QShowEvent * event)
override

Handles the show event to initialize the editor view.

Parameters
[in]eventThe show event.

◆ sizeHint()

QSize QTImageEditor::sizeHint ( ) const
override

Returns the recommended size for this widget.

Returns
The size hint.

◆ updateCursorLocation()

void QTImageEditor::updateCursorLocation ( const Vector< 2, fltp08 > & end_point)

Updates the cursor position during a drag operation.

Parameters
[in]end_pointThe current cursor location in normalized coordinates.

The documentation for this class was generated from the following file: