KWidgetsAddons
kpixmapregionselectorwidget.cpp
74 d->m_label->setAttribute(Qt::WA_NoSystemBackground, true); // setBackgroundMode( Qt::NoBackground );
277 if (d->m_selectedRegion.contains(mev->pos()) && d->m_selectedRegion != d->m_originalPixmap.rect()) {
307 d->m_selectedRegion.translate(d->m_originalPixmap.width() - d->m_selectedRegion.width() - d->m_selectedRegion.x(), 0);
314 d->m_selectedRegion.translate(0, d->m_originalPixmap.height() - d->m_selectedRegion.height() - d->m_selectedRegion.y());
335 d->m_selectedRegion.translate(0, -(d->m_selectedRegion.bottom() - d->m_originalPixmap.height()));
347 if (d->m_state == KPixmapRegionSelectorWidgetPrivate::Resizing && mev->pos() == d->m_tempFirstClick) {
361QRect KPixmapRegionSelectorWidgetPrivate::calcSelectionRectangle(const QPoint &startPoint, const QPoint &_endPoint)
473 // qCDebug(KWidgetsAddonsLog) << QString(" unzoomed Pixmap : %1 x %2 ").arg(d->m_unzoomedPixmap.width()).arg(d->m_unzoomedPixmap.height());
475 if (!d->m_originalPixmap.isNull() && (d->m_originalPixmap.width() > d->m_maxWidth || d->m_originalPixmap.height() > d->m_maxHeight)) {
478 d->m_originalPixmap = QPixmap::fromImage(image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation));
void setSelectedRegion(const QRect &rect)
Sets the selected region to be rect (in zoomed pixmap coordinates)
Definition kpixmapregionselectorwidget.cpp:117
void resetSelection()
Resets the selection to use the whole image.
Definition kpixmapregionselectorwidget.cpp:105
virtual QMenu * createPopupMenu()
Creates a QMenu with the menu that appears when clicking with the right button on the label.
Definition kpixmapregionselectorwidget.cpp:173
void rotateClockwise()
Rotates the current image 90º clockwise.
Definition kpixmapregionselectorwidget.cpp:252
QRect unzoomedSelectedRegion() const
Returns the selected region ( in unzoomed, original pixmap coordinates )
Definition kpixmapregionselectorwidget.cpp:438
KPixmapRegionSelectorWidget(QWidget *parent=nullptr)
Constructor for a KPixmapRegionSelectorWidget.
Definition kpixmapregionselectorwidget.cpp:62
void setFreeSelectionAspectRatio()
Allows the user to do a selection which has any aspect ratio.
Definition kpixmapregionselectorwidget.cpp:457
void setPixmap(const QPixmap &pixmap)
Sets the pixmap which will be shown for the user to select a region from.
Definition kpixmapregionselectorwidget.cpp:96
void setSelectionAspectRatio(int width, int height)
Sets the aspect ration that the selected subimage should have.
Definition kpixmapregionselectorwidget.cpp:452
~KPixmapRegionSelectorWidget() override
Destructor for a KPixmapRegionSelectorWidget.
void rotateCounterclockwise()
Rotates the current image 90º counterclockwise.
Definition kpixmapregionselectorwidget.cpp:257
void rotate(RotateDirection direction)
Rotates the image as specified by the direction parameter, also tries to rotate the selected region s...
Definition kpixmapregionselectorwidget.cpp:195
QRect selectedRegion() const
Returns the selected region ( in zoomed pixmap coordinates )
Definition kpixmapregionselectorwidget.cpp:112
void setMaximumWidgetSize(int width, int height)
Sets the maximum size for the widget.
Definition kpixmapregionselectorwidget.cpp:462
QImage selectedImage() const
Definition kpixmapregionselectorwidget.cpp:446
virtual void addItem(QLayoutItem *item) override
void addStretch(int stretch)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
LayoutRequest
Type type() const const
void restoreOverrideCursor()
void setOverrideCursor(const QCursor &cursor)
QIcon fromTheme(const QString &name)
QImage copy(const QRect &rectangle) const const
QImage scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
QImage transformed(const QTransform &matrix, Qt::TransformationMode mode) const const
void setPixmap(const QPixmap &)
QPoint pos() const const
Q_EMITQ_EMIT
virtual bool eventFilter(QObject *watched, QEvent *event)
QObject * parent() const const
void setObjectName(QAnyStringView name)
QString tr(const char *sourceText, const char *disambiguation, int n)
CompositionMode_SourceAtop
bool begin(QPaintDevice *device)
void drawPixmap(const QPoint &point, const QPixmap &pixmap)
bool end()
QPixmap fromImage(QImage &&image, Qt::ImageConversionFlags flags)
bool isNull() const const
void setX(int x)
void setY(int y)
int x() const const
int y() const const
QPoint toPoint() const const
qreal x() const const
qreal y() const const
Rectangle
Qt::MouseButton button() const const
QPointF globalPosition() const const
QPointF position() const const
KeepAspectRatio
SizeAllCursor
RightButton
SmoothTransformation
WA_NoSystemBackground
QWidget(QWidget *parent, Qt::WindowFlags f)
cursor
height
rect
void resize(const QSize &)
width
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 12:02:04 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 12:02:04 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.