Version: 8.3.0
YACS::HMI::SceneHeaderItem Class Reference

#include <SceneHeaderItem.hxx>

Inheritance diagram for YACS::HMI::SceneHeaderItem:
Collaboration diagram for YACS::HMI::SceneHeaderItem:

Public Member Functions

 SceneHeaderItem (QGraphicsScene *scene, SceneItem *parent, QString label)
 
virtual ~SceneHeaderItem ()
 
virtual QRectF getMinimalBoundingRect () const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 
virtual void setText (QString label)
 
virtual void popupMenu (QWidget *caller, const QPoint &globalPos)
 
virtual void adjustGeometry ()
 
- Public Member Functions inherited from YACS::HMI::SceneItem
 SceneItem (QGraphicsScene *scene, SceneItem *parent, QString label)
 
virtual ~SceneItem ()
 
virtual QRectF boundingRect () const
 
virtual QRectF childrenBoundingRect () const
 
virtual void setTopLeft (QPointF topLeft)
 
virtual void checkGeometryChange ()
 
void setParent (SceneItem *parent)
 
virtual QString getToolTip ()
 
void setEventPos (QPointF point)
 
virtual void updateChildItems ()
 
virtual void updateLinks ()
 
virtual void shrinkExpandLink (bool se)
 
virtual void shrinkExpandRecursive (bool isExpanding, bool fromHere, ShrinkMode theShrinkMode)
 
bool isAncestorShrinked ()
 
- Public Member Functions inherited from YACS::HMI::AbstractSceneItem
 AbstractSceneItem (QGraphicsScene *scene, SceneItem *parent, QString label)
 
virtual ~AbstractSceneItem ()
 
int getLevel ()
 
void setLevel ()
 
virtual void reorganize ()
 
virtual QString getLabel ()
 
virtual void addHeader ()
 
virtual void addProgressItem ()
 
virtual qreal getHeaderBottom ()
 
qreal getWidth ()
 
qreal getHeight ()
 
virtual void setWidth (qreal width)
 AbstractSceneItem cannot be resized (only ComposedNodeItem can) More...
 
virtual void setHeight (qreal height)
 AbstractSceneItem cannot be resized (only ComposedNodeItem can) More...
 
virtual void activateSelection (bool selected)
 
virtual void setGeometryOptimization (bool optimize)
 
SceneItemgetParent ()
 

Protected Member Functions

virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
QColor getPenColor ()
 
QColor getBrushColor ()
 
- Protected Member Functions inherited from YACS::HMI::SceneItem
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 
QColor hoverColor (QColor origColor)
 
- Protected Member Functions inherited from YACS::HMI::AbstractSceneItem
virtual QRectF childBoundingRect (AbstractSceneItem *child) const
 

Protected Attributes

SceneTextItem_text
 
- Protected Attributes inherited from YACS::HMI::SceneItem
bool _hover
 
bool _ancestorShrinked
 
QPointF _eventPos
 
- Protected Attributes inherited from YACS::HMI::AbstractSceneItem
SceneItem_parent
 
YACS::HMI::Scene_scene
 
QString _label
 
int _level
 
qreal _width
 
qreal _height
 
qreal _incHeight
 
QColor _penColor
 
QColor _brushColor
 
QColor _hiPenColor
 
QColor _hiBrushColor
 
bool _hasHeader
 
bool _optimize
 
bool _dragable
 
enum Qt::MouseButton _dragButton
 

Additional Inherited Members

- Public Attributes inherited from YACS::HMI::SceneItem
bool _blocX
 
bool _blocY
 

Detailed Description

Definition at line 31 of file SceneHeaderItem.hxx.

Constructor & Destructor Documentation

SceneHeaderItem::~SceneHeaderItem ( )
virtual

Definition at line 57 of file SceneHeaderItem.cxx.

58 {
59 }

Member Function Documentation

QColor SceneHeaderItem::getBrushColor ( )
protectedvirtual

Reimplemented from YACS::HMI::SceneItem.

Definition at line 104 of file SceneHeaderItem.cxx.

References YACS::HMI::AbstractSceneItem::_brushColor, YACS::HMI::AbstractSceneItem::_hiBrushColor, YACS::HMI::SceneItem::_hover, YACS::HMI::AbstractSceneItem::getParent(), and YACS::HMI::SceneItem::hoverColor().

Referenced by YACS::HMI::SceneHeaderNodeItem::paint().

105 {
106  QColor color = _brushColor;
107  if (dynamic_cast<SceneHeaderNodeItem*>(this))
108  if (getParent()->isSelected())
109  color = _hiBrushColor;
110  if (_hover)
111  color = hoverColor(color);
112  return color;
113 }
QRectF SceneHeaderItem::getMinimalBoundingRect ( ) const
virtual

Reimplemented in YACS::HMI::SceneHeaderNodeItem.

Definition at line 61 of file SceneHeaderItem.cxx.

References YACS::HMI::AbstractSceneItem::_height.

62 {
63  return QRectF(x(), y(), 5, _height);
64 }
QColor SceneHeaderItem::getPenColor ( )
protectedvirtual

Reimplemented from YACS::HMI::SceneItem.

Definition at line 94 of file SceneHeaderItem.cxx.

References YACS::HMI::AbstractSceneItem::_hiPenColor, YACS::HMI::AbstractSceneItem::_penColor, and YACS::HMI::AbstractSceneItem::getParent().

Referenced by YACS::HMI::SceneHeaderNodeItem::paint().

95 {
96 QColor color = _penColor;
97  if (getParent())
98  if(getParent()->getParent())
99  if (getParent()->getParent()->isSelected())
100  color = _hiPenColor;
101  return color;
102 }
void SceneHeaderItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

When Zooming, filter all mouse events to items: do not work, scene do not receive...

Reimplemented from YACS::HMI::SceneItem.

Reimplemented in YACS::HMI::SceneHeaderNodeItem.

Definition at line 115 of file SceneHeaderItem.cxx.

116 {
117  event->ignore();
118 }
void SceneHeaderItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget 
)
virtual

Reimplemented from YACS::HMI::SceneItem.

Reimplemented in YACS::HMI::SceneHeaderNodeItem.

Definition at line 66 of file SceneHeaderItem.cxx.

69 {
70 // DEBTRACE("SceneHeaderItem::paint");
71 }
void SceneHeaderItem::popupMenu ( QWidget caller,
const QPoint &  globalPos 
)
virtual

Reimplemented from YACS::HMI::SceneItem.

Reimplemented in YACS::HMI::SceneHeaderNodeItem.

Definition at line 82 of file SceneHeaderItem.cxx.

References YACS::HMI::AbstractSceneItem::_parent, and YACS::HMI::SceneItem::popupMenu().

83 {
84  if (_parent) _parent->popupMenu(caller, globalPos);
85 }
void SceneHeaderItem::setText ( QString  label)
virtual

Reimplemented in YACS::HMI::SceneHeaderNodeItem.

Definition at line 73 of file SceneHeaderItem.cxx.

References YACS::HMI::AbstractSceneItem::_scene, _text, and YACS::HMI::SceneTextItem::setPlainTextTrunc().

Referenced by YACS::HMI::SceneHeaderNodeItem::SceneHeaderNodeItem(), and YACS::HMI::SceneHeaderNodeItem::setText().

74 {
75  if (!_text)
76  _text = new SceneTextItem(_scene, this, label);
77  else
78  _text->setPlainTextTrunc(label);
79  QGraphicsItem::update();
80 }

Member Data Documentation

SceneTextItem* YACS::HMI::SceneHeaderItem::_text
protected

Definition at line 49 of file SceneHeaderItem.hxx.

Referenced by SceneHeaderItem(), and setText().


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