digiKam
ShowFoto::ShowfotoNormalDelegate Class Reference
+ Inheritance diagram for ShowFoto::ShowfotoNormalDelegate:

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)
 
 ShowfotoNormalDelegate (ShowfotoThumbnailBar *const bar, QObject *const parent=nullptr)
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
int spacing () const
 
ThumbnailSize thumbnailSize () const
 
 ~ShowfotoNormalDelegate () 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)
 
 ShowfotoNormalDelegate (ShowfotoNormalDelegatePrivate &dd, ShowfotoThumbnailBar *const bar, QObject *const parent=nullptr)
 
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 ()
 
void updateRects () override
 
void updateSizeRectsAndPixmaps () override
 

Protected Attributes

ShowfotoItemViewDelegatePrivate *const d_ptr
 
QList< ItemDelegateOverlay * > m_overlays
 

Constructor & Destructor Documentation

◆ ShowfotoNormalDelegate() [1/2]

ShowFoto::ShowfotoNormalDelegate::ShowfotoNormalDelegate ( ShowfotoThumbnailBar *const  bar,
QObject *const  parent = nullptr 
)
explicit

◆ ~ShowfotoNormalDelegate()

ShowFoto::ShowfotoNormalDelegate::~ShowfotoNormalDelegate ( )
override

◆ ShowfotoNormalDelegate() [2/2]

ShowFoto::ShowfotoNormalDelegate::ShowfotoNormalDelegate ( ShowfotoNormalDelegatePrivate dd,
ShowfotoThumbnailBar *const  bar,
QObject *const  parent = nullptr 
)
protected

Member Function Documentation

◆ acceptsActivation()

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

◆ acceptsToolTip()

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

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 ShowFoto::ShowfotoDelegate::onActualPixmapRect().

◆ actualPixmapRect()

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

◆ asDelegate()

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

Returns the delegate, typically, the derived class.

Implements Digikam::ItemDelegateOverlayContainer.

◆ calculatethumbSizeToFit()

◆ clearCaches()

void ShowFoto::ShowfotoDelegate::clearCaches ( )
overrideprotectedvirtualinherited

◆ clearModelDataCaches()

void ShowFoto::ShowfotoDelegate::clearModelDataCaches ( )
protectedvirtualinherited

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 ShowFoto::ShowfotoDelegate::modelChanged(), and ShowFoto::ShowfotoDelegate::modelContentsChanged().

◆ coordinatesIndicatorRect()

QRect ShowFoto::ShowfotoDelegate::coordinatesIndicatorRect ( ) const
inherited

◆ dateToString()

◆ drawCreationDate()

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

◆ drawFileSize()

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

◆ drawFocusRect()

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

◆ drawGeolocationIndicator()

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

◆ drawImageFormat()

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

◆ 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

◆ drawName()

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

◆ 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 ShowFoto::ShowfotoDelegate::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 ShowFoto::ShowfotoDelegate::calculatethumbSizeToFit().

◆ gridSizeChanged

◆ groupIndicatorRect()

QRect ShowFoto::ShowfotoDelegate::groupIndicatorRect ( ) const
inherited

◆ hideNotification

void ShowFoto::ShowfotoItemViewDelegate::hideNotification ( )
signalinherited

◆ imageInformationRect()

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

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

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

◆ modelContentsChanged

void ShowFoto::ShowfotoDelegate::modelContentsChanged ( )
protectedslotinherited

◆ 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
protectedinherited

◆ 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
overridevirtualinherited

◆ pixmapRect()

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

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 
)
staticinherited

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 ShowFoto::ShowfotoDelegate::thumbnailPixmap().

◆ setAllOverlaysActive()

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

◆ setDefaultViewOptions()

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

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)
protectedinherited

◆ setSpacing()

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

◆ setThumbnailSize()

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

◆ setView()

◆ setViewOnAllOverlays()

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

◆ 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
protectedvirtualinherited

◆ thumbnailSize()

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

◆ updateActualPixmapRect()

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

◆ updateContentWidth()

void ShowFoto::ShowfotoDelegate::updateContentWidth ( )
protectedvirtualinherited

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 ShowFoto::ShowfotoDelegate::updateSizeRectsAndPixmaps().

◆ updateRects()

void ShowFoto::ShowfotoNormalDelegate::updateRects ( )
overrideprotectedvirtual

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

Implements ShowFoto::ShowfotoDelegate.

◆ 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: