Pages
API Documentation
On this page

KPixmapRegionSelectorWidget Class

KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap. More...

  • Header: #include <KPixmapRegionSelectorWidget>
  • CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
    target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
  • Inherits: QWidget

List of all members, including inherited members

Public Types

Properties

Public Functions

Public Slots

Signals

Protected Functions

Detailed Description

Member Type Documentation

enum KPixmapRegionSelectorWidget::RotateDirection

This enum provides a rotation direction.

Constant Value Description
KPixmapRegionSelectorWidget::Rotate90 0 Rotate 90 degrees to the right.
KPixmapRegionSelectorWidget::Rotate180 1 Rotate 180 degrees.
KPixmapRegionSelectorWidget::Rotate270 2 Rotate 90 degrees to the left.

See also KPixmapRegionSelectorWidget::rotate()

Property Documentation

pixmap : QPixmap

Access functions:

Member Function Documentation

[explicit] KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget(QWidget *parent = nullptr)

Constructor for a KPixmapRegionSelectorWidget.

[virtual protected] QMenu *KPixmapRegionSelectorWidget::createPopupMenu()

Creates a QMenu with the menu that appears when clicking with the right button on the label

QPixmap KPixmapRegionSelectorWidget::pixmap() const

Returns the original whole pixmap that we're using in this widget as the pixmap the user is selecting a region from.

Note: Getter function for property pixmap.

See also setPixmap()

[signal] void KPixmapRegionSelectorWidget::pixmapRotated()

void KPixmapRegionSelectorWidget::resetSelection()

Resets the selection to use the whole image

void KPixmapRegionSelectorWidget::rotate(KPixmapRegionSelectorWidget::RotateDirection direction)

Rotates the image as specified by the direction parameter, also tries to rotate the selected region so that it doesn't change, as long as the forced aspect ratio setting is respected, in other case, the selected region is reset.

[slot] void KPixmapRegionSelectorWidget::rotateClockwise()

Rotates the current image 90º clockwise

[slot] void KPixmapRegionSelectorWidget::rotateCounterclockwise()

Rotates the current image 90º counterclockwise

QImage KPixmapRegionSelectorWidget::selectedImage() const

Returns a QImage object with just the region the user selected from the image

QRect KPixmapRegionSelectorWidget::selectedRegion() const

Returns the selected region ( in zoomed pixmap coordinates )

See also setSelectedRegion()

void KPixmapRegionSelectorWidget::setFreeSelectionAspectRatio()

Allows the user to do a selection which has any aspect ratio. This is the default.

See also setSelectionAspectRatio()

void KPixmapRegionSelectorWidget::setMaximumWidgetSize(int width, int height)

Sets the maximum size for the widget. If the image is larger than this (either horizontally or vertically), it's scaled to adjust to the maximum size (preserving the aspect ratio)

void KPixmapRegionSelectorWidget::setPixmap(const QPixmap &pixmap)

Sets the pixmap which will be shown for the user to select a region from.

pixmap The pixmap. Must be non-null.

Note: Setter function for property pixmap.

See also pixmap()

void KPixmapRegionSelectorWidget::setSelectedRegion(const QRect &rect)

Sets the selected region to be rect (in zoomed pixmap coordinates)

See also selectedRegion()

void KPixmapRegionSelectorWidget::setSelectionAspectRatio(int width, int height)

Sets the aspect ration that the selected subimage should have. The way to select it, is specifying an example valid width and height.

See also setFreeSelectionAspectRatio()

QRect KPixmapRegionSelectorWidget::unzoomedSelectedRegion() const

Returns the selected region ( in unzoomed, original pixmap coordinates )

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.