KWidgetsAddons
kpixmapregionselectorwidget.cpp
70 d->m_label->setAttribute(Qt::WA_NoSystemBackground, true); // setBackgroundMode( Qt::NoBackground );
273 if (d->m_selectedRegion.contains(mev->pos()) && d->m_selectedRegion != d->m_originalPixmap.rect()) {
303 d->m_selectedRegion.translate(d->m_originalPixmap.width() - d->m_selectedRegion.width() - d->m_selectedRegion.x(), 0);
310 d->m_selectedRegion.translate(0, d->m_originalPixmap.height() - d->m_selectedRegion.height() - d->m_selectedRegion.y());
331 d->m_selectedRegion.translate(0, -(d->m_selectedRegion.bottom() - d->m_originalPixmap.height()));
343 if (d->m_state == KPixmapRegionSelectorWidgetPrivate::Resizing && mev->pos() == d->m_tempFirstClick) {
357QRect KPixmapRegionSelectorWidgetPrivate::calcSelectionRectangle(const QPoint &startPoint, const QPoint &_endPoint)
469 // qCDebug(KWidgetsAddonsLog) << QString(" unzoomed Pixmap : %1 x %2 ").arg(d->m_unzoomedPixmap.width()).arg(d->m_unzoomedPixmap.height());
471 if (!d->m_originalPixmap.isNull() && (d->m_originalPixmap.width() > d->m_maxWidth || d->m_originalPixmap.height() > d->m_maxHeight)) {
474 d->m_originalPixmap = QPixmap::fromImage(image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation));
KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly wa...
Definition kpixmapregionselectorwidget.h:30
void setSelectedRegion(const QRect &rect)
Sets the selected region to be rect (in zoomed pixmap coordinates)
Definition kpixmapregionselectorwidget.cpp:113
void resetSelection()
Resets the selection to use the whole image.
Definition kpixmapregionselectorwidget.cpp:101
virtual QMenu * createPopupMenu()
Creates a QMenu with the menu that appears when clicking with the right button on the label.
Definition kpixmapregionselectorwidget.cpp:169
void rotateClockwise()
Rotates the current image 90º clockwise.
Definition kpixmapregionselectorwidget.cpp:248
QRect unzoomedSelectedRegion() const
Returns the selected region ( in unzoomed, original pixmap coordinates )
Definition kpixmapregionselectorwidget.cpp:434
KPixmapRegionSelectorWidget(QWidget *parent=nullptr)
Constructor for a KPixmapRegionSelectorWidget.
Definition kpixmapregionselectorwidget.cpp:58
void setFreeSelectionAspectRatio()
Allows the user to do a selection which has any aspect ratio.
Definition kpixmapregionselectorwidget.cpp:453
void setPixmap(const QPixmap &pixmap)
Sets the pixmap which will be shown for the user to select a region from.
Definition kpixmapregionselectorwidget.cpp:92
void setSelectionAspectRatio(int width, int height)
Sets the aspect ration that the selected subimage should have.
Definition kpixmapregionselectorwidget.cpp:448
~KPixmapRegionSelectorWidget() override
Destructor for a KPixmapRegionSelectorWidget.
void rotateCounterclockwise()
Rotates the current image 90º counterclockwise.
Definition kpixmapregionselectorwidget.cpp:253
void rotate(RotateDirection direction)
Rotates the image as specified by the direction parameter, also tries to rotate the selected region s...
Definition kpixmapregionselectorwidget.cpp:191
QRect selectedRegion() const
Returns the selected region ( in zoomed pixmap coordinates )
Definition kpixmapregionselectorwidget.cpp:108
void setMaximumWidgetSize(int width, int height)
Sets the maximum size for the widget.
Definition kpixmapregionselectorwidget.cpp:458
QImage selectedImage() const
Definition kpixmapregionselectorwidget.cpp:442
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)
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)
int height() const const
bool isNull() const const
QRect rect() const const
int width() 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
int height() const const
void setHeight(int height)
void setWidth(int width)
QSize size() const const
QPoint topLeft() const const
int width() const const
Rectangle
void setGeometry(const QRect &rect)
Qt::MouseButton button() const const
QPointF globalPosition() const const
QPointF position() const const
KeepAspectRatio
SizeAllCursor
RightButton
SmoothTransformation
WA_NoSystemBackground
cursor
height
void hide()
rect
void show()
void resize(const QSize &)
width
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:58:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:58:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.