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

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)
 
ImportCategoryDrawercategoryDrawer () const
 
QRect coordinatesIndicatorRect () const
 
QRect downloadIndicatorRect () const
 
QSize gridSize () const override
 
QRect groupIndicatorRect () const
 
QRect imageInformationRect () const override
 
 ImportNormalDelegate (ImportCategorizedView *const parent)
 
void installOverlay (ItemDelegateOverlay *overlay)
 
QRect lockIndicatorRect () 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 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
 
 ~ImportNormalDelegate () 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...
 
 ImportNormalDelegate (ImportNormalDelegatePrivate &dd, ImportCategorizedView *const parent)
 
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
 
void updateActualPixmapRect (const QModelIndex &index, const QRect &rect)
 
virtual void updateContentWidth ()
 
void updateRects () override
 
void updateSizeRectsAndPixmaps () override
 

Protected Attributes

ItemViewImportDelegatePrivate *const d_ptr
 
QList< ItemDelegateOverlay * > m_overlays
 

Constructor & Destructor Documentation

◆ ImportNormalDelegate() [1/2]

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

◆ ~ImportNormalDelegate()

Digikam::ImportNormalDelegate::~ImportNormalDelegate ( )
override

◆ ImportNormalDelegate() [2/2]

Digikam::ImportNormalDelegate::ImportNormalDelegate ( ImportNormalDelegatePrivate dd,
ImportCategorizedView *const  parent 
)
protected

Member Function Documentation

◆ acceptsActivation()

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

◆ 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

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

References Digikam::ItemViewImportDelegate::setDefaultViewOptions().

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

◆ 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

◆ thumbnailSize()

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

◆ updateActualPixmapRect()

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

◆ updateContentWidth()

void Digikam::ImportDelegate::updateContentWidth ( )
protectedvirtualinherited

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

Reimplemented in Digikam::ImportThumbnailDelegate.

Referenced by Digikam::ImportThumbnailDelegate::updateContentWidth(), and Digikam::ImportDelegate::updateSizeRectsAndPixmaps().

◆ updateRects()

void Digikam::ImportNormalDelegate::updateRects ( )
overrideprotectedvirtual

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