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

Public Types

enum  Flag { NoFlags = 0 , ShowResizeHandles = 1 << 0 , MoveByDrag = 1 << 1 , GeometryEditable = ShowResizeHandles | MoveByDrag }
 

Public Slots

void setViewportRect (const QRectF &rect)
 

Signals

void geometryChanged ()
 
void geometryEdited ()
 
void geometryOnImageChanged ()
 
void positionChanged ()
 
void positionOnImageChanged ()
 
void sizeChanged ()
 
void sizeOnImageChanged ()
 

Public Member Functions

QRectF boundingRect () const override
 
void changeFlags (Flags flags, bool addOrRemove)
 
Flags flags () const
 
QGraphicsWidget * hudWidget () const
 
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
 
 RubberItem (ImagePreviewItem *const item)
 
void setCanvas (Canvas *const canvas)
 
void setFixedRatio (double ratio)
 
void setFlags (Flags flags)
 
void setHudWidget (QGraphicsWidget *const hudWidget)
 
void setHudWidget (QWidget *const widget, Qt::WindowFlags wFlags=Qt::WindowFlags())
 
void setHudWidgetVisible (bool visible)
 
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 setRectInSceneCoordinatesAdjusted (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
 
 ~RubberItem () override
 

Protected Slots

void imageSizeChanged (const QSizeF &)
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverMoveEvent (QGraphicsSceneHoverEvent *event) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 

Member Enumeration Documentation

◆ Flag

Enumerator
NoFlags 
ShowResizeHandles 
MoveByDrag 
GeometryEditable 

Constructor & Destructor Documentation

◆ RubberItem()

Digikam::RubberItem::RubberItem ( ImagePreviewItem *const  item)
explicit

◆ ~RubberItem()

Digikam::RubberItem::~RubberItem ( )
override

Member Function Documentation

◆ boundingRect()

◆ changeFlags()

void Digikam::RegionFrameItem::changeFlags ( Flags  flags,
bool  addOrRemove 
)
inherited

◆ eventFilter()

bool Digikam::RegionFrameItem::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotectedinherited

◆ flags()

RegionFrameItem::Flags Digikam::RegionFrameItem::flags ( ) const
inherited

◆ geometryChanged

void Digikam::DImgChildItem::geometryChanged ( )
signalinherited

◆ geometryEdited

void Digikam::RegionFrameItem::geometryEdited ( )
signalinherited

◆ geometryOnImageChanged

void Digikam::DImgChildItem::geometryOnImageChanged ( )
signalinherited

◆ hoverEnterEvent()

void Digikam::RegionFrameItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotectedinherited

◆ hoverLeaveEvent()

void Digikam::RegionFrameItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotectedinherited

◆ hoverMoveEvent()

void Digikam::RegionFrameItem::hoverMoveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotectedinherited

◆ hudWidget()

QGraphicsWidget * Digikam::RegionFrameItem::hudWidget ( ) const
inherited

◆ imageSizeChanged

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

◆ itemChange()

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

References value.

◆ mouseMoveEvent()

void Digikam::RubberItem::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

◆ mousePressEvent()

void Digikam::RegionFrameItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotectedinherited

◆ mouseReleaseEvent()

void Digikam::RubberItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

◆ moveBy()

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

◆ originalPos()

◆ originalRect()

QRect Digikam::DImgChildItem::originalRect ( ) const
inherited

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 Digikam::DImgChildItem::originalPos(), and Digikam::DImgChildItem::originalSize().

Referenced by Digikam::FaceGroup::applyItemGeometryChanges(), Digikam::FaceGroup::slotAddItemFinished(), Digikam::FocusPointGroup::slotAddItemFinished(), and Digikam::FaceGroup::slotAssigned().

◆ originalSize()

◆ paint()

void Digikam::RegionFrameItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
overrideprotectedinherited

◆ parentDImgItem()

GraphicsDImgItem * Digikam::DImgChildItem::parentDImgItem ( ) const
inherited

◆ positionChanged

void Digikam::DImgChildItem::positionChanged ( )
signalinherited

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

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

◆ rect()

QRectF Digikam::DImgChildItem::rect ( ) const
inherited

◆ relativePos()

QPointF Digikam::DImgChildItem::relativePos ( ) const
inherited

◆ relativeRect()

QRectF Digikam::DImgChildItem::relativeRect ( ) const
inherited

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
inherited

◆ setCanvas()

void Digikam::RubberItem::setCanvas ( Canvas *const  canvas)

◆ setFixedRatio()

void Digikam::RegionFrameItem::setFixedRatio ( double  ratio)
inherited

◆ setFlags()

◆ setHudWidget() [1/2]

void Digikam::RegionFrameItem::setHudWidget ( QGraphicsWidget *const  hudWidget)
inherited

Sets a widget item as HUD item. A HUD item will be positioned relative to this item, and repositioned on position changes or resizing. Ownership of the item is taken, and it is made a child item of this item. You can also add QWidget directly. It will be wrapped in a proxy item.

References Digikam::RegionFrameItem::hudWidget().

Referenced by Digikam::FaceItem::setHudWidget(), and Digikam::RegionFrameItem::setHudWidget().

◆ setHudWidget() [2/2]

void Digikam::RegionFrameItem::setHudWidget ( QWidget *const  widget,
Qt::WindowFlags  wFlags = Qt::WindowFlags() 
)
inherited

◆ setHudWidgetVisible()

void Digikam::RegionFrameItem::setHudWidgetVisible ( bool  visible)
inherited

◆ setOriginalPos() [1/2]

void Digikam::DImgChildItem::setOriginalPos ( const QPointF &  posInOriginal)
inherited

◆ setOriginalPos() [2/2]

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

◆ setOriginalRect() [1/2]

◆ setOriginalRect() [2/2]

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

◆ setOriginalSize() [1/2]

◆ setOriginalSize() [2/2]

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

◆ setPos() [1/2]

void Digikam::DImgChildItem::setPos ( const QPointF &  zoomedPos)
inherited

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

Referenced by Digikam::DImgChildItem::setRect().

◆ setPos() [2/2]

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

◆ setRect() [1/2]

◆ setRect() [2/2]

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

◆ setRectInSceneCoordinates()

void Digikam::DImgChildItem::setRectInSceneCoordinates ( const QRectF &  rect)
inherited

Equivalent to mapping the scene coordinates to the parent item, and calling setRect().

References Digikam::DImgChildItem::rect(), and Digikam::DImgChildItem::setRect().

Referenced by Digikam::RegionFrameItem::setRectInSceneCoordinatesAdjusted().

◆ setRectInSceneCoordinatesAdjusted()

◆ setRelativePos() [1/2]

void Digikam::DImgChildItem::setRelativePos ( const QPointF &  relativePosition)
inherited

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 Digikam::DImgChildItem::geometryOnImageChanged(), Digikam::DImgChildItem::positionOnImageChanged(), and Digikam::DImgChildItem::relativePos().

Referenced by Digikam::DImgChildItem::setOriginalPos(), Digikam::DImgChildItem::setPos(), and Digikam::DImgChildItem::setRelativeRect().

◆ setRelativePos() [2/2]

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

◆ setRelativeRect() [1/2]

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

◆ setRelativeRect() [2/2]

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

◆ setRelativeSize() [1/2]

◆ setRelativeSize() [2/2]

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

◆ setSize() [1/2]

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

◆ setSize() [2/2]

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

◆ setViewportRect

void Digikam::RegionFrameItem::setViewportRect ( const QRectF &  rect)
slotinherited

The associated HUD item is dynamically moved to be visible. This can only be done for one region at a time. Set the current primary view region of the scene by this method to dynamically reposition the HUD inside this region. The rect given is in scene coordinates.

References Digikam::DImgChildItem::rect().

◆ size()

QSizeF Digikam::DImgChildItem::size ( ) const
inherited

◆ sizeChanged

void Digikam::DImgChildItem::sizeChanged ( )
signalinherited

◆ sizeOnImageChanged

void Digikam::DImgChildItem::sizeOnImageChanged ( )
signalinherited

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