digiKam
Digikam::DImgChildItem Class Reference
+ Inheritance diagram for Digikam::DImgChildItem:

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

Constructor & Destructor Documentation

◆ DImgChildItem()

Digikam::DImgChildItem::DImgChildItem ( QGraphicsItem *const  parent = nullptr)
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.

◆ ~DImgChildItem()

Digikam::DImgChildItem::~DImgChildItem ( )
override

Member Function Documentation

◆ boundingRect()

QRectF Digikam::DImgChildItem::boundingRect ( ) const
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().

◆ geometryChanged

void Digikam::DImgChildItem::geometryChanged ( )
signal

◆ geometryOnImageChanged

void Digikam::DImgChildItem::geometryOnImageChanged ( )
signal

Referenced by setRelativePos(), and setRelativeSize().

◆ imageSizeChanged

void Digikam::DImgChildItem::imageSizeChanged ( const QSizeF &  )
protectedslot

◆ itemChange()

QVariant Digikam::DImgChildItem::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

References value.

◆ moveBy()

void Digikam::DImgChildItem::moveBy ( qreal  dx,
qreal  dy 
)
inline

◆ originalPos()

QPoint Digikam::DImgChildItem::originalPos ( ) const

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

◆ originalSize()

◆ parentDImgItem()

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

◆ positionChanged

void Digikam::DImgChildItem::positionChanged ( )
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().

◆ positionOnImageChanged

void Digikam::DImgChildItem::positionOnImageChanged ( )
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().

◆ rect()

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

◆ relativePos()

QPointF Digikam::DImgChildItem::relativePos ( ) const

Referenced by setRelativePos().

◆ relativeRect()

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].

◆ relativeSize()

QSizeF Digikam::DImgChildItem::relativeSize ( ) const

Referenced by setRelativeSize().

◆ setOriginalPos() [1/2]

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

◆ setOriginalPos() [2/2]

void Digikam::DImgChildItem::setOriginalPos ( qreal  x,
qreal  y 
)
inline

◆ setOriginalRect() [1/2]

void Digikam::DImgChildItem::setOriginalRect ( const QRectF &  rect)

◆ setOriginalRect() [2/2]

void Digikam::DImgChildItem::setOriginalRect ( qreal  x,
qreal  y,
qreal  width,
qreal  height 
)
inline

◆ setOriginalSize() [1/2]

void Digikam::DImgChildItem::setOriginalSize ( const QSizeF &  sizeInOriginal)

◆ setOriginalSize() [2/2]

void Digikam::DImgChildItem::setOriginalSize ( qreal  width,
qreal  height 
)
inline

◆ setPos() [1/2]

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

◆ setPos() [2/2]

void Digikam::DImgChildItem::setPos ( qreal  x,
qreal  y 
)
inline

◆ setRect() [1/2]

void Digikam::DImgChildItem::setRect ( const QRectF &  rect)

◆ setRect() [2/2]

void Digikam::DImgChildItem::setRect ( qreal  x,
qreal  y,
qreal  width,
qreal  height 
)
inline

◆ setRectInSceneCoordinates()

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

◆ setRelativePos() [1/2]

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

◆ setRelativePos() [2/2]

void Digikam::DImgChildItem::setRelativePos ( qreal  x,
qreal  y 
)
inline

◆ setRelativeRect() [1/2]

void Digikam::DImgChildItem::setRelativeRect ( const QRectF &  rect)

◆ setRelativeRect() [2/2]

void Digikam::DImgChildItem::setRelativeRect ( qreal  x,
qreal  y,
qreal  width,
qreal  height 
)
inline

◆ setRelativeSize() [1/2]

void Digikam::DImgChildItem::setRelativeSize ( const QSizeF &  relativeSize)

◆ setRelativeSize() [2/2]

void Digikam::DImgChildItem::setRelativeSize ( qreal  width,
qreal  height 
)
inline

◆ setSize() [1/2]

void Digikam::DImgChildItem::setSize ( const QSizeF &  zoomedSize)

References setRelativeSize(), and size().

Referenced by setRect().

◆ setSize() [2/2]

void Digikam::DImgChildItem::setSize ( qreal  width,
qreal  height 
)
inline

◆ size()

QSizeF Digikam::DImgChildItem::size ( ) const

Referenced by boundingRect(), rect(), and setSize().

◆ sizeChanged

void Digikam::DImgChildItem::sizeChanged ( )
signal

◆ sizeOnImageChanged

void Digikam::DImgChildItem::sizeOnImageChanged ( )
signal

Referenced by setRelativeSize().


The documentation for this class was generated from the following files: