digiKam
Digikam::ItemViewImportDelegate Class Referenceabstract

NOTE: Some reuse of the existing model-view classes. More...

+ Inheritance diagram for Digikam::ItemViewImportDelegate:

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
 
QSize gridSize () const override
 
virtual QRect imageInformationRect () const
 
void installOverlay (ItemDelegateOverlay *overlay)
 
 ItemViewImportDelegate (QObject *const parent=nullptr)
 
void mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index) override
 
QList< ItemDelegateOverlay * > overlays () const
 
virtual QPixmap pixmapForDrag (const QStyleOptionViewItem &option, const QList< QModelIndex > &indexes) const =0
 
virtual QRect pixmapRect () const
 
virtual QRect ratingRect () const
 
QRect rect () const
 
void removeAllOverlays ()
 
void removeOverlay (ItemDelegateOverlay *overlay)
 
void setAllOverlaysActive (bool active)
 
void setDefaultViewOptions (const QStyleOptionViewItem &option) override
 
void setRatingEdited (const QModelIndex &index)
 
void setSpacing (int spacing) override
 
void setThumbnailSize (const ThumbnailSize &thumbSize) override
 reimplemented from DItemDelegate More...
 
void setViewOnAllOverlays (QAbstractItemView *view)
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
int spacing () const
 
ThumbnailSize thumbnailSize () const
 
 ~ItemViewImportDelegate () 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 QString squeezedText (const QFontMetrics &fm, int width, const QString &text)
 

Protected Slots

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

Protected Member Functions

QAbstractItemDelegate * asDelegate () override
 Returns the delegate, typically, the derived class. More...
 
virtual void clearCaches ()
 
void drawColorLabelRect (QPainter *p, const QStyleOptionViewItem &option, bool isSelected, int colorId) const
 
void drawCreationDate (QPainter *p, const QRect &dateRect, const QDateTime &date) const
 
void drawDownloadIndicator (QPainter *p, const QRect &r, int itemType) 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 drawGroupIndicator (QPainter *p, const QRect &r, int numberOfGroupedImages, bool open) const
 
void drawImageFormat (QPainter *p, const QRect &dimsRect, const QString &mime) const
 
void drawImageSize (QPainter *p, const QRect &dimsRect, const QSize &dims) const
 
void drawLockIndicator (QPainter *p, const QRect &r, int lockStatus) 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
 
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 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) const
 Use the tool methods for painting in subclasses. More...
 
virtual void invalidatePaintingCache ()
 reimplement these in subclasses More...
 
 ItemViewImportDelegate (ItemViewImportDelegatePrivate &dd, QObject *const parent)
 
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. More...
 
QString squeezedTextCached (QPainter *const p, int width, const QString &text) const
 
QPixmap thumbnailBorderPixmap (const QSize &pixSize, bool isGrouped=false) const
 
virtual void updateSizeRectsAndPixmaps ()=0
 

Protected Attributes

ItemViewImportDelegatePrivate *const d_ptr
 
QList< ItemDelegateOverlay * > m_overlays
 

Detailed Description

NOTE: Some reuse of the existing model-view classes.

Constructor & Destructor Documentation

◆ ItemViewImportDelegate() [1/2]

Digikam::ItemViewImportDelegate::ItemViewImportDelegate ( QObject *const  parent = nullptr)
explicit

◆ ~ItemViewImportDelegate()

Digikam::ItemViewImportDelegate::~ItemViewImportDelegate ( )
override

◆ ItemViewImportDelegate() [2/2]

Digikam::ItemViewImportDelegate::ItemViewImportDelegate ( ItemViewImportDelegatePrivate dd,
QObject *const  parent 
)
protected

Member Function Documentation

◆ acceptsActivation()

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

◆ acceptsToolTip()

bool Digikam::ItemViewImportDelegate::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.

◆ asDelegate()

QAbstractItemDelegate * Digikam::ItemViewImportDelegate::asDelegate ( )
overrideprotectedvirtual

Returns the delegate, typically, the derived class.

Implements Digikam::ItemDelegateOverlayContainer.

◆ clearCaches()

◆ dateToString()

QString Digikam::DItemDelegate::dateToString ( const QDateTime &  datetime)
staticinherited

◆ drawColorLabelRect()

void Digikam::ItemViewImportDelegate::drawColorLabelRect ( QPainter *  p,
const QStyleOptionViewItem &  option,
bool  isSelected,
int  colorId 
) const
protected

◆ drawCreationDate()

void Digikam::ItemViewImportDelegate::drawCreationDate ( QPainter *  p,
const QRect &  dateRect,
const QDateTime &  date 
) const
protected

◆ drawDownloadIndicator()

void Digikam::ItemViewImportDelegate::drawDownloadIndicator ( QPainter *  p,
const QRect &  r,
int  itemType 
) const
protected

◆ drawFileSize()

void Digikam::ItemViewImportDelegate::drawFileSize ( QPainter *  p,
const QRect &  r,
qlonglong  bytes 
) const
protected

◆ drawFocusRect()

void Digikam::ItemViewImportDelegate::drawFocusRect ( QPainter *  p,
const QStyleOptionViewItem &  option,
bool  isSelected 
) const
protected

◆ drawGeolocationIndicator()

void Digikam::ItemViewImportDelegate::drawGeolocationIndicator ( QPainter *  p,
const QRect &  r 
) const
protected

◆ drawGroupIndicator()

void Digikam::ItemViewImportDelegate::drawGroupIndicator ( QPainter *  p,
const QRect &  r,
int  numberOfGroupedImages,
bool  open 
) const
protected

◆ drawImageFormat()

void Digikam::ItemViewImportDelegate::drawImageFormat ( QPainter *  p,
const QRect &  dimsRect,
const QString &  mime 
) const
protected

◆ drawImageSize()

void Digikam::ItemViewImportDelegate::drawImageSize ( QPainter *  p,
const QRect &  dimsRect,
const QSize &  dims 
) const
protected

◆ drawLockIndicator()

void Digikam::ItemViewImportDelegate::drawLockIndicator ( QPainter *  p,
const QRect &  r,
int  lockStatus 
) const
protected

◆ drawMouseOverRect()

void Digikam::ItemViewImportDelegate::drawMouseOverRect ( QPainter *  p,
const QStyleOptionViewItem &  option 
) const
protected

◆ drawName()

void Digikam::ItemViewImportDelegate::drawName ( QPainter *  p,
const QRect &  nameRect,
const QString &  name 
) const
protected

◆ drawOverlays()

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

◆ drawPickLabelIcon()

void Digikam::ItemViewImportDelegate::drawPickLabelIcon ( QPainter *  p,
const QRect &  r,
int  pickLabel 
) const
protected

◆ drawRating()

void Digikam::ItemViewImportDelegate::drawRating ( QPainter *  p,
const QModelIndex &  index,
const QRect &  ratingRect,
int  rating,
bool  isSelected 
) const
protected

◆ drawTags()

void Digikam::ItemViewImportDelegate::drawTags ( QPainter *  p,
const QRect &  r,
const QString &  tagsString,
bool  isSelected 
) const
protected

◆ drawThumbnail()

QRect Digikam::ItemViewImportDelegate::drawThumbnail ( QPainter *  p,
const QRect &  thumbRect,
const QPixmap &  background,
const QPixmap &  thumbnail 
) const
protected

Use the tool methods for painting in subclasses.

References Digikam::DItemDelegate::thumbnailBorderPixmap().

Referenced by Digikam::ImportDelegate::paint().

◆ gridSize()

QSize Digikam::ItemViewImportDelegate::gridSize ( ) const
overridevirtual

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

Implements Digikam::DItemDelegate.

Referenced by Digikam::ImportDelegate::calculatethumbSizeToFit().

◆ gridSizeChanged

void Digikam::DItemDelegate::gridSizeChanged ( const QSize &  newSize)
signalinherited

◆ hideNotification

void Digikam::ItemViewImportDelegate::hideNotification ( )
signal

◆ imageInformationRect()

QRect Digikam::ItemViewImportDelegate::imageInformationRect ( ) const
virtual

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 in Digikam::ImportDelegate.

◆ installOverlay()

◆ invalidatePaintingCache()

void Digikam::ItemViewImportDelegate::invalidatePaintingCache ( )
protectedvirtual

◆ makeDragPixmap()

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

◆ mouseMoved()

void Digikam::ItemViewImportDelegate::mouseMoved ( QMouseEvent *  e,
const QRect &  visualRect,
const QModelIndex &  index 
)
overridevirtual

◆ overlayDestroyed

void Digikam::ItemViewImportDelegate::overlayDestroyed ( QObject *  o)
overrideprotectedslot

◆ overlays()

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

◆ pixmapForDrag()

virtual QPixmap Digikam::DItemDelegate::pixmapForDrag ( const QStyleOptionViewItem &  option,
const QList< QModelIndex > &  indexes 
) const
pure virtualinherited

◆ pixmapRect()

QRect Digikam::ItemViewImportDelegate::pixmapRect ( ) const
virtual

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

Reimplemented in Digikam::ImportDelegate.

◆ prepareBackground()

void Digikam::ItemViewImportDelegate::prepareBackground ( )
protected

◆ prepareFonts()

void Digikam::ItemViewImportDelegate::prepareFonts ( )
protected

◆ prepareMetrics()

void Digikam::ItemViewImportDelegate::prepareMetrics ( int  maxWidth)
protected

◆ prepareRatingPixmaps()

void Digikam::ItemViewImportDelegate::prepareRatingPixmaps ( bool  composeOverBackground = true)
protected

Please call this method after prepareBackground() and when d->ratingPixmap is set

Referenced by Digikam::ImportDelegate::updateSizeRectsAndPixmaps().

◆ ratingPixmap()

QPixmap Digikam::ItemViewImportDelegate::ratingPixmap ( int  rating,
bool  selected 
) const
protected

Returns the relevant pixmap from the cached rating pixmaps.

Referenced by drawRating().

◆ ratingRect()

QRect Digikam::ItemViewImportDelegate::ratingRect ( ) const
virtual

Returns the rectangle where the rating is drawn, or a null rectangle if not supported.

Referenced by drawRating().

◆ rect()

QRect Digikam::ItemViewImportDelegate::rect ( ) const

◆ removeAllOverlays()

◆ removeOverlay()

◆ requestNotification

void Digikam::ItemViewImportDelegate::requestNotification ( const QModelIndex &  index,
const QString &  message 
)
signal

◆ setAllOverlaysActive()

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

◆ setDefaultViewOptions()

void Digikam::ItemViewImportDelegate::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.

References invalidatePaintingCache().

Referenced by Digikam::ImportDelegate::setDefaultViewOptions().

◆ setRatingEdited()

void Digikam::ItemViewImportDelegate::setRatingEdited ( const QModelIndex &  index)

Can be used to temporarily disable drawing of the rating. Call with QModelIndex() afterwards.

◆ setSpacing()

void Digikam::ItemViewImportDelegate::setSpacing ( int  spacing)
overridevirtual

◆ setThumbnailSize()

void Digikam::ItemViewImportDelegate::setThumbnailSize ( const ThumbnailSize thumbSize)
overridevirtual

◆ setViewOnAllOverlays()

◆ sizeHint()

QSize Digikam::ItemViewImportDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ slotSetupChanged

void Digikam::ItemViewImportDelegate::slotSetupChanged ( )
protectedslot

◆ slotThemeChanged

void Digikam::ItemViewImportDelegate::slotThemeChanged ( )
protectedslot

◆ 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

◆ thumbnailSize()

ThumbnailSize Digikam::ItemViewImportDelegate::thumbnailSize ( ) const

◆ updateSizeRectsAndPixmaps()

virtual void Digikam::ItemViewImportDelegate::updateSizeRectsAndPixmaps ( )
protectedpure virtual

Implemented in Digikam::ImportDelegate.

Referenced by invalidatePaintingCache().

◆ visualChange

Member Data Documentation

◆ d_ptr

ItemViewImportDelegatePrivate* const Digikam::ItemViewImportDelegate::d_ptr
protected

Referenced by ItemViewImportDelegate().

◆ m_overlays


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