Limo
A simple mod manager
Loading...
Searching...
No Matches
TableCellDelegate Class Reference

Paints a cell containing text or an icon in a ModListView. More...

#include <tablecelldelegate.h>

Inheritance diagram for TableCellDelegate:
Collaboration diagram for TableCellDelegate:

Public Member Functions

 TableCellDelegate (QSortFilterProxyModel *proxy, QObject *parent)
 Constructor.
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &view_index) const override
 Paints the cells background and text or icon.
 

Protected Attributes

QSortFilterProxyModel * proxy_model_ = nullptr
 Proxy model used to sort or filter the underlying model.
 
ModListViewparent_view_
 Convenience pointer to parent view. Points to the same address as this->parent.
 

Detailed Description

Paints a cell containing text or an icon in a ModListView.

Constructor & Destructor Documentation

◆ TableCellDelegate()

TableCellDelegate::TableCellDelegate ( QSortFilterProxyModel * proxy,
QObject * parent )
explicit

Constructor.

Parameters
parentParent of this object.
proxyProxy model used, or nullptr if non is used.

Member Function Documentation

◆ paint()

void TableCellDelegate::paint ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & view_index ) const
override

Paints the cells background and text or icon.

Uses alternating row colors and highlight / mouse hover colors, depending on the selection status of the cell.

Parameters
painterPainter used to draw.
optionStyle options.
view_indexThe target views index.

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