digiKam
ShowFoto::ShowfotoDelegate Class Referenceabstract
+ Inheritance diagram for ShowFoto::ShowfotoDelegate:

Classes

class  ShowfotoDelegatePrivate
 

Signals

void gridSizeChanged (const QSize &newSize)
 
void hideNotification ()
 
void requestNotification (const QModelIndex &index, const QString &message)
 
void visualChange ()
 

Public Member Functions

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
 
QRect actualPixmapRect (const QModelIndex &index) const
 
int calculatethumbSizeToFit (int ws)
 
QRect coordinatesIndicatorRect () const
 
QSize gridSize () const override
 
QRect groupIndicatorRect () const
 
QRect imageInformationRect () const override
 
void installOverlay (ItemDelegateOverlay *overlay)
 
void mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index) override
 
QList< ItemDelegateOverlay * > overlays () const
 
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
 
QRect rect () const
 
void removeAllOverlays ()
 
void removeOverlay (ItemDelegateOverlay *overlay)
 
void setAllOverlaysActive (bool active)
 
void setDefaultViewOptions (const QStyleOptionViewItem &option) override
 
void setSpacing (int spacing) override
 
void setThumbnailSize (const ThumbnailSize &thumbSize) override
 reimplemented from DItemDelegate More...
 
void setView (ShowfotoThumbnailBar *view)
 
void setViewOnAllOverlays (QAbstractItemView *view)
 
 ShowfotoDelegate (QObject *const parent=nullptr)
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
int spacing () const
 
ThumbnailSize thumbnailSize () const
 
 ~ShowfotoDelegate () override
 

Static Public Member Functions

static QString dateToString (const QDateTime &datetime)
 
static QPixmap makeDragPixmap (const QStyleOptionViewItem &option, const QList< QModelIndex > &indexes, const QPixmap &suggestedPixmap=QPixmap())
 
static QPixmap retrieveThumbnailPixmap (const QModelIndex &index, int thumbnailSize)
 
static QString squeezedText (const QFontMetrics &fm, int width, const QString &text)
 

Protected Slots

void modelChanged ()
 
void modelContentsChanged ()
 
void overlayDestroyed (QObject *o) override
 
void slotSetupChanged ()
 
void slotThemeChanged ()
 

Protected Member Functions

QAbstractItemDelegate * asDelegate () override
 Returns the delegate, typically, the derived class. More...
 
void clearCaches () override
 
virtual void clearModelDataCaches ()
 
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 drawImageFormat (QPainter *p, const QRect &dimsRect, const QString &mime) const
 
void drawImageSize (QPainter *p, const QRect &dimsRect, const QSize &dims) const
 
void drawMouseOverRect (QPainter *p, const QStyleOptionViewItem &option) const
 
void drawName (QPainter *p, const QRect &nameRect, const QString &name) const
 
virtual void drawOverlays (QPainter *p, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
QRect drawThumbnail (QPainter *p, const QRect &thumbRect, const QPixmap &background, const QPixmap &thumbnail) const
 Use the tool methods for painting in subclasses. More...
 
void invalidatePaintingCache () override
 reimplement these in subclasses More...
 
bool onActualPixmapRect (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *actualRect) const
 
void prepareBackground ()
 
void prepareFonts ()
 
void prepareMetrics (int maxWidth)
 
void setModel (QAbstractItemModel *model)
 
 ShowfotoDelegate (ShowfotoDelegate::ShowfotoDelegatePrivate &dd, QObject *const parent)
 
QString squeezedTextCached (QPainter *const p, int width, const QString &text) const
 
QPixmap thumbnailBorderPixmap (const QSize &pixSize, bool isGrouped=false) const
 
virtual QPixmap thumbnailPixmap (const QModelIndex &index) const
 
void updateActualPixmapRect (const QModelIndex &index, const QRect &rect)
 
virtual void updateContentWidth ()
 
virtual void updateRects ()=0
 
void updateSizeRectsAndPixmaps () override
 

Protected Attributes

ShowfotoItemViewDelegatePrivate *const d_ptr
 
QList< ItemDelegateOverlay * > m_overlays
 

Constructor & Destructor Documentation

◆ ShowfotoDelegate() [1/2]

ShowFoto::ShowfotoDelegate::ShowfotoDelegate ( QObject *const  parent = nullptr)
explicit

◆ ~ShowfotoDelegate()

ShowFoto::ShowfotoDelegate::~ShowfotoDelegate ( )
override

◆ ShowfotoDelegate() [2/2]

ShowFoto::ShowfotoDelegate::ShowfotoDelegate ( ShowfotoDelegate::ShowfotoDelegatePrivate dd,
QObject *const  parent 
)
protected

Member Function Documentation

◆ acceptsActivation()

bool ShowFoto::ShowfotoDelegate::acceptsActivation ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  activationRect = nullptr 
) const
overridevirtual

◆ acceptsToolTip()

bool ShowFoto::ShowfotoDelegate::acceptsToolTip ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  tooltipRect = nullptr 
) const
overridevirtual

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.

Implements Digikam::DItemDelegate.

References onActualPixmapRect().

◆ actualPixmapRect()

QRect ShowFoto::ShowfotoDelegate::actualPixmapRect ( const QModelIndex &  index) const

◆ asDelegate()

QAbstractItemDelegate * ShowFoto::ShowfotoItemViewDelegate::asDelegate ( )
overrideprotectedvirtualinherited

Returns the delegate, typically, the derived class.

Implements Digikam::ItemDelegateOverlayContainer.

◆ calculatethumbSizeToFit()

◆ clearCaches()

void ShowFoto::ShowfotoDelegate::clearCaches ( )
overrideprotectedvirtual

◆ clearModelDataCaches()

void ShowFoto::ShowfotoDelegate::clearModelDataCaches ( )
protectedvirtual

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.

Referenced by modelChanged(), and modelContentsChanged().

◆ coordinatesIndicatorRect()

QRect ShowFoto::ShowfotoDelegate::coordinatesIndicatorRect ( ) const

◆ dateToString()

◆ drawCreationDate()

void ShowFoto::ShowfotoItemViewDelegate::drawCreationDate ( QPainter *  p,
const QRect &  dateRect,
const QDateTime &  date 
) const
protectedinherited

References Digikam::DItemDelegate::dateToString().

Referenced by paint().

◆ drawFileSize()

void ShowFoto::ShowfotoItemViewDelegate::drawFileSize ( QPainter *  p,
const QRect &  r,
qlonglong  bytes 
) const
protectedinherited

Referenced by paint().

◆ drawFocusRect()

void ShowFoto::ShowfotoItemViewDelegate::drawFocusRect ( QPainter *  p,
const QStyleOptionViewItem &  option,
bool  isSelected 
) const
protectedinherited

Referenced by paint().

◆ drawGeolocationIndicator()

void ShowFoto::ShowfotoItemViewDelegate::drawGeolocationIndicator ( QPainter *  p,
const QRect &  r 
) const
protectedinherited

Referenced by paint().

◆ drawImageFormat()

void ShowFoto::ShowfotoItemViewDelegate::drawImageFormat ( QPainter *  p,
const QRect &  dimsRect,
const QString &  mime 
) const
protectedinherited

Referenced by paint().

◆ drawImageSize()

void ShowFoto::ShowfotoItemViewDelegate::drawImageSize ( QPainter *  p,
const QRect &  dimsRect,
const QSize &  dims 
) const
protectedinherited

◆ drawMouseOverRect()

void ShowFoto::ShowfotoItemViewDelegate::drawMouseOverRect ( QPainter *  p,
const QStyleOptionViewItem &  option 
) const
protectedinherited

Referenced by paint().

◆ drawName()

void ShowFoto::ShowfotoItemViewDelegate::drawName ( QPainter *  p,
const QRect &  nameRect,
const QString &  name 
) const
protectedinherited

Referenced by paint().

◆ drawOverlays()

void Digikam::ItemDelegateOverlayContainer::drawOverlays ( QPainter *  p,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protectedvirtualinherited

◆ drawThumbnail()

QRect ShowFoto::ShowfotoItemViewDelegate::drawThumbnail ( QPainter *  p,
const QRect &  thumbRect,
const QPixmap &  background,
const QPixmap &  thumbnail 
) const
protectedinherited

Use the tool methods for painting in subclasses.

References Digikam::DItemDelegate::thumbnailBorderPixmap().

Referenced by paint().

◆ gridSize()

QSize ShowFoto::ShowfotoItemViewDelegate::gridSize ( ) const
overridevirtualinherited

Returns the gridsize to be set by the view. It's sizeHint plus spacing.

Implements Digikam::DItemDelegate.

Referenced by calculatethumbSizeToFit().

◆ gridSizeChanged

◆ groupIndicatorRect()

QRect ShowFoto::ShowfotoDelegate::groupIndicatorRect ( ) const

◆ hideNotification

void ShowFoto::ShowfotoItemViewDelegate::hideNotification ( )
signalinherited

◆ imageInformationRect()

QRect ShowFoto::ShowfotoDelegate::imageInformationRect ( ) const
overridevirtual

Returns the area where the image information is drawn, or null if empty / not supported. 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 ShowFoto::ShowfotoItemViewDelegate.

◆ installOverlay()

◆ invalidatePaintingCache()

void ShowFoto::ShowfotoDelegate::invalidatePaintingCache ( )
overrideprotectedvirtual

reimplement these in subclasses

Reimplemented from ShowFoto::ShowfotoItemViewDelegate.

References ShowFoto::ShowfotoItemViewDelegate::invalidatePaintingCache().

◆ makeDragPixmap()

QPixmap Digikam::DItemDelegate::makeDragPixmap ( const QStyleOptionViewItem &  option,
const QList< QModelIndex > &  indexes,
const QPixmap &  suggestedPixmap = QPixmap() 
)
staticinherited

◆ modelChanged

void ShowFoto::ShowfotoDelegate::modelChanged ( )
protectedslot

References clearModelDataCaches(), and setModel().

Referenced by setView().

◆ modelContentsChanged

void ShowFoto::ShowfotoDelegate::modelContentsChanged ( )
protectedslot

References clearModelDataCaches().

Referenced by setModel().

◆ mouseMoved()

void ShowFoto::ShowfotoItemViewDelegate::mouseMoved ( QMouseEvent *  e,
const QRect &  visualRect,
const QModelIndex &  index 
)
overridevirtualinherited

NOTE: to be called by ItemViewCategorized only

Implements Digikam::DItemDelegate.

◆ onActualPixmapRect()

bool ShowFoto::ShowfotoDelegate::onActualPixmapRect ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  actualRect 
) const
protected

References actualPixmapRect().

Referenced by acceptsActivation(), and acceptsToolTip().

◆ overlayDestroyed

void ShowFoto::ShowfotoItemViewDelegate::overlayDestroyed ( QObject *  o)
overrideprotectedslotinherited

◆ overlays()

QList< ItemDelegateOverlay * > Digikam::ItemDelegateOverlayContainer::overlays ( ) const
inherited

◆ paint()

◆ pixmapForDrag()

QPixmap ShowFoto::ShowfotoDelegate::pixmapForDrag ( const QStyleOptionViewItem &  option,
const QList< QModelIndex > &  indexes 
) const
overridevirtual

◆ pixmapRect()

QRect ShowFoto::ShowfotoDelegate::pixmapRect ( ) const
overridevirtual

Returns the area where the pixmap is drawn, or null if not supported

Reimplemented from ShowFoto::ShowfotoItemViewDelegate.

◆ prepareBackground()

void ShowFoto::ShowfotoItemViewDelegate::prepareBackground ( )
protectedinherited

◆ prepareFonts()

void ShowFoto::ShowfotoItemViewDelegate::prepareFonts ( )
protectedinherited

◆ prepareMetrics()

void ShowFoto::ShowfotoItemViewDelegate::prepareMetrics ( int  maxWidth)
protectedinherited

◆ rect()

QRect ShowFoto::ShowfotoItemViewDelegate::rect ( ) const
inherited

◆ removeAllOverlays()

◆ removeOverlay()

◆ requestNotification

void ShowFoto::ShowfotoItemViewDelegate::requestNotification ( const QModelIndex &  index,
const QString &  message 
)
signalinherited

◆ retrieveThumbnailPixmap()

QPixmap ShowFoto::ShowfotoDelegate::retrieveThumbnailPixmap ( const QModelIndex &  index,
int  thumbnailSize 
)
static

Retrieve the thumbnail pixmap in given size for the ShowfotoItemModel::ThumbnailRole for the given index from the given index, which must adhere to ShowfotoThumbnailModel semantics.

References ShowFoto::ShowfotoItemModel::ThumbnailRole, and ShowFoto::ShowfotoItemViewDelegate::thumbnailSize().

Referenced by thumbnailPixmap().

◆ setAllOverlaysActive()

void Digikam::ItemDelegateOverlayContainer::setAllOverlaysActive ( bool  active)
inherited

◆ setDefaultViewOptions()

void ShowFoto::ShowfotoDelegate::setDefaultViewOptions ( const QStyleOptionViewItem &  option)
overridevirtual

Style option with standard values to use for cached rendering. option.rect shall be the viewport rectangle. Call on resize, font change.

Implements Digikam::DItemDelegate.

Reimplemented in ShowFoto::ShowfotoThumbnailDelegate.

References ShowFoto::ShowfotoItemViewDelegate::setDefaultViewOptions().

Referenced by ShowFoto::ShowfotoThumbnailDelegate::setDefaultViewOptions().

◆ setModel()

void ShowFoto::ShowfotoDelegate::setModel ( QAbstractItemModel *  model)
protected

References modelContentsChanged().

Referenced by modelChanged(), and setView().

◆ setSpacing()

void ShowFoto::ShowfotoDelegate::setSpacing ( int  spacing)
overridevirtual

◆ setThumbnailSize()

void ShowFoto::ShowfotoItemViewDelegate::setThumbnailSize ( const ThumbnailSize thumbSize)
overridevirtualinherited

◆ setView()

void ShowFoto::ShowfotoDelegate::setView ( ShowfotoThumbnailBar view)

◆ setViewOnAllOverlays()

void Digikam::ItemDelegateOverlayContainer::setViewOnAllOverlays ( QAbstractItemView *  view)
inherited

◆ sizeHint()

QSize ShowFoto::ShowfotoItemViewDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overrideinherited

◆ slotSetupChanged

void ShowFoto::ShowfotoItemViewDelegate::slotSetupChanged ( )
protectedslotinherited

◆ slotThemeChanged

void ShowFoto::ShowfotoItemViewDelegate::slotThemeChanged ( )
protectedslotinherited

◆ spacing()

int ShowFoto::ShowfotoItemViewDelegate::spacing ( ) const
inherited

◆ squeezedText()

QString Digikam::DItemDelegate::squeezedText ( const QFontMetrics &  fm,
int  width,
const QString &  text 
)
staticinherited

◆ squeezedTextCached()

QString Digikam::DItemDelegate::squeezedTextCached ( QPainter *const  p,
int  width,
const QString &  text 
) const
protectedinherited

◆ thumbnailBorderPixmap()

QPixmap Digikam::DItemDelegate::thumbnailBorderPixmap ( const QSize &  pixSize,
bool  isGrouped = false 
) const
protectedinherited

◆ thumbnailPixmap()

QPixmap ShowFoto::ShowfotoDelegate::thumbnailPixmap ( const QModelIndex &  index) const
protectedvirtual

References retrieveThumbnailPixmap().

Referenced by paint(), and pixmapForDrag().

◆ thumbnailSize()

ThumbnailSize ShowFoto::ShowfotoItemViewDelegate::thumbnailSize ( ) const
inherited

◆ updateActualPixmapRect()

void ShowFoto::ShowfotoDelegate::updateActualPixmapRect ( const QModelIndex &  index,
const QRect &  rect 
)
protected

◆ updateContentWidth()

void ShowFoto::ShowfotoDelegate::updateContentWidth ( )
protectedvirtual

Reimplement this to set contentWidth. This is the maximum width of all content rectangles, typically excluding margins on both sides.

Reimplemented in ShowFoto::ShowfotoThumbnailDelegate.

Referenced by ShowFoto::ShowfotoThumbnailDelegate::updateContentWidth(), and updateSizeRectsAndPixmaps().

◆ updateRects()

virtual void ShowFoto::ShowfotoDelegate::updateRects ( )
protectedpure virtual

In a subclass, you need to implement this method to set up the rects for drawing. The paint() method operates depending on these rects.

Implemented in ShowFoto::ShowfotoNormalDelegate, and ShowFoto::ShowfotoThumbnailDelegate.

Referenced by updateSizeRectsAndPixmaps().

◆ updateSizeRectsAndPixmaps()

◆ visualChange

Member Data Documentation

◆ d_ptr

ShowfotoItemViewDelegatePrivate* const ShowFoto::ShowfotoItemViewDelegate::d_ptr
protectedinherited

◆ m_overlays


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