digiKam
Digikam::DCategorizedView::Private Class Reference

Classes

class  ElementInfo
 Attributes. More...
 

Public Member Functions

const QRect & cacheCategory (const QString &category)
 
const QRect & cachedRectCategory (const QString &category)
 
const QRect & cachedRectIndex (const QModelIndex &index)
 
const QRect & cacheIndex (const QModelIndex &index)
 
int categoryUpperBound (SparseModelIndexVector &modelIndexList, int begin, int averageSize=0)
 
QRect categoryVisualRect (const QString &category)
 
QSize contentsSize ()
 
void drawDraggedItems ()
 
void drawDraggedItems (QPainter *painter)
 
void drawNewCategory (const QModelIndex &index, int sortRole, const QStyleOption &option, QPainter *painter)
 
const QModelIndexList & intersectionSet (const QRect &rect)
 
 Private (DCategorizedView *const listView)
 
QItemSelection selectionForRect (const QRect &rect)
 
void updateScrollbars ()
 
QRect visualCategoryRectInViewport (const QString &category) const
 
QRect visualRect (const QModelIndex &index)
 
QRect visualRectInViewport (const QModelIndex &index) const
 
 ~Private ()
 

Public Attributes

QSize biggestItemSize
 
QStringList categories
 
QHash< QString, QVector< int > > categoriesIndexes
 
QHash< QString, QRect > categoriesPosition
 
DCategoryDrawercategoryDrawer
 
bool dragLeftViewport
 
bool drawItemsWhileDragging
 
QVector< ElementInfoelementsInfo
 
QHash< int, QRect > elementsPosition
 
int forcedSelectionPosition
 
QModelIndex hovered
 
QString hoveredCategory
 
QPoint initialPressPosition
 
QModelIndexList intersectedIndexes
 
QRect lastDraggedItemsRect
 
QItemSelection lastSelection
 
DCategorizedViewlistView
 Basic data. More...
 
bool mouseButtonPressed
 Behavior data. More...
 
QPoint mousePosition
 
DCategorizedSortFilterProxyModelproxyModel
 Attributes for speed reasons. More...
 
bool rightMouseButtonPressed
 

Constructor & Destructor Documentation

◆ Private()

Digikam::DCategorizedView::Private::Private ( DCategorizedView *const  listView)
explicit

◆ ~Private()

Digikam::DCategorizedView::Private::~Private ( )

Member Function Documentation

◆ cacheCategory()

const QRect & Digikam::DCategorizedView::Private::cacheCategory ( const QString &  category)

Caches and returns the rect that corresponds to category

We're sure categoriesPosition doesn't contain category

◆ cachedRectCategory()

const QRect & Digikam::DCategorizedView::Private::cachedRectCategory ( const QString &  category)

Returns the rect that corresponds to category

Note
If the rect is not cached, it becomes cached

◆ cachedRectIndex()

const QRect & Digikam::DCategorizedView::Private::cachedRectIndex ( const QModelIndex &  index)

Returns the rect that corresponds to index

Note
If the rect is not cached, it becomes cached

Referenced by Digikam::DCategorizedView::setSelection().

◆ cacheIndex()

const QRect & Digikam::DCategorizedView::Private::cacheIndex ( const QModelIndex &  index)

Caches and returns the rect that corresponds to index

We're sure elementsPosition doesn't contain index

◆ categoryUpperBound()

int Digikam::DCategorizedView::Private::categoryUpperBound ( SparseModelIndexVector modelIndexList,
int  begin,
int  averageSize = 0 
)

This method will, starting from the index at begin in the given (sorted) modelIndex List, find the last index having the same category as the index to begin with.

References Digikam::DCategorizedSortFilterProxyModel::CategoryDisplayRole, and value.

Referenced by Digikam::DCategorizedView::rowsInsertedArtifficial().

◆ categoryVisualRect()

QRect Digikam::DCategorizedView::Private::categoryVisualRect ( const QString &  category)

◆ contentsSize()

QSize Digikam::DCategorizedView::Private::contentsSize ( )

Returns the contents size of this view (topmost category to bottommost index + spacing)

Referenced by Digikam::DCategorizedView::setSelection().

◆ drawDraggedItems() [1/2]

void Digikam::DCategorizedView::Private::drawDraggedItems ( )

This method will determine which rect needs to be updated because of a dragging operation

References Digikam::DCategorizedView::visualRect().

◆ drawDraggedItems() [2/2]

void Digikam::DCategorizedView::Private::drawDraggedItems ( QPainter *  painter)

This method will draw dragged items in the painting operation

References Digikam::DCategorizedView::visualRect().

Referenced by Digikam::DCategorizedView::dragMoveEvent(), and Digikam::DCategorizedView::paintEvent().

◆ drawNewCategory()

void Digikam::DCategorizedView::Private::drawNewCategory ( const QModelIndex &  index,
int  sortRole,
const QStyleOption &  option,
QPainter *  painter 
)

This method will draw a new category represented by index index on the rect specified by option.rect, with painter painter

References Digikam::DCategorizedSortFilterProxyModel::CategoryDisplayRole, Digikam::DCategorizedView::categoryDrawer(), and Digikam::DCategoryDrawer::drawCategory().

Referenced by Digikam::DCategorizedView::paintEvent().

◆ intersectionSet()

◆ selectionForRect()

QItemSelection Digikam::DCategorizedView::Private::selectionForRect ( const QRect &  rect)

Returns a QItemSelection for all items intersection rect.

References intersectedIndexes, and intersectionSet().

Referenced by Digikam::DCategorizedView::setSelection().

◆ updateScrollbars()

void Digikam::DCategorizedView::Private::updateScrollbars ( )

This method will update scrollbars ranges. Called when our model changes or when the view is resized

Referenced by Digikam::DCategorizedView::resizeEvent(), and Digikam::DCategorizedView::rowsInsertedArtifficial().

◆ visualCategoryRectInViewport()

QRect Digikam::DCategorizedView::Private::visualCategoryRectInViewport ( const QString &  category) const

Returns the category rect in the viewport for category

References Digikam::DCategorizedView::categoryDrawer(), and Digikam::DCategoryDrawer::categoryHeight().

◆ visualRect()

QRect Digikam::DCategorizedView::Private::visualRect ( const QModelIndex &  index)

Returns the visual rect (taking in count x and y offsets) for index

Note
If the rect is not cached, it becomes cached

Referenced by Digikam::DCategorizedView::visualRect().

◆ visualRectInViewport()

QRect Digikam::DCategorizedView::Private::visualRectInViewport ( const QModelIndex &  index) const

Gets the item rect in the viewport for index

References Digikam::DCategorizedView::categoryDrawer(), and Digikam::DCategoryDrawer::categoryHeight().

Member Data Documentation

◆ biggestItemSize

◆ categories

◆ categoriesIndexes

◆ categoriesPosition

◆ categoryDrawer

◆ dragLeftViewport

◆ drawItemsWhileDragging

bool Digikam::DCategorizedView::Private::drawItemsWhileDragging

◆ elementsInfo

◆ elementsPosition

◆ forcedSelectionPosition

◆ hovered

◆ hoveredCategory

◆ initialPressPosition

◆ intersectedIndexes

◆ lastDraggedItemsRect

QRect Digikam::DCategorizedView::Private::lastDraggedItemsRect

◆ lastSelection

◆ listView

DCategorizedView* Digikam::DCategorizedView::Private::listView

Basic data.

◆ mouseButtonPressed

◆ mousePosition

◆ proxyModel

◆ rightMouseButtonPressed


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