ButtonDelegate Class Reference

Manages a button. More...

#include <ArmarXGui/gui-plugins/ScenarioManager/gui/buttondelegate.h>

+ Inheritance diagram for ButtonDelegate:

Signals

void buttonClicked (int row, int column, QModelIndex parent)
 
void comboBoxButtonClicked (int row, int column, QModelIndex parent, QString text)
 

Public Member Functions

 ButtonDelegate (QWidget *parent=0)
 Constructor which doesn't do anything. More...
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
int getAppIconSize () const
 
int getScenarioIconSize () const
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Sets button style and draws it. More...
 
void setAppIconSize (int value)
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
void setScenarioIconSize (int value)
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Calculates and returns the size of the button. More...
 

Protected Member Functions

bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 

Detailed Description

Manages a button.

Definition at line 40 of file buttondelegate.h.

Constructor & Destructor Documentation

◆ ButtonDelegate()

ButtonDelegate ( QWidget *  parent = 0)

Constructor which doesn't do anything.

Definition at line 44 of file buttondelegate.cpp.

Member Function Documentation

◆ buttonClicked

void buttonClicked ( int  row,
int  column,
QModelIndex  parent 
)
signal
+ Here is the caller graph for this function:

◆ comboBoxButtonClicked

void comboBoxButtonClicked ( int  row,
int  column,
QModelIndex  parent,
QString  text 
)
signal

◆ createEditor()

QWidget * createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Definition at line 51 of file buttondelegate.cpp.

+ Here is the call graph for this function:

◆ editorEvent()

bool editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
overrideprotected

Definition at line 207 of file buttondelegate.cpp.

◆ getAppIconSize()

int getAppIconSize ( ) const

Definition at line 232 of file buttondelegate.cpp.

◆ getScenarioIconSize()

int getScenarioIconSize ( ) const

Definition at line 242 of file buttondelegate.cpp.

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Sets button style and draws it.

Parameters
painterPainter that does the drawing
optionDescribes the parameter used to draw the button
indexUsed to locate the button

Definition at line 143 of file buttondelegate.cpp.

◆ setAppIconSize()

void setAppIconSize ( int  value)

Definition at line 237 of file buttondelegate.cpp.

+ Here is the call graph for this function:

◆ setEditorData()

void setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
virtual

Definition at line 111 of file buttondelegate.cpp.

◆ setModelData()

void setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
virtual

Definition at line 130 of file buttondelegate.cpp.

◆ setScenarioIconSize()

void setScenarioIconSize ( int  value)

Definition at line 247 of file buttondelegate.cpp.

+ Here is the call graph for this function:

◆ sizeHint()

QSize sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Calculates and returns the size of the button.

Parameters
optionUsed to get the height and width of the item
indexUsed to locate the button (not used currently)

Definition at line 252 of file buttondelegate.cpp.


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