KDEUI
kpixmapregionselectorwidget.cpp
Go to the documentation of this file.
88 d->m_label->setAttribute(Qt::WA_NoSystemBackground,true);//setBackgroundMode( Qt::NoBackground );
148 if (m_selectedRegion.width()>m_originalPixmap.width()) m_selectedRegion.setWidth( m_originalPixmap.width() );
149 if (m_selectedRegion.height()>m_originalPixmap.height()) m_selectedRegion.setHeight( m_originalPixmap.height() );
344 d->m_selectedRegion.translate(d->m_originalPixmap.width()-d->m_selectedRegion.width()-d->m_selectedRegion.x(),0);
354 d->m_selectedRegion.translate(0,d->m_originalPixmap.height()-d->m_selectedRegion.height()-d->m_selectedRegion.y());
396 QRect KPixmapRegionSelectorWidget::Private::calcSelectionRectangle( const QPoint & startPoint, const QPoint & _endPoint )
497 // kDebug() << QString(" unzoomed Pixmap : %1 x %2 ").arg(d->m_unzoomedPixmap.width()).arg(d->m_unzoomedPixmap.height());
505 d->m_originalPixmap=QPixmap::fromImage( image.scaled( width, height, Qt::KeepAspectRatio,Qt::SmoothTransformation ) );
void setText(const QString &text)
QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode) const
QString i18n(const char *text)
QRect selectedRegion() const
Returns the selected region ( in zoomed pixmap coordinates )
Definition: kpixmapregionselectorwidget.cpp:129
Type type() const
bool end()
QCursor cursor() const
Rotate 180 degrees.
Definition: kpixmapregionselectorwidget.h:55
void pixmapRotated()
~KPixmapRegionSelectorWidget()
Destructor for a KPixmapRegionSelectorWidget.
Definition: kpixmapregionselectorwidget.cpp:103
int x() const
int y() const
void setIcon(const QIcon &icon)
void setFreeSelectionAspectRatio()
Allows the user to do a selection which has any aspect ratio.
Definition: kpixmapregionselectorwidget.cpp:483
int y() const
QPixmap fromImage(const QImage &image, QFlags< Qt::ImageConversionFlag > flags)
QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition: kactioncollection.cpp:217
QImage copy(const QRect &rectangle) const
int x() const
int y() const
KPixmapRegionSelectorWidget(QWidget *parent=0)
Constructor for a KPixmapRegionSelectorWidget.
Definition: kpixmapregionselectorwidget.cpp:77
void rotateClockwise()
Rotates the current image 90º clockwise.
Definition: kpixmapregionselectorwidget.cpp:274
int width() const
void resize(int w, int h)
QRect unzoomedSelectedRegion() const
Returns the selected region ( in unzoomed, original pixmap coordinates )
Definition: kpixmapregionselectorwidget.cpp:464
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
const QPoint & globalPos() const
int x() const
void setPixmap(const QPixmap &pixmap)
Sets the pixmap which will be shown for the user to select a region from.
Definition: kpixmapregionselectorwidget.cpp:113
Qt::MouseButton button() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
virtual void addItem(QLayoutItem *item)
void setObjectName(const QString &name)
void setOverrideCursor(const QCursor &cursor)
void restoreOverrideCursor()
KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly wa...
Definition: kpixmapregionselectorwidget.h:44
virtual bool eventFilter(QObject *watched, QEvent *event)
void setSelectedRegion(const QRect &rect)
Sets the selected region to be rect (in zoomed pixmap coordinates)
Definition: kpixmapregionselectorwidget.cpp:134
QRect rect() const
void setShape(Qt::CursorShape shape)
bool isNull() const
void resetSelection()
Resets the selection to use the whole image.
Definition: kpixmapregionselectorwidget.cpp:122
bool isValid() const
void addStretch(int stretch)
friend class Private
Definition: kpixmapregionselectorwidget.h:159
RotateDirection
This enum provides a rotation direction.
Definition: kpixmapregionselectorwidget.h:54
Rotate 90 degrees to the right.
Definition: kpixmapregionselectorwidget.h:54
void rotate(RotateDirection direction)
Rotates the image as specified by the direction parameter, also tries to rotate the selected region s...
Definition: kpixmapregionselectorwidget.cpp:216
void setX(int x)
void setY(int y)
void setMaximumWidgetSize(int width, int height)
Sets the maximum size for the widget.
Definition: kpixmapregionselectorwidget.cpp:488
const QPoint & pos() const
void rotateCounterclockwise()
Rotates the current image 90º counterclockwise.
Definition: kpixmapregionselectorwidget.cpp:279
QImage selectedImage() const
Definition: kpixmapregionselectorwidget.cpp:472
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
bool begin(QPaintDevice *device)
virtual KMenu * createPopupMenu()
Creates a KMenu with the menu that appears when clicking with the right button on the label...
Definition: kpixmapregionselectorwidget.cpp:188
void setSelectionAspectRatio(int width, int height)
Sets the aspect ration that the selected subimage should have.
Definition: kpixmapregionselectorwidget.cpp:478
int height() const
QPixmap pixmap() const
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const
Rotate 90 degrees to the left.
Definition: kpixmapregionselectorwidget.h:56
QAction * addTitle(const QString &text, QAction *before=0L)
Inserts a title item with no icon.
Definition: kmenu.cpp:170
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.