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

Signals

void actionRequested (int action, const QModelIndex &index)
 
void collapseOrExpandClicked (const QModelIndex &index)
 

Public Member Functions

virtual int categoryHeight (const QModelIndex &index, const QStyleOption &option) const
 
 DCategoryDrawer (DCategorizedView *const view)
 
virtual void drawCategory (const QModelIndex &index, int sortRole, const QStyleOption &option, QPainter *painter) const
 
virtual int leftMargin () const
 
virtual int rightMargin () const
 
DCategorizedViewview () const
 
 ~DCategoryDrawer () override
 

Protected Member Functions

virtual void mouseButtonDoubleClicked (const QModelIndex &index, const QRect &blockRect, QMouseEvent *event)
 
virtual void mouseButtonPressed (const QModelIndex &index, const QRect &blockRect, QMouseEvent *event)
 
virtual void mouseButtonReleased (const QModelIndex &index, const QRect &blockRect, QMouseEvent *event)
 
virtual void mouseLeft (const QModelIndex &index, const QRect &blockRect)
 
virtual void mouseMoved (const QModelIndex &index, const QRect &blockRect, QMouseEvent *event)
 

Friends

class DCategorizedView
 

Detailed Description

The category drawing is performed by this class. It also gives information about the category height and margins.

Constructor & Destructor Documentation

◆ DCategoryDrawer()

Digikam::DCategoryDrawer::DCategoryDrawer ( DCategorizedView *const  view)
explicit

Construct a category drawer for a given view

Since
5.0

◆ ~DCategoryDrawer()

Digikam::DCategoryDrawer::~DCategoryDrawer ( )
override

Member Function Documentation

◆ actionRequested

void Digikam::DCategoryDrawer::actionRequested ( int  action,
const QModelIndex &  index 
)
signal

Emit this signal on your subclass implementation to notify that something happened. Usually this will be triggered when you have received an event, and its position matched some "hot spot".

You give this action the integer you want, and having connected this signal to your code, the connected slot can perform the needed changes (view, model, selection model, delegate...)

◆ categoryHeight()

int Digikam::DCategoryDrawer::categoryHeight ( const QModelIndex &  index,
const QStyleOption &  option 
) const
virtual
Returns
The category height for the category represented by index index with style options option.

Reimplemented in Digikam::ImportCategoryDrawer, and Digikam::ItemCategoryDrawer.

Referenced by Digikam::DCategorizedView::Private::visualCategoryRectInViewport(), and Digikam::DCategorizedView::Private::visualRectInViewport().

◆ collapseOrExpandClicked

void Digikam::DCategoryDrawer::collapseOrExpandClicked ( const QModelIndex &  index)
signal

This signal becomes emitted when collapse or expand has been clicked.

◆ drawCategory()

void Digikam::DCategoryDrawer::drawCategory ( const QModelIndex &  index,
int  sortRole,
const QStyleOption &  option,
QPainter *  painter 
) const
virtual

This method purpose is to draw a category represented by the given

Parameters
indexwith the given
sortRolesorting role
Note
This method will be called one time per category, always with the first element in that category

Reimplemented in Digikam::ImportCategoryDrawer, and Digikam::ItemCategoryDrawer.

References Digikam::DCategorizedSortFilterProxyModel::CategoryDisplayRole.

Referenced by Digikam::DCategorizedView::Private::drawNewCategory().

◆ leftMargin()

int Digikam::DCategoryDrawer::leftMargin ( ) const
virtual
Note
0 by default

◆ mouseButtonDoubleClicked()

void Digikam::DCategoryDrawer::mouseButtonDoubleClicked ( const QModelIndex &  index,
const QRect &  blockRect,
QMouseEvent *  event 
)
protectedvirtual

Method called when the mouse button has been double clicked.

Parameters
indexThe representative index of the block of items.
blockRectThe rect occupied by the block of items.
eventThe mouse event.
Warning
You explicitly have to determine whether the event has been accepted or not. You have to call event->accept() or event->ignore() at all possible case branches in your code.

◆ mouseButtonPressed()

void Digikam::DCategoryDrawer::mouseButtonPressed ( const QModelIndex &  index,
const QRect &  blockRect,
QMouseEvent *  event 
)
protectedvirtual

Method called when the mouse button has been pressed.

Parameters
indexThe representative index of the block of items.
blockRectThe rect occupied by the block of items.
eventThe mouse event.
Warning
You explicitly have to determine whether the event has been accepted or not. You have to call event->accept() or event->ignore() at all possible case branches in your code.

◆ mouseButtonReleased()

void Digikam::DCategoryDrawer::mouseButtonReleased ( const QModelIndex &  index,
const QRect &  blockRect,
QMouseEvent *  event 
)
protectedvirtual

Method called when the mouse button has been released.

Parameters
indexThe representative index of the block of items.
blockRectThe rect occupied by the block of items.
eventThe mouse event.
Warning
You explicitly have to determine whether the event has been accepted or not. You have to call event->accept() or event->ignore() at all possible case branches in your code.

◆ mouseLeft()

void Digikam::DCategoryDrawer::mouseLeft ( const QModelIndex &  index,
const QRect &  blockRect 
)
protectedvirtual

Method called when the mouse button has left this block.

Parameters
indexThe representative index of the block of items.
blockRectThe rect occupied by the block of items.

◆ mouseMoved()

void Digikam::DCategoryDrawer::mouseMoved ( const QModelIndex &  index,
const QRect &  blockRect,
QMouseEvent *  event 
)
protectedvirtual

Method called when the mouse has been moved.

Parameters
indexThe representative index of the block of items.
blockRectThe rect occupied by the block of items.
eventThe mouse event.

◆ rightMargin()

int Digikam::DCategoryDrawer::rightMargin ( ) const
virtual
Note
0 by default

◆ view()

DCategorizedView * Digikam::DCategoryDrawer::view ( ) const
Returns
The view this category drawer is associated with.

Friends And Related Function Documentation

◆ DCategorizedView

friend class DCategorizedView
friend

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