digiKam
|
Classes | |
class | ImportDelegatePrivate |
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) |
ImportCategoryDrawer * | categoryDrawer () const |
QRect | coordinatesIndicatorRect () const |
QRect | downloadIndicatorRect () const |
QSize | gridSize () const override |
QRect | groupIndicatorRect () const |
QRect | imageInformationRect () const override |
ImportDelegate (QObject *const parent=nullptr) | |
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 |
~ImportDelegate () 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... | |
ImportDelegate (ImportDelegate::ImportDelegatePrivate &dd, QObject *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 () |
virtual void | updateRects ()=0 |
void | updateSizeRectsAndPixmaps () override |
Protected Attributes | |
ItemViewImportDelegatePrivate *const | d_ptr |
QList< ItemDelegateOverlay * > | m_overlays |
|
explicit |
|
override |
|
protected |
|
overridevirtual |
Implements Digikam::DItemDelegate.
Reimplemented in Digikam::ImportThumbnailDelegate.
References onActualPixmapRect().
|
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.
References onActualPixmapRect().
QRect Digikam::ImportDelegate::actualPixmapRect | ( | const QModelIndex & | index | ) | const |
References Digikam::ItemViewImportDelegate::rect().
Referenced by onActualPixmapRect(), and paint().
|
overrideprotectedvirtualinherited |
Returns the delegate, typically, the derived class.
Implements Digikam::ItemDelegateOverlayContainer.
int Digikam::ImportDelegate::calculatethumbSizeToFit | ( | int | ws | ) |
References Digikam::ItemViewImportDelegate::gridSize(), Digikam::ThumbnailSize::maxThumbsSize(), Digikam::ThumbnailSize::size(), Digikam::ThumbnailSize::Small, Digikam::ItemViewImportDelegate::spacing(), and Digikam::ItemViewImportDelegate::thumbnailSize().
Referenced by Digikam::ImportIconView::fitToWidthIcons().
ImportCategoryDrawer * Digikam::ImportDelegate::categoryDrawer | ( | ) | const |
|
overrideprotectedvirtual |
Reimplemented from Digikam::DItemDelegate.
References Digikam::DItemDelegate::clearCaches().
Referenced by updateSizeRectsAndPixmaps().
|
protectedvirtual |
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 modelChanged(), and modelContentsChanged().
QRect Digikam::ImportDelegate::coordinatesIndicatorRect | ( | ) | const |
|
staticinherited |
QRect Digikam::ImportDelegate::downloadIndicatorRect | ( | ) | const |
|
protectedinherited |
References Digikam::ColorLabelWidget::labelColor(), and Digikam::NoColorLabel.
Referenced by paint().
|
protectedinherited |
References Digikam::DItemDelegate::dateToString().
Referenced by paint().
|
protectedinherited |
References Digikam::CamItemInfo::DownloadedNo, Digikam::CamItemInfo::DownloadedYes, and Digikam::CamItemInfo::DownloadUnknown.
Referenced by paint().
|
protectedinherited |
References Digikam::ItemPropertiesTab::humanReadableBytesCount().
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedinherited |
|
protectedinherited |
References Digikam::ItemScanner::formatToString().
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedinherited |
Referenced by paint().
|
protectedvirtualinherited |
References Digikam::ItemDelegateOverlayContainer::m_overlays, and Digikam::ItemDelegateOverlay::paint().
Referenced by Digikam::ItemDelegate::paint(), ShowFoto::ShowfotoDelegate::paint(), and paint().
|
protectedinherited |
References Digikam::AcceptedLabel, Digikam::NoPickLabel, Digikam::PendingLabel, and Digikam::RejectedLabel.
Referenced by paint().
|
protectedinherited |
References Digikam::ItemViewImportDelegate::ratingPixmap(), and Digikam::ItemViewImportDelegate::ratingRect().
Referenced by paint().
|
protectedinherited |
References Digikam::DItemDelegate::squeezedTextCached().
Referenced by paint().
|
protectedinherited |
Use the tool methods for painting in subclasses.
References Digikam::DItemDelegate::thumbnailBorderPixmap().
Referenced by paint().
|
overridevirtualinherited |
Returns the gridsize to be set by the view. It's sizeHint plus spacing.
Implements Digikam::DItemDelegate.
Referenced by calculatethumbSizeToFit().
|
signalinherited |
QRect Digikam::ImportDelegate::groupIndicatorRect | ( | ) | const |
|
signalinherited |
|
overridevirtual |
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.
|
inherited |
References Digikam::ItemDelegateOverlay::acceptsDelegate(), Digikam::ItemDelegateOverlayContainer::asDelegate(), Digikam::ItemDelegateOverlayContainer::m_overlays, Digikam::ItemDelegateOverlayContainer::overlayDestroyed(), and Digikam::ItemDelegateOverlay::setDelegate().
Referenced by Digikam::VersionsTreeView::addOverlay(), Digikam::ImportCategorizedView::addOverlay(), Digikam::ItemCategorizedView::addOverlay(), and ShowFoto::ShowfotoCategorizedView::addOverlay().
|
overrideprotectedvirtual |
reimplement these in subclasses
Reimplemented from Digikam::ItemViewImportDelegate.
References Digikam::ItemViewImportDelegate::invalidatePaintingCache().
QRect Digikam::ImportDelegate::lockIndicatorRect | ( | ) | const |
|
staticinherited |
|
protectedslot |
References clearModelDataCaches(), and setModel().
Referenced by setView().
|
protectedslot |
References clearModelDataCaches().
Referenced by setModel().
|
overridevirtualinherited |
NOTE: to be called by ItemViewCategorized only
Implements Digikam::DItemDelegate.
References Digikam::ItemDelegateOverlayContainer::mouseMoved().
|
protected |
References actualPixmapRect().
Referenced by acceptsActivation(), and acceptsToolTip().
|
overrideprotectedslotinherited |
|
inherited |
|
override |
References 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(), thumbnailPixmap(), updateActualPixmapRect(), Digikam::CamItemInfo::width, and Digikam::CamItemInfo::writePermissions.
|
overridevirtual |
Implements Digikam::DItemDelegate.
References Digikam::DItemDelegate::makeDragPixmap(), and thumbnailPixmap().
|
overridevirtual |
Returns the area where the pixmap is drawn, or null if not supported
Reimplemented from Digikam::ItemViewImportDelegate.
|
protectedinherited |
Referenced by updateSizeRectsAndPixmaps().
|
protectedinherited |
Referenced by updateSizeRectsAndPixmaps().
|
protectedinherited |
Referenced by updateSizeRectsAndPixmaps().
|
protectedinherited |
Please call this method after prepareBackground() and when d->ratingPixmap is set
Referenced by updateSizeRectsAndPixmaps().
|
protectedinherited |
Returns the relevant pixmap from the cached rating pixmaps.
Referenced by Digikam::ItemViewImportDelegate::drawRating().
|
virtualinherited |
Returns the rectangle where the rating is drawn, or a null rectangle if not supported.
Referenced by Digikam::ItemViewImportDelegate::drawRating().
|
inherited |
Referenced by actualPixmapRect(), and updateActualPixmapRect().
|
inherited |
References Digikam::ItemDelegateOverlayContainer::m_overlays, Digikam::ItemDelegateOverlay::setActive(), Digikam::ItemDelegateOverlay::setDelegate(), and Digikam::ItemDelegateOverlay::setView().
Referenced by Digikam::ItemViewDelegate::~ItemViewDelegate(), Digikam::ItemViewImportDelegate::~ItemViewImportDelegate(), ShowFoto::ShowfotoItemViewDelegate::~ShowfotoItemViewDelegate(), and Digikam::VersionsTreeView::~VersionsTreeView().
|
inherited |
References Digikam::ItemDelegateOverlayContainer::asDelegate(), Digikam::ItemDelegateOverlayContainer::m_overlays, Digikam::ItemDelegateOverlay::setActive(), and Digikam::ItemDelegateOverlay::setDelegate().
Referenced by Digikam::ItemDelegateOverlayContainer::overlayDestroyed(), Digikam::ItemCategorizedView::removeOverlay(), Digikam::VersionsTreeView::removeOverlay(), ShowFoto::ShowfotoCategorizedView::removeOverlay(), and Digikam::ImportCategorizedView::removeOverlay().
|
signalinherited |
|
static |
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 thumbnailPixmap().
|
inherited |
|
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.
Reimplemented in Digikam::ImportThumbnailDelegate.
References Digikam::ItemViewImportDelegate::setDefaultViewOptions().
Referenced by Digikam::ImportThumbnailDelegate::setDefaultViewOptions().
|
protected |
References modelContentsChanged().
Referenced by modelChanged(), and setView().
|
inherited |
Can be used to temporarily disable drawing of the rating. Call with QModelIndex() afterwards.
|
overridevirtual |
Implements Digikam::DItemDelegate.
References Digikam::ItemViewImportDelegate::setSpacing(), and Digikam::ItemViewImportDelegate::spacing().
|
overridevirtualinherited |
reimplemented from DItemDelegate
Implements Digikam::DItemDelegate.
References Digikam::ItemViewImportDelegate::invalidatePaintingCache().
Referenced by Digikam::ImportCategorizedView::setItemDelegate().
void Digikam::ImportDelegate::setView | ( | ImportCategorizedView * | view | ) |
|
inherited |
|
overrideinherited |
|
protectedslotinherited |
|
protectedslotinherited |
|
inherited |
|
staticinherited |
Referenced by Digikam::DItemDelegate::squeezedTextCached().
|
protectedinherited |
QRect Digikam::ImportDelegate::tagsRect | ( | ) | const |
|
protectedinherited |
|
protectedvirtual |
References retrieveThumbnailPixmap().
Referenced by paint(), and pixmapForDrag().
|
inherited |
Referenced by calculatethumbSizeToFit(), and retrieveThumbnailPixmap().
|
protected |
References Digikam::ItemViewImportDelegate::rect().
Referenced by paint().
|
protectedvirtual |
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 updateSizeRectsAndPixmaps().
|
protectedpure virtual |
In a subclass, you need to implement this method to set up the rects for drawing. The paint() method operates depending on these rects.
Implemented in Digikam::ImportNormalDelegate, and Digikam::ImportThumbnailDelegate.
Referenced by updateSizeRectsAndPixmaps().
|
overrideprotectedvirtual |
Implements Digikam::ItemViewImportDelegate.
References clearCaches(), Digikam::ItemViewImportDelegate::prepareBackground(), Digikam::ItemViewImportDelegate::prepareFonts(), Digikam::ItemViewImportDelegate::prepareMetrics(), Digikam::ItemViewImportDelegate::prepareRatingPixmaps(), updateContentWidth(), and updateRects().
|
signalinherited |
|
protectedinherited |
Referenced by Digikam::ItemViewImportDelegate::ItemViewImportDelegate().
|
protectedinherited |
Referenced by Digikam::ItemDelegateOverlayContainer::drawOverlays(), Digikam::ItemDelegateOverlayContainer::installOverlay(), Digikam::ItemDelegateOverlayContainer::mouseMoved(), Digikam::ItemDelegateOverlayContainer::overlays(), Digikam::ItemDelegateOverlayContainer::removeAllOverlays(), Digikam::ItemDelegateOverlayContainer::removeOverlay(), Digikam::ItemDelegateOverlayContainer::setAllOverlaysActive(), and Digikam::ItemDelegateOverlayContainer::setViewOnAllOverlays().