digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::RegionFrameItem Class Reference
+ Inheritance diagram for Digikam::RegionFrameItem:

Public Types

enum  Flag { NoFlags = 0 , ShowResizeHandles = 1 << 0 , MoveByDrag = 1 << 1 , GeometryEditable = ShowResizeHandles | MoveByDrag }
 
typedef QFlags< Flag > Flags
 

Public Slots

void setViewportRect (const QRectF &rect)
 The associated HUD item is dynamically moved to be visible.
 

Signals

void geometryEdited ()
 
- Signals inherited from Digikam::DImgChildItem
void geometryChanged ()
 
void geometryOnImageChanged ()
 
void positionChanged ()
 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).
 
void positionOnImageChanged ()
 These signals are emitted when the geometry, relative to the original image, of this item has changed.
 
void sizeChanged ()
 
void sizeOnImageChanged ()
 

Public Member Functions

 RegionFrameItem (QGraphicsItem *const parent)
 
void changeFlags (Flags flags, bool addOrRemove)
 
Flags flags () const
 
QGraphicsWidget * hudWidget () const
 
void setFixedRatio (double ratio)
 
void setFlags (Flags flags)
 
void setHudWidget (QGraphicsWidget *const hudWidget)
 Sets a widget item as HUD item.
 
void setHudWidget (QWidget *const widget, Qt::WindowFlags wFlags=Qt::WindowFlags())
 
void setHudWidgetVisible (bool visible)
 
void setRectInSceneCoordinatesAdjusted (const QRectF &rect)
 
- Public Member Functions inherited from Digikam::DImgChildItem
 DImgChildItem (QGraphicsItem *const parent=nullptr)
 This is a base class for items that are positioned on top of a GraphicsDImgItem, positioned in relative coordinates, i.e.
 
QRectF boundingRect () const override
 Reimplemented.
 
void moveBy (qreal dx, qreal dy)
 
QPoint originalPos () const
 
QRect originalRect () const
 Returns the position and size in coordinates of the original image.
 
QSize originalSize () const
 
GraphicsDImgItemparentDImgItem () const
 If the parent item is a GraphicsDImgItem, return it, if the parent item is null or of a different class, returns 0.
 
QRectF rect () const
 Returns position and size of this item, in coordinates of the parent DImg with the current zoom.
 
QPointF relativePos () const
 
QRectF relativeRect () const
 Returns the position and size relative to the DImg displayed in the parent item.
 
QSizeF relativeSize () const
 
void setOriginalPos (const QPointF &posInOriginal)
 Sets the position and size of this item, in coordinates of the original image.
 
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)
 Sets the position and size of this item, in coordinates of the parent DImg item.
 
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)
 Equivalent to mapping the scene coordinates to the parent item, and calling setRect().
 
void setRelativePos (const QPointF &relativePosition)
 Sets the position and size of this item, relative to the DImg displayed in the parent item.
 
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
 

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
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
- Protected Member Functions inherited from Digikam::DImgChildItem
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 

Additional Inherited Members

- Protected Slots inherited from Digikam::DImgChildItem
void imageSizeChanged (const QSizeF &)
 

Member Function Documentation

◆ setHudWidget()

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

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.

◆ setViewportRect

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

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.