| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Digikam::ItemDelegate Class Referenceabstract
Inheritance diagram for Digikam::ItemDelegate:

## Public Member Functions
| ItemDelegate (QWidget *const parent)
bool | acceptsActivation (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *activationRect=nullptr) const override
bool | acceptsToolTip (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *tooltipRect=nullptr) const override
| These methods take four parameters: The position on viewport, the rect on viewport, the index, and optionally a parameter into which, if the return value is true, a rectangle can be written for which the return value will be true as well.
QRect | actualPixmapRect (const QModelIndex &index) const
int | calculatethumbSizeToFit (int ws)
ItemCategoryDrawer * | categoryDrawer () const
QRect | commentsRect () const
QRect | coordinatesIndicatorRect () const
QRect | groupIndicatorRect () const
QRect | imageInformationRect () const override
| Returns the area where the image information is drawn, or null if empty / not supported.
void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
QPixmap | pixmapForDrag (const QStyleOptionViewItem &option, const QList< QModelIndex > &indexes) const override
QRect | pixmapRect () const override
| Returns the area where the pixmap is drawn, or null if not supported.
void | setDefaultViewOptions (const QStyleOptionViewItem &option) override
| Style option with standard values to use for cached rendering.
void | setSpacing (int spacing) override
void | setView (ItemCategorizedView *view)
QRect | tagsRect () const
Public Member Functions inherited from Digikam::ItemViewDelegate
| ItemViewDelegate (QWidget *const parent)
bool | acceptsActivation (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *activationRect=nullptr) const override
bool | acceptsToolTip (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *tooltipRect=nullptr) const override
| These methods take four parameters: The position on viewport, the rect on viewport, the index, and optionally a parameter into which, if the return value is true, a rectangle can be written for which the return value will be true as well.
double | displayRatio () const
QSize | gridSize () const override
| Returns the gridsize to be set by the view.
void | mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index) override
virtual QRect | ratingRect () const
| Returns the rectangle where the rating is drawn, or a null rectangle if not supported.
QRect | rect () const
void | setDefaultViewOptions (const QStyleOptionViewItem &option) override
| Style option with standard values to use for cached rendering.
void | setRatingEdited (const QModelIndex &index)
| Can be used to temporarily disable drawing of the rating.
void | setSpacing (int spacing) override
void | setThumbnailSize (const ThumbnailSize &thumbSize) override
| You must set these options from the view.
QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
int | spacing () const
ThumbnailSize | thumbnailSize () const
Public Member Functions inherited from Digikam::DItemDelegate
| DItemDelegate (QObject *const parent=nullptr)
Public Member Functions inherited from Digikam::ItemDelegateOverlayContainer
| ItemDelegateOverlayContainer ()=default
| This is a sample implementation for delegate management methods, to be inherited by a delegate.
void | installOverlay (ItemDelegateOverlay *overlay)
void | mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index)
QList< ItemDelegateOverlay * > | overlays () const
void | removeAllOverlays ()
void | removeOverlay (ItemDelegateOverlay *overlay)
void | setAllOverlaysActive (bool active)
void | setViewOnAllOverlays (QAbstractItemView *view)

## Static Public Member Functions
static QPixmap | retrieveThumbnailPixmap (const QModelIndex &index, int thumbnailSize)
| Retrieve the thumbnail pixmap in given size for the ItemModel::ThumbnailRole for the given index from the given index, which must adhere to ItemThumbnailModel semantics.
Static Public Member Functions inherited from Digikam::DItemDelegate
static QPixmap | makeDragPixmap (const QStyleOptionViewItem &option, const QList< QModelIndex > &indexes, double displayRatio, const QPixmap &suggestedPixmap=QPixmap())
static QString | squeezedText (const QFontMetrics &fm, int width, const QString &text)

## Protected Slots
void | modelChanged ()
void | modelContentsChanged ()
Protected Slots inherited from Digikam::ItemViewDelegate
void | overlayDestroyed (QObject *o) override
void | slotSetupChanged ()
void | slotThemeChanged ()

## Protected Member Functions
| ItemDelegate (ItemDelegate::ItemDelegatePrivate &dd, QWidget *const parent)
void | clearCaches () override
virtual void | clearModelDataCaches ()
| Reimplement to clear caches based on model indexes (hash on row number etc.) Change signals are listened to this is called whenever such properties become invalid.
void | invalidatePaintingCache () override
bool | onActualPixmapRect (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *actualRect) const
void | setModel (QAbstractItemModel *model)
virtual QPixmap | thumbnailPixmap (const QModelIndex &index) const
void | updateActualPixmapRect (const QModelIndex &index, const QRect &rect)
virtual void | updateContentWidth ()
| Reimplement this to set contentWidth.
virtual void | updateRects ()=0
| In a subclass, you need to implement this method to set up the rects for drawing.
void | updateSizeRectsAndPixmaps () override
Protected Member Functions inherited from Digikam::ItemViewDelegate
| ItemViewDelegate (ItemViewDelegatePrivate &dd, QWidget *const parent)
QAbstractItemDelegate * | asDelegate () override
void | drawAspectRatio (QPainter *p, const QRect &dimsRect, const QSize &dims) const
void | drawColorLabelLine (QPainter *p, const QRect &pixRect, int colorId) const
void | drawComments (QPainter *p, const QRect &commentsRect, const QString &comments) const
void | drawCreationDate (QPainter *p, const QRect &dateRect, const QDateTime &date) const
void | drawFileSize (QPainter *p, const QRect &r, qlonglong bytes) const
void | drawFocusRect (QPainter *p, const QStyleOptionViewItem &option, bool isSelected) const
void | drawGeolocationIndicator (QPainter *p, const QRect &r) const
void | drawGroupedRect (QPainter *p, const QStyleOptionViewItem &option) const
void | drawGroupIndicator (QPainter *p, const QRect &r, int numberOfGroupedImages, bool open) const
void | drawImageFormat (QPainter *p, const QRect &r, const QString &f, bool drawTop) const
void | drawImageSize (QPainter *p, const QRect &dimsRect, const QSize &dims) const
void | drawModificationDate (QPainter *p, const QRect &dateRect, const QDateTime &date) const
void | drawMouseOverRect (QPainter *p, const QStyleOptionViewItem &option) const
void | drawName (QPainter *p, const QRect &nameRect, const QString &name) const
void | drawPanelSideIcon (QPainter *p, bool left, bool right) const
void | drawPickLabelIcon (QPainter *p, const QRect &r, int pickLabel) const
void | drawRating (QPainter *p, const QModelIndex &index, const QRect &ratingRect, int rating, bool isSelected) const
void | drawSpecialInfo (QPainter *p, const QRect &r, const QString &text) const
void | drawTags (QPainter *p, const QRect &r, const QString &tagsString, bool isSelected) const
QRect | drawThumbnail (QPainter *p, const QRect &thumbRect, const QPixmap &background, const QPixmap &thumbnail, bool isGrouped) const
| Use the tool methods for painting in subclasses.
void | drawTitle (QPainter *p, const QRect &titleRect, const QString &title) const
void | prepareBackground ()
void | prepareFonts ()
void | prepareMetrics (int maxWidth)
void | prepareRatingPixmaps (bool composeOverBackground=true)
QPixmap | ratingPixmap (int rating, bool selected) const
| Returns the relevant pixmap from the cached rating pixmaps.
Protected Member Functions inherited from Digikam::DItemDelegate
QString | squeezedTextCached (QPainter *const p, int width, const QString &text) const
QPixmap | thumbnailBorderPixmap (const QSize &pixSize, bool isGrouped=false) const
Protected Member Functions inherited from Digikam::ItemDelegateOverlayContainer
virtual void | drawOverlays (QPainter *p, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual void | overlayDestroyed (QObject *o)
| Declare as slot in the derived class calling this method.

## Additional Inherited Members
Signals inherited from Digikam::ItemViewDelegate
void | hideNotification ()
void | requestNotification (const QModelIndex &index, const QString &message)
Signals inherited from Digikam::DItemDelegate
void | gridSizeChanged (const QSize &newSize)
void | visualChange ()
Protected Attributes inherited from Digikam::ItemViewDelegate
ItemViewDelegatePrivate *const | d_ptr = nullptr
Protected Attributes inherited from Digikam::ItemDelegateOverlayContainer
QList< ItemDelegateOverlay * > | m_overlays

## Member Function Documentation

## ◆ acceptsActivation()

bool Digikam::ItemDelegate::acceptsActivation | ( | const QPoint & | pos,
|  | const QRect & | visualRect,
|  | const QModelIndex & | index,
|  | QRect * | activationRect = `nullptr`
| ) |  | const
| override virtual

Implements Digikam::DItemDelegate.

## ◆ acceptsToolTip()

bool Digikam::ItemDelegate::acceptsToolTip | ( | const QPoint & | pos,
|  | const QRect & | visualRect,
|  | const QModelIndex & | index,
|  | QRect * | tooltipRect = `nullptr`
| ) |  | const
| override virtual

Implements Digikam::DItemDelegate.

## ◆ clearCaches()

void Digikam::ItemDelegate::clearCaches | ( |  | ) |
| override protected virtual

Reimplemented from Digikam::DItemDelegate.

## ◆ imageInformationRect()

QRect Digikam::ItemDelegate::imageInformationRect | ( |  | ) | const
| override virtual

The image information is textual or graphical information, but not the pixmap. The ratingRect() will e.g. typically be contained in this area.

Reimplemented from Digikam::ItemViewDelegate.

## ◆ invalidatePaintingCache()

void Digikam::ItemDelegate::invalidatePaintingCache | ( |  | ) |
| override protected virtual

Reimplemented from Digikam::ItemViewDelegate.

## ◆ paint()

void Digikam::ItemDelegate::paint | ( | QPainter * | painter,
|  | const QStyleOptionViewItem & | option,
|  | const QModelIndex & | index
| ) |  | const
| override

Rules to show grouped items when a group is open. The idea is to use the mouse over rectangle highlightment to surround all items from a group.

## ◆ pixmapForDrag()

QPixmap Digikam::ItemDelegate::pixmapForDrag | ( | const QStyleOptionViewItem & | option,
|  | const QList< QModelIndex > & | indexes
| ) |  | const
| override virtual

Implements Digikam::DItemDelegate.

## ◆ pixmapRect()

QRect Digikam::ItemDelegate::pixmapRect | ( |  | ) | const
| override virtual

Reimplemented from Digikam::ItemViewDelegate.

## ◆ setDefaultViewOptions()

void Digikam::ItemDelegate::setDefaultViewOptions | ( | const QStyleOptionViewItem & | option | ) |
| override virtual

option.rect shall be the viewport rectangle. Call on resize, font change.

Implements Digikam::DItemDelegate.

Reimplemented in Digikam::ItemThumbnailDelegate.

## ◆ setSpacing()

void Digikam::ItemDelegate::setSpacing | ( | int | spacing | ) |
| override virtual

Implements Digikam::DItemDelegate.

## ◆ updateContentWidth()

void Digikam::ItemDelegate::updateContentWidth | ( |  | ) |
| protected virtual

This is the maximum width of all content rectangles, typically excluding margins on both sides.

Reimplemented in Digikam::ItemThumbnailDelegate.

## ◆ updateRects()

virtual void Digikam::ItemDelegate::updateRects | ( |  | ) |
| protected pure virtual

The paint() method operates depending on these rects.

Implemented in Digikam::DigikamItemDelegate, Digikam::ItemFaceDelegate, and Digikam::ItemThumbnailDelegate.

## ◆ updateSizeRectsAndPixmaps()

void Digikam::ItemDelegate::updateSizeRectsAndPixmaps | ( |  | ) |
| override protected virtual

Implements Digikam::ItemViewDelegate.