SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
smtk::extension::qtDescriptivePhraseDelegate Class Reference

Present the contents of an smtk::model::Resource instance via qtDescriptivePhraseModel. More...

#include <qtDescriptivePhraseDelegate.h>

Inheritance diagram for smtk::extension::qtDescriptivePhraseDelegate:
[legend]
Collaboration diagram for smtk::extension::qtDescriptivePhraseDelegate:
[legend]

Public Slots

void setTitleFontSize (int tfs)
 
void setSubtitleFontSize (int sfs)
 
void setTitleFontWeight (int tfs)
 
void setSubtitleFontWeight (int sfs)
 
void setTextVerticalPad (int tvp)
 
void setDrawSubtitle (bool includeSubtitle)
 
void setVisibilityMode (bool allEditsChangeVisibility)
 
void setHighlightOnHover (bool highlightOnMouseover)
 
void setSelection (const std::shared_ptr< smtk::view::Selection > &seln)
 

Public Member Functions

 qtDescriptivePhraseDelegate (QWidget *parent=nullptr)
 
int titleFontSize () const
 
int subtitleFontSize () const
 
int titleFontWeight () const
 
int subtitleFontWeight () const
 
int textVerticalPad () const
 
bool drawSubtitle () const
 
bool highlightOnHover () const
 
bool visibilityMode () const
 
std::shared_ptr< smtk::view::Selectionselection () const
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 

Static Public Member Functions

static bool processBadgeClick (QMouseEvent *mouseClickEvent, QAbstractItemView *view)
 If the given mouseClickEvent occurred over a badge, invoke its action and return true. More...
 
static int pickBadge (const QPoint &pPos, const QStyleOptionViewItem &option, const smtk::view::BadgeSet::BadgeList &badges, const smtk::view::DescriptivePhrase *phrase)
 Return the index of the badge underneath pPos (or -1 if none).
 

Protected Member Functions

bool eventFilter (QObject *editor, QEvent *event) override
 

Protected Attributes

int m_titleFontSize { 14 }
 
int m_subtitleFontSize { 10 }
 
int m_titleFontWeight { 2 }
 
int m_subtitleFontWeight { 1 }
 
int m_textVerticalPad { 2 }
 
bool m_drawSubtitle { true }
 
bool m_visibilityMode { false }
 
bool m_highlightOnHover { false }
 
std::weak_ptr< smtk::view::Selectionm_selection
 

Properties

int titleFontSize
 
int subtitleFontSize
 
int titleFontWeight
 
int subtitleFontWeight
 
int textVerticalPad
 
bool drawSubtitle
 
bool visibilityMode
 
std::shared_ptr< smtk::view::Selectionselection
 

Detailed Description

Present the contents of an smtk::model::Resource instance via qtDescriptivePhraseModel.

Member Function Documentation

◆ paint()

void smtk::extension::qtDescriptivePhraseDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

add a method to set/get title font

◆ processBadgeClick()

bool smtk::extension::qtDescriptivePhraseDelegate::processBadgeClick ( QMouseEvent *  mouseClickEvent,
QAbstractItemView *  view 
)
static

If the given mouseClickEvent occurred over a badge, invoke its action and return true.

The mouseClickEvent must be a QEvent::MouseButtonPress sent to the viewport of the view (a QAbstractItemView such as a QTreeView). Thus, this method will be called from an event filter installed on view->viewport(). If this method returns true, your event filter should consume the event by returning true.

Internally, this method will call pickBadge().


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