digiKam
|
Signals | |
void | geometryChanged () |
void | geometryOnImageChanged () |
void | positionChanged () |
void | positionOnImageChanged () |
void | sizeChanged () |
void | sizeOnImageChanged () |
Public Member Functions | |
QRectF | boundingRect () const override |
DImgChildItem (QGraphicsItem *const parent=nullptr) | |
void | moveBy (qreal dx, qreal dy) |
QPoint | originalPos () const |
QRect | originalRect () const |
QSize | originalSize () const |
GraphicsDImgItem * | parentDImgItem () const |
QRectF | rect () const |
QPointF | relativePos () const |
QRectF | relativeRect () const |
QSizeF | relativeSize () const |
void | setOriginalPos (const QPointF &posInOriginal) |
void | setOriginalPos (qreal x, qreal y) |
void | setOriginalRect (const QRectF &rect) |
void | setOriginalRect (qreal x, qreal y, qreal width, qreal height) |
void | setOriginalSize (const QSizeF &sizeInOriginal) |
void | setOriginalSize (qreal width, qreal height) |
void | setPos (const QPointF &zoomedPos) |
void | setPos (qreal x, qreal y) |
void | setRect (const QRectF &rect) |
void | setRect (qreal x, qreal y, qreal width, qreal height) |
void | setRectInSceneCoordinates (const QRectF &rect) |
void | setRelativePos (const QPointF &relativePosition) |
void | setRelativePos (qreal x, qreal y) |
void | setRelativeRect (const QRectF &rect) |
void | setRelativeRect (qreal x, qreal y, qreal width, qreal height) |
void | setRelativeSize (const QSizeF &relativeSize) |
void | setRelativeSize (qreal width, qreal height) |
void | setSize (const QSizeF &zoomedSize) |
void | setSize (qreal width, qreal height) |
QSizeF | size () const |
~DImgChildItem () override | |
Protected Slots | |
void | imageSizeChanged (const QSizeF &) |
Protected Member Functions | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
|
explicit |
This is a base class for items that are positioned on top of a GraphicsDImgItem, positioned in relative coordinates, i.e. [0;1], on the image. From the set relative size, the boundingRect() is calculated.
|
override |
|
override |
Reimplemented. Returns a rectangle starting at (0,0) (pos() in parent coordinates) and has a size determined by the relative size.
References size().
Referenced by Digikam::RegionFrameItem::boundingRect().
|
signal |
|
signal |
Referenced by setRelativePos(), and setRelativeSize().
|
protectedslot |
|
overrideprotected |
References value.
|
inline |
QPoint Digikam::DImgChildItem::originalPos | ( | ) | const |
References Digikam::ImageZoomSettings::originalImageSize(), originalSize(), parentDImgItem(), and Digikam::GraphicsDImgItem::zoomSettings.
Referenced by originalRect().
QRect Digikam::DImgChildItem::originalRect | ( | ) | const |
Returns the position and size in coordinates of the original image. Note that the return value is integer based. At high zoom rates, different values of relativeRect() or zoomedRect() may result in the same originalRect(), when one pixel in the original is represented by more than one pixel on screen.
References originalPos(), and originalSize().
Referenced by Digikam::FaceGroup::applyItemGeometryChanges(), Digikam::FaceGroup::slotAddItemFinished(), Digikam::FocusPointGroup::slotAddItemFinished(), and Digikam::FaceGroup::slotAssigned().
QSize Digikam::DImgChildItem::originalSize | ( | ) | const |
References Digikam::ImageZoomSettings::originalImageSize(), parentDImgItem(), and Digikam::GraphicsDImgItem::zoomSettings.
Referenced by originalPos(), originalRect(), setOriginalPos(), and setOriginalSize().
GraphicsDImgItem * Digikam::DImgChildItem::parentDImgItem | ( | ) | const |
If the parent item is a GraphicsDImgItem, return it, if the parent item is null or of a different class, returns 0.
Referenced by Digikam::RegionFrameItem::mouseMoveEvent(), originalPos(), originalSize(), setOriginalPos(), and setOriginalSize().
|
signal |
These signals are emitted in any case when the geometry changed: Either after changing the geometry relative to the original image, or when the size of the parent GraphicsDImgItem changed (zooming). positionChanged() is equivalent to listening to xChanged() and yChanged().
Referenced by Digikam::RegionFrameItem::RegionFrameItem().
|
signal |
These signals are emitted when the geometry, relative to the original image, of this item has changed. This happens by calling any of the methods above.
Referenced by setRelativePos().
QRectF Digikam::DImgChildItem::rect | ( | ) | const |
Returns position and size of this item, in coordinates of the parent DImg with the current zoom. This is the same result as QRectF(pos(), boundingRect()), boundingRect is virtual and may be overridden by base classes.
References size().
Referenced by Digikam::RegionFrameItem::mouseMoveEvent(), Digikam::RegionFrameItem::paint(), setOriginalRect(), setRect(), setRectInSceneCoordinates(), Digikam::RegionFrameItem::setRectInSceneCoordinatesAdjusted(), setRelativeRect(), and Digikam::RegionFrameItem::setViewportRect().
QPointF Digikam::DImgChildItem::relativePos | ( | ) | const |
Referenced by setRelativePos().
QRectF Digikam::DImgChildItem::relativeRect | ( | ) | const |
Returns the position and size relative to the DImg displayed in the parent item. All four values are in the interval [0;1].
QSizeF Digikam::DImgChildItem::relativeSize | ( | ) | const |
Referenced by setRelativeSize().
void Digikam::DImgChildItem::setOriginalPos | ( | const QPointF & | posInOriginal | ) |
Sets the position and size of this item, in coordinates of the original image. Requires a valid parent item.
References Digikam::ImageZoomSettings::originalImageSize(), originalSize(), parentDImgItem(), setRelativePos(), and Digikam::GraphicsDImgItem::zoomSettings.
Referenced by setOriginalRect().
|
inline |
void Digikam::DImgChildItem::setOriginalRect | ( | const QRectF & | rect | ) |
References rect(), setOriginalPos(), and setOriginalSize().
Referenced by Digikam::FaceGroup::Private::createItem(), and Digikam::FocusPointGroup::Private::createItem().
|
inline |
void Digikam::DImgChildItem::setOriginalSize | ( | const QSizeF & | sizeInOriginal | ) |
References Digikam::ImageZoomSettings::originalImageSize(), originalSize(), parentDImgItem(), setRelativeSize(), and Digikam::GraphicsDImgItem::zoomSettings.
Referenced by setOriginalRect().
|
inline |
void Digikam::DImgChildItem::setPos | ( | const QPointF & | zoomedPos | ) |
Sets the position and size of this item, in coordinates of the parent DImg item. This is accepting unscaled parent coordinates, just like the "normal" setPos() does. Requires a valid parent item.
References setRelativePos().
Referenced by setRect().
|
inline |
void Digikam::DImgChildItem::setRect | ( | const QRectF & | rect | ) |
References rect(), setPos(), and setSize().
Referenced by Digikam::RegionFrameItem::mouseMoveEvent(), and setRectInSceneCoordinates().
|
inline |
void Digikam::DImgChildItem::setRectInSceneCoordinates | ( | const QRectF & | rect | ) |
Equivalent to mapping the scene coordinates to the parent item, and calling setRect().
References rect(), and setRect().
Referenced by Digikam::RegionFrameItem::setRectInSceneCoordinatesAdjusted().
void Digikam::DImgChildItem::setRelativePos | ( | const QPointF & | relativePosition | ) |
Sets the position and size of this item, relative to the DImg displayed in the parent item. The values of relativePosition must be in the interval [0;1].
References geometryOnImageChanged(), positionOnImageChanged(), and relativePos().
Referenced by setOriginalPos(), setPos(), and setRelativeRect().
|
inline |
void Digikam::DImgChildItem::setRelativeRect | ( | const QRectF & | rect | ) |
References rect(), setRelativePos(), and setRelativeSize().
|
inline |
void Digikam::DImgChildItem::setRelativeSize | ( | const QSizeF & | relativeSize | ) |
References geometryOnImageChanged(), relativeSize(), and sizeOnImageChanged().
Referenced by setOriginalSize(), setRelativeRect(), and setSize().
|
inline |
void Digikam::DImgChildItem::setSize | ( | const QSizeF & | zoomedSize | ) |
References setRelativeSize(), and size().
Referenced by setRect().
|
inline |
QSizeF Digikam::DImgChildItem::size | ( | ) | const |
Referenced by boundingRect(), rect(), and setSize().
|
signal |
Referenced by Digikam::RegionFrameItem::RegionFrameItem().
|
signal |
Referenced by setRelativeSize().