• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KPixmapRegionSelectorWidget Class Reference

#include <kpixmapregionselectorwidget.h>

Inheritance diagram for KPixmapRegionSelectorWidget:
Inheritance graph
[legend]

Public Types

enum  RotateDirection { Rotate90, Rotate180, Rotate270 }
 

Public Slots

void rotateClockwise ()
 
void rotateCounterclockwise ()
 

Signals

void pixmapRotated ()
 

Public Member Functions

 KPixmapRegionSelectorWidget (QWidget *parent=0)
 
 ~KPixmapRegionSelectorWidget ()
 
QPixmap pixmap () const
 
void resetSelection ()
 
void rotate (RotateDirection direction)
 
QImage selectedImage () const
 
QRect selectedRegion () const
 
void setFreeSelectionAspectRatio ()
 
void setMaximumWidgetSize (int width, int height)
 
void setPixmap (const QPixmap &pixmap)
 
void setSelectedRegion (const QRect &rect)
 
void setSelectionAspectRatio (int width, int height)
 
QRect unzoomedSelectedRegion () const
 

Protected Member Functions

virtual KMenu * createPopupMenu ()
 

Properties

QPixmap pixmap
 

Detailed Description

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

NOTE: There are two copies of this .h and the .cpp file, with subtle differences. One copy is in kdelibs/kdeui, and the other copy is in kdepim/libkdepim This is because kdepim has to remain backwards compatible. Any changes to either file should be made to the other.

kpixmapregionselectorwidget.png
KDE Pixmap Region Selector
Author
Antonio Larrosa larro.nosp@m.sa@k.nosp@m.de.or.nosp@m.g

Definition at line 44 of file kpixmapregionselectorwidget.h.

Member Enumeration Documentation

enum KPixmapRegionSelectorWidget::RotateDirection

This enum provides a rotation direction.

See also
KPixmapRegionSelectorWidget::rotate()
Enumerator
Rotate90 

Rotate 90 degrees to the right.

Rotate180 

Rotate 180 degrees.

Rotate270 

Rotate 90 degrees to the left.

Definition at line 54 of file kpixmapregionselectorwidget.h.

Constructor & Destructor Documentation

KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget ( QWidget *  parent = 0)
explicit

Constructor for a KPixmapRegionSelectorWidget.

Definition at line 77 of file kpixmapregionselectorwidget.cpp.

KPixmapRegionSelectorWidget::~KPixmapRegionSelectorWidget ( )

Destructor for a KPixmapRegionSelectorWidget.

Definition at line 103 of file kpixmapregionselectorwidget.cpp.

Member Function Documentation

KMenu * KPixmapRegionSelectorWidget::createPopupMenu ( )
protectedvirtual

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

Definition at line 188 of file kpixmapregionselectorwidget.cpp.

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.
void KPixmapRegionSelectorWidget::pixmapRotated ( )
signal
void KPixmapRegionSelectorWidget::resetSelection ( )

Resets the selection to use the whole image.

Definition at line 122 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::rotate ( 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.

Definition at line 216 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::rotateClockwise ( )
slot

Rotates the current image 90º clockwise.

Definition at line 274 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::rotateCounterclockwise ( )
slot

Rotates the current image 90º counterclockwise.

Definition at line 279 of file kpixmapregionselectorwidget.cpp.

QImage KPixmapRegionSelectorWidget::selectedImage ( ) const
Returns
a QImage object with just the region the user selected from the image

Definition at line 472 of file kpixmapregionselectorwidget.cpp.

QRect KPixmapRegionSelectorWidget::selectedRegion ( ) const

Returns the selected region ( in zoomed pixmap coordinates )

Definition at line 129 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::setFreeSelectionAspectRatio ( )

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

This is the default.

See also
setSelectionAspectRatio()

Definition at line 483 of file kpixmapregionselectorwidget.cpp.

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)

Definition at line 488 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::setPixmap ( const QPixmap &  pixmap)

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

Parameters
pixmapThe pixmap. Must be non-null.

Definition at line 113 of file kpixmapregionselectorwidget.cpp.

void KPixmapRegionSelectorWidget::setSelectedRegion ( const QRect &  rect)

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

Definition at line 134 of file kpixmapregionselectorwidget.cpp.

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()

Definition at line 478 of file kpixmapregionselectorwidget.cpp.

QRect KPixmapRegionSelectorWidget::unzoomedSelectedRegion ( ) const

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

Definition at line 464 of file kpixmapregionselectorwidget.cpp.

Property Documentation

QPixmap KPixmapRegionSelectorWidget::pixmap
readwrite

Definition at line 47 of file kpixmapregionselectorwidget.h.


The documentation for this class was generated from the following files:
  • kpixmapregionselectorwidget.h
  • kpixmapregionselectorwidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal