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

#include <helpercell.h>

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.

Definition at line 27 of file helpercell.h.

Constructor & Destructor Documentation

◆ HelperCell() [1/2]

HelperCell::HelperCell ( QGraphicsItem *  parent = nullptr)

Constructor

Parameters
parentParent QGraphicsItem

Definition at line 24 of file helpercell.cpp.

◆ ~HelperCell()

HelperCell::~HelperCell ( )
override

Destructor

Definition at line 40 of file helpercell.cpp.

◆ 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.

Definition at line 117 of file helpercell.cpp.

References actions_.

Referenced by setActions().

◆ boundingRect()

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

Definition at line 67 of file helpercell.cpp.

◆ contextMenuEvent()

void HelperCell::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprotected

Handle context menu events.

Parameters
eventContext menu event.

Definition at line 136 of file helpercell.cpp.

References actions_, and contextMenuTriggered().

◆ contextMenuTriggered

void HelperCell::contextMenuTriggered ( HelperCell )
signal

Referenced by contextMenuEvent().

◆ doubleClicked

void HelperCell::doubleClicked ( HelperCell )
signal

Referenced by mouseDoubleClickEvent().

◆ mouseDoubleClickEvent()

void HelperCell::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  )
overrideprotected

Handle double click events.

Definition at line 150 of file helpercell.cpp.

References doubleClicked().

◆ 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

Definition at line 77 of file helpercell.cpp.

References background_color, foreground_color, and label.

Referenced by SplittedHelperCell::paint().

◆ setActions()

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

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

Definition at line 110 of file helpercell.cpp.

References actions(), and actions_.

◆ setGeometry()

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

Ensure geometry changes are handled for both QGraphicsObject and QGraphicsLayoutItem.

Parameters
gNew geometry

Definition at line 48 of file helpercell.cpp.

◆ 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.

Definition at line 125 of file helpercell.cpp.

References label.

◆ setType()

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

Definition at line 94 of file helpercell.cpp.

References QET::Absolute, background_color, foreground_color, QET::RelativeToRemainingLength, and QET::RelativeToTotalLength.

◆ 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

Definition at line 59 of file helpercell.cpp.

Member Data Documentation

◆ actions_

QList<QAction *> HelperCell::actions_
private

List of actions displayed by the context menu.

Definition at line 66 of file helpercell.h.

Referenced by actions(), contextMenuEvent(), and setActions().

◆ background_color

QColor HelperCell::background_color

Background color when rendering this cell.

Definition at line 40 of file helpercell.h.

Referenced by SplittedHelperCell::paint(), paint(), and setType().

◆ foreground_color

QColor HelperCell::foreground_color

Text color when rendering this cell.

Definition at line 41 of file helpercell.h.

Referenced by SplittedHelperCell::paint(), paint(), and setType().

◆ index

int HelperCell::index

Index of this cell.

Definition at line 44 of file helpercell.h.

◆ label

QString HelperCell::label

Label displayed in this cell.

Definition at line 42 of file helpercell.h.

Referenced by SplittedHelperCell::paint(), paint(), and setLabel().

◆ orientation

Qt::Orientation HelperCell::orientation

Orientation of this cell.

Definition at line 43 of file helpercell.h.


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