digiKam
Digikam::ImportThumbnailDelegate Class Reference
+ Inheritance diagram for Digikam::ImportThumbnailDelegate:

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) 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)
 
ImportCategoryDrawercategoryDrawer () const
 
QRect coordinatesIndicatorRect () const
 
QRect downloadIndicatorRect () const
 
QSize gridSize () const override
 
QRect groupIndicatorRect () const
 
QRect imageInformationRect () const override
 
 ImportThumbnailDelegate (ImportCategorizedView *const parent)
 
void installOverlay (ItemDelegateOverlay *overlay)
 
QRect lockIndicatorRect () const
 
int maximumSize () const
 
int minimumSize () const
 
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
 
virtual QRect ratingRect () const
 
QRect rect () const
 
void removeAllOverlays ()
 
void removeOverlay (ItemDelegateOverlay *overlay)
 
void setAllOverlaysActive (bool active)
 
void setDefaultViewOptions (const QStyleOptionViewItem &option) override
 
void setFlow (QListView::Flow flow)
 
void setRatingEdited (const QModelIndex &index)
 
void setSpacing (int spacing) override
 
void setThumbnailSize (const ThumbnailSize &thumbSize) override
 reimplemented from DItemDelegate More...
 
void setView (ImportCategorizedView *view)
 
void setViewOnAllOverlays (QAbstractItemView *view)
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
int spacing () const
 
QRect tagsRect () const
 
ThumbnailSize thumbnailSize () const
 
 ~ImportThumbnailDelegate () 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 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...
 
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 prepareRatingPixmaps (bool composeOverBackground=true)
 
QPixmap ratingPixmap (int rating, bool selected) const
 Returns the relevant pixmap from the cached rating pixmaps. More...
 
void setModel (QAbstractItemModel *model)
 
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
 
int thumbnailPixmapSize (bool withHighlight, int size)
 
void updateActualPixmapRect (const QModelIndex &index, const QRect &rect)
 
void updateContentWidth () override
 
void updateRects () override
 
void updateSizeRectsAndPixmaps () override
 

Protected Attributes

ItemViewImportDelegatePrivate *const d_ptr
 
QList< ItemDelegateOverlay * > m_overlays
 

Constructor & Destructor Documentation

◆ ImportThumbnailDelegate()

Digikam::ImportThumbnailDelegate::ImportThumbnailDelegate ( ImportCategorizedView *const  parent)
explicit

◆ ~ImportThumbnailDelegate()

Digikam::ImportThumbnailDelegate::~ImportThumbnailDelegate ( )
override

Member Function Documentation

◆ acceptsActivation()

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

◆ acceptsToolTip()

bool Digikam::ImportDelegate::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 Digikam::ImportDelegate::onActualPixmapRect().

◆ actualPixmapRect()

QRect Digikam::ImportDelegate::actualPixmapRect ( const QModelIndex &  index) const
inherited

◆ asDelegate()

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

Returns the delegate, typically, the derived class.

Implements Digikam::ItemDelegateOverlayContainer.

◆ calculatethumbSizeToFit()

◆ categoryDrawer()

ImportCategoryDrawer * Digikam::ImportDelegate::categoryDrawer ( ) const
inherited

◆ clearCaches()

void Digikam::ImportDelegate::clearCaches ( )
overrideprotectedvirtualinherited

◆ clearModelDataCaches()

void Digikam::ImportDelegate::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 Digikam::ImportDelegate::modelChanged(), and Digikam::ImportDelegate::modelContentsChanged().

◆ coordinatesIndicatorRect()

QRect Digikam::ImportDelegate::coordinatesIndicatorRect ( ) const
inherited

◆ dateToString()

◆ downloadIndicatorRect()

QRect Digikam::ImportDelegate::downloadIndicatorRect ( ) const
inherited

◆ drawColorLabelRect()

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

◆ drawCreationDate()

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

◆ drawDownloadIndicator()

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

◆ drawFileSize()

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

◆ drawFocusRect()

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

◆ drawGeolocationIndicator()

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

◆ drawGroupIndicator()

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

◆ drawImageFormat()

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

◆ drawImageSize()

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

◆ drawLockIndicator()

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

◆ drawMouseOverRect()

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

◆ drawName()

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

◆ drawPickLabelIcon()

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

◆ drawRating()

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

◆ drawTags()

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

◆ drawThumbnail()

QRect Digikam::ItemViewImportDelegate::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 Digikam::ImportDelegate::paint().

◆ gridSize()

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

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

Implements Digikam::DItemDelegate.

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

◆ gridSizeChanged

◆ groupIndicatorRect()

QRect Digikam::ImportDelegate::groupIndicatorRect ( ) const
inherited

◆ hideNotification

void Digikam::ItemViewImportDelegate::hideNotification ( )
signalinherited

◆ imageInformationRect()

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

◆ installOverlay()

◆ invalidatePaintingCache()

void Digikam::ImportDelegate::invalidatePaintingCache ( )
overrideprotectedvirtualinherited

reimplement these in subclasses

Reimplemented from Digikam::ItemViewImportDelegate.

References Digikam::ItemViewImportDelegate::invalidatePaintingCache().

◆ lockIndicatorRect()

QRect Digikam::ImportDelegate::lockIndicatorRect ( ) const
inherited

◆ makeDragPixmap()

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

◆ maximumSize()

int Digikam::ImportThumbnailDelegate::maximumSize ( ) const

Returns the minimum or maximum viewport size in the limiting dimension, width or height, depending on current flow.

References Digikam::ThumbnailSize::maxThumbsSize().

Referenced by Digikam::ImportThumbnailBar::setFlow().

◆ minimumSize()

int Digikam::ImportThumbnailDelegate::minimumSize ( ) const

◆ modelChanged

void Digikam::ImportDelegate::modelChanged ( )
protectedslotinherited

◆ modelContentsChanged

void Digikam::ImportDelegate::modelContentsChanged ( )
protectedslotinherited

◆ mouseMoved()

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

◆ onActualPixmapRect()

bool Digikam::ImportDelegate::onActualPixmapRect ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  actualRect 
) const
protectedinherited

◆ overlayDestroyed

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

◆ overlays()

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

◆ paint()

void Digikam::ImportDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overrideinherited

References Digikam::ImportDelegate::actualPixmapRect(), Digikam::CamItemInfo::colorLabel, Digikam::CamItemInfo::ctime, Digikam::CamItemInfo::downloaded, Digikam::CamItemInfo::downloadName, Digikam::ItemViewImportDelegate::drawColorLabelRect(), Digikam::ItemViewImportDelegate::drawCreationDate(), Digikam::ItemViewImportDelegate::drawDownloadIndicator(), Digikam::ItemViewImportDelegate::drawFileSize(), Digikam::ItemViewImportDelegate::drawFocusRect(), Digikam::ItemViewImportDelegate::drawGeolocationIndicator(), Digikam::ItemViewImportDelegate::drawImageFormat(), Digikam::ItemViewImportDelegate::drawImageSize(), Digikam::ItemViewImportDelegate::drawLockIndicator(), Digikam::ItemViewImportDelegate::drawMouseOverRect(), Digikam::ItemViewImportDelegate::drawName(), Digikam::ItemDelegateOverlayContainer::drawOverlays(), Digikam::ItemViewImportDelegate::drawPickLabelIcon(), Digikam::ItemViewImportDelegate::drawRating(), Digikam::ItemViewImportDelegate::drawTags(), Digikam::ItemViewImportDelegate::drawThumbnail(), Digikam::PhotoInfoContainer::hasCoordinates, Digikam::CamItemInfo::height, Digikam::AlbumManager::instance(), Digikam::CamItemInfo::isNull(), Digikam::CamItemInfo::mime, Digikam::CamItemInfo::photoInfo, Digikam::CamItemInfo::pickLabel, Digikam::CamItemInfo::rating, Digikam::ImportItemModel::retrieveCamItemInfo(), Digikam::CamItemInfo::size, Digikam::CamItemInfo::tagIds, Digikam::AlbumManager::tagNames(), Digikam::ImportDelegate::thumbnailPixmap(), Digikam::ImportDelegate::updateActualPixmapRect(), Digikam::CamItemInfo::width, and Digikam::CamItemInfo::writePermissions.

◆ pixmapForDrag()

QPixmap Digikam::ImportDelegate::pixmapForDrag ( const QStyleOptionViewItem &  option,
const QList< QModelIndex > &  indexes 
) const
overridevirtualinherited

◆ pixmapRect()

QRect Digikam::ImportDelegate::pixmapRect ( ) const
overridevirtualinherited

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

Reimplemented from Digikam::ItemViewImportDelegate.

◆ prepareBackground()

void Digikam::ItemViewImportDelegate::prepareBackground ( )
protectedinherited

◆ prepareFonts()

void Digikam::ItemViewImportDelegate::prepareFonts ( )
protectedinherited

◆ prepareMetrics()

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

◆ prepareRatingPixmaps()

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

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
protectedinherited

Returns the relevant pixmap from the cached rating pixmaps.

Referenced by Digikam::ItemViewImportDelegate::drawRating().

◆ ratingRect()

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

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

Referenced by Digikam::ItemViewImportDelegate::drawRating().

◆ rect()

QRect Digikam::ItemViewImportDelegate::rect ( ) const
inherited

◆ removeAllOverlays()

◆ removeOverlay()

◆ requestNotification

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

◆ retrieveThumbnailPixmap()

QPixmap Digikam::ImportDelegate::retrieveThumbnailPixmap ( const QModelIndex &  index,
int  thumbnailSize 
)
staticinherited

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

References Digikam::ImportItemModel::ThumbnailRole, and Digikam::ItemViewImportDelegate::thumbnailSize().

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

◆ setAllOverlaysActive()

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

◆ setDefaultViewOptions()

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

Reimplemented from Digikam::ImportDelegate.

References Digikam::ImportDelegate::setDefaultViewOptions().

◆ setFlow()

void Digikam::ImportThumbnailDelegate::setFlow ( QListView::Flow  flow)

◆ setModel()

void Digikam::ImportDelegate::setModel ( QAbstractItemModel *  model)
protectedinherited

◆ setRatingEdited()

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

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

◆ setSpacing()

void Digikam::ImportDelegate::setSpacing ( int  spacing)
overridevirtualinherited

◆ setThumbnailSize()

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

◆ setView()

◆ setViewOnAllOverlays()

◆ sizeHint()

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

◆ slotSetupChanged

void Digikam::ItemViewImportDelegate::slotSetupChanged ( )
protectedslotinherited

◆ slotThemeChanged

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

◆ tagsRect()

QRect Digikam::ImportDelegate::tagsRect ( ) const
inherited

◆ thumbnailBorderPixmap()

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

◆ thumbnailPixmap()

QPixmap Digikam::ImportDelegate::thumbnailPixmap ( const QModelIndex &  index) const
protectedvirtualinherited

◆ thumbnailPixmapSize()

int Digikam::ImportThumbnailDelegate::thumbnailPixmapSize ( bool  withHighlight,
int  size 
)
protected

Referenced by updateContentWidth().

◆ thumbnailSize()

ThumbnailSize Digikam::ItemViewImportDelegate::thumbnailSize ( ) const
inherited

◆ updateActualPixmapRect()

void Digikam::ImportDelegate::updateActualPixmapRect ( const QModelIndex &  index,
const QRect &  rect 
)
protectedinherited

◆ updateContentWidth()

void Digikam::ImportThumbnailDelegate::updateContentWidth ( )
overrideprotectedvirtual

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

Reimplemented from Digikam::ImportDelegate.

References thumbnailPixmapSize(), and Digikam::ImportDelegate::updateContentWidth().

◆ updateRects()

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

References Digikam::ImportSettings::getIconShowCoordinates(), Digikam::ImportSettings::getIconShowImageFormat(), and Digikam::ImportSettings::instance().

◆ updateSizeRectsAndPixmaps()

◆ visualChange

Member Data Documentation

◆ d_ptr

ItemViewImportDelegatePrivate* const Digikam::ItemViewImportDelegate::d_ptr
protectedinherited

◆ m_overlays


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