digiKam
Digikam::DItemDelegate Class Referenceabstract
+ Inheritance diagram for Digikam::DItemDelegate:

Signals

void gridSizeChanged (const QSize &newSize)
 
void visualChange ()
 

Public Member Functions

virtual bool acceptsActivation (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *activationRect=nullptr) const =0
 
virtual bool acceptsToolTip (const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *tooltipRect=nullptr) const =0
 
 DItemDelegate (QObject *const parent=nullptr)
 
virtual QSize gridSize () const =0
 
virtual void mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index)=0
 
virtual QPixmap pixmapForDrag (const QStyleOptionViewItem &option, const QList< QModelIndex > &indexes) const =0
 
virtual void setDefaultViewOptions (const QStyleOptionViewItem &option)=0
 
virtual void setSpacing (int spacing)=0
 
virtual void setThumbnailSize (const ThumbnailSize &thumbSize)=0
 
 ~DItemDelegate () 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 Member Functions

virtual void clearCaches ()
 
QString squeezedTextCached (QPainter *const p, int width, const QString &text) const
 
QPixmap thumbnailBorderPixmap (const QSize &pixSize, bool isGrouped=false) const
 

Constructor & Destructor Documentation

◆ DItemDelegate()

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

◆ ~DItemDelegate()

Digikam::DItemDelegate::~DItemDelegate ( )
override

Member Function Documentation

◆ acceptsActivation()

virtual bool Digikam::DItemDelegate::acceptsActivation ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  activationRect = nullptr 
) const
pure virtual

◆ acceptsToolTip()

virtual bool Digikam::DItemDelegate::acceptsToolTip ( const QPoint &  pos,
const QRect &  visualRect,
const QModelIndex &  index,
QRect *  tooltipRect = nullptr 
) const
pure virtual

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.

Implemented in Digikam::ItemViewImportDelegate, Digikam::ImportDelegate, ShowFoto::ShowfotoItemViewDelegate, ShowFoto::ShowfotoDelegate, Digikam::ItemViewDelegate, and Digikam::ItemDelegate.

◆ clearCaches()

◆ dateToString()

◆ gridSize()

virtual QSize Digikam::DItemDelegate::gridSize ( ) const
pure virtual

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

Implemented in Digikam::ItemViewImportDelegate, ShowFoto::ShowfotoItemViewDelegate, and Digikam::ItemViewDelegate.

◆ gridSizeChanged

◆ makeDragPixmap()

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

◆ mouseMoved()

virtual void Digikam::DItemDelegate::mouseMoved ( QMouseEvent *  e,
const QRect &  visualRect,
const QModelIndex &  index 
)
pure virtual

◆ pixmapForDrag()

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

◆ setDefaultViewOptions()

virtual void Digikam::DItemDelegate::setDefaultViewOptions ( const QStyleOptionViewItem &  option)
pure virtual

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

Implemented in Digikam::ItemViewImportDelegate, Digikam::ImportThumbnailDelegate, Digikam::ImportDelegate, ShowFoto::ShowfotoItemViewDelegate, ShowFoto::ShowfotoThumbnailDelegate, ShowFoto::ShowfotoDelegate, Digikam::ItemViewDelegate, Digikam::ItemThumbnailDelegate, and Digikam::ItemDelegate.

◆ setSpacing()

virtual void Digikam::DItemDelegate::setSpacing ( int  spacing)
pure virtual

◆ setThumbnailSize()

virtual void Digikam::DItemDelegate::setThumbnailSize ( const ThumbnailSize thumbSize)
pure virtual

You must set these options from the view

Implemented in Digikam::ItemViewImportDelegate, ShowFoto::ShowfotoItemViewDelegate, and Digikam::ItemViewDelegate.

◆ squeezedText()

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

Referenced by squeezedTextCached().

◆ squeezedTextCached()

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

◆ thumbnailBorderPixmap()

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

◆ visualChange


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