QElectroTech  0.8-dev
Signals | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
HelperCell Class Reference

#include <helpercell.h>

Inheritance diagram for HelperCell:
Inheritance graph
Collaboration diagram for HelperCell:
Collaboration graph

Signals

void contextMenuTriggered (HelperCell *)
 
void doubleClicked (HelperCell *)
 

Public Member Functions

 HelperCell (QGraphicsItem *=nullptr)
 
 ~HelperCell () override
 
void setGeometry (const QRectF &) override
 
QSizeF sizeHint (Qt::SizeHint, const QSizeF &=QSizeF()) const override
 
QRectF boundingRect () const override
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
 
virtual void setType (QET::TitleBlockColumnLength)
 
virtual void setActions (const QList< QAction * > &)
 
virtual QList< QAction * > actions () const
 
virtual void setLabel (const QString &text, bool=true)
 

Public Attributes

QColor background_color
 Background color when rendering this cell. More...
 
QColor foreground_color
 Text color when rendering this cell. More...
 
QString label
 Label displayed in this cell. More...
 
Qt::Orientation orientation
 Orientation of this cell. More...
 
int index
 Index of this cell. More...
 

Protected Member Functions

void contextMenuEvent (QGraphicsSceneContextMenuEvent *) override
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *) override
 

Private Member Functions

 HelperCell (const HelperCell &)
 

Private Attributes

QList< QAction * > actions_
 List of actions displayed by the context menu. More...
 

Detailed Description

This class implements a helper widget for cells that indicate the length of columns and rows.

Constructor & Destructor Documentation

◆ HelperCell() [1/2]

HelperCell::HelperCell ( QGraphicsItem *  parent = nullptr)

Constructor

Parameters
parentParent QGraphicsItem

◆ ~HelperCell()

HelperCell::~HelperCell ( )
override

Destructor

◆ HelperCell() [2/2]

HelperCell::HelperCell ( const HelperCell )
private

Member Function Documentation

◆ actions()

QList< QAction * > HelperCell::actions ( ) const
virtual
Returns
the list of actions displayed by the context menu of this helper cell.
Here is the caller graph for this function:

◆ boundingRect()

QRectF HelperCell::boundingRect ( ) const
override
Returns
the bounding rect of this helper cell

◆ contextMenuEvent()

void HelperCell::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprotected

Handle context menu events.

Parameters
eventContext menu event.

◆ contextMenuTriggered

void HelperCell::contextMenuTriggered ( HelperCell )
signal
Here is the caller graph for this function:

◆ doubleClicked

void HelperCell::doubleClicked ( HelperCell )
signal
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void HelperCell::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  )
overrideprotected

Handle double click events.

◆ paint()

void HelperCell::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
override

Handles the helper cell visual rendering

Parameters
painterQPainter to be used for the rendering
optionRendering options
widgetQWidget being painted, if any
Here is the caller graph for this function:

◆ setActions()

void HelperCell::setActions ( const QList< QAction * > &  actions)
virtual

Set the list of actions displayed by the context menu of this helper cell.

Here is the call graph for this function:

◆ setGeometry()

void HelperCell::setGeometry ( const QRectF &  g)
override

Ensure geometry changes are handled for both QGraphicsObject and QGraphicsLayoutItem.

Parameters
gNew geometry

◆ setLabel()

void HelperCell::setLabel ( const QString &  text,
bool  set_as_tooltip = true 
)
virtual
Parameters
textNew label displayed by this helper cell
set_as_tooltipIf true, the text is also used as tooltip.

◆ setType()

void HelperCell::setType ( QET::TitleBlockColumnLength  type)
virtual
Parameters
typenew type of this helper cell –
See also
QET::TitleBlockColumnLength

◆ sizeHint()

QSizeF HelperCell::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint = QSizeF() 
) const
override
Parameters
whichSize hint to be modified
constraintNew value for the size hint
Returns
the size hint for which using the width or height of constraint

Member Data Documentation

◆ actions_

QList<QAction *> HelperCell::actions_
private

List of actions displayed by the context menu.

◆ background_color

QColor HelperCell::background_color

Background color when rendering this cell.

◆ foreground_color

QColor HelperCell::foreground_color

Text color when rendering this cell.

◆ index

int HelperCell::index

Index of this cell.

◆ label

QString HelperCell::label

Label displayed in this cell.

◆ orientation

Qt::Orientation HelperCell::orientation

Orientation of this cell.


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