SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A delegate for rendering symbols into a qtDiagramLegend. More...
#include <qtLegendDelegate.h>
Public Member Functions | |
smtkSuperclassMacro (QStyledItemDelegate) | |
smtkTypeMacroBase (smtk::extension::qtLegendDelegate) | |
qtLegendDelegate (QObject *parent=nullptr) | |
bool | setHoverIndex (const QModelIndex &index) |
Called by qtDiagramLegend as the mouse moves across the table: | |
QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override |
Provide a good size for a legend symbol. | |
void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
Paint a symbol into a QTableView cell. | |
Protected Attributes | |
QPersistentModelIndex | m_hoverIndex |
A delegate for rendering symbols into a qtDiagramLegend.
An instance of this class should be set as the delegate for the qtDiagramLegend::Column::Symbol column of a qtDiagramLegend's QTableView.
The delegate simply fetches the qtDiagramLegendEntry from each cell's data and forwards painting to the legend entry.