33 #include <QGraphicsSceneHoverEvent>
34 #include <QGraphicsSceneMouseEvent>
43 using namespace YACS::ENGINE;
44 using namespace YACS::HMI;
88 const QStyleOptionGraphicsItem *option,
102 painter->setPen(pen);
103 painter->drawLine(x, y, w, y);
110 painter->setPen(pen);
115 painter->setBrush(baseColor);
119 baseColor.getHsv(&h, &s, &v, &a);
120 DEBTRACE(
"h="<<h<<
" s="<<s<<
" v="<<v);
122 if (h>359) h2 = h2-359;
123 QLinearGradient gradient;
124 gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
125 gradient.setColorAt(0, baseColor.darker(200));
128 gradient.setColorAt(1, QColor::fromHsv(h2, s, v, a));
129 QBrush brush(gradient);
130 painter->setBrush(brush);
159 DEBTRACE(
"SceneHeaderNodeItem::autoPosNewPort");
175 _outPorts.push_back(dynamic_cast<SceneOutPortItem*>(item));
181 yTop += nbPorts * deltaY;
186 QPointF topLeft(xLeft, yTop);
193 DEBTRACE(
"SceneHeaderNodeItem::reorganizePorts() " << ss <<
" " <<
_label.toStdString());
202 std::list<SceneInPortItem*>::iterator iti =
_inPorts.begin();
204 for (; iti !=
_inPorts.end(); ++iti)
208 (*iti)->setTopLeft(topLeft);
209 if (isShown) nbPorts++;
212 std::list<SceneOutPortItem*>::iterator ito =
_outPorts.begin();
223 QPointF topLeft(xLeft, yTop);
224 (*ito)->setTopLeft(topLeft);
225 if (isShown) nbPorts++;
239 DEBTRACE(
"SceneHeaderNodeItem::adjustGeometry() " <<
_label.toStdString());
240 prepareGeometryChange();
271 return QRectF(x(), y(), width, height);
276 DEBTRACE(
"SceneHeaderNodeItem::adaptComposedNode " << deltaY);
277 QPointF oldPos(x(),y() - deltaY);
281 bloc->collisionResolv(port, oldPos);
288 DEBTRACE(
"SceneHeaderNodeItem::setEdited " << isEdited);
305 DEBTRACE(
"SceneHeaderNodeItem::setValid " << isValid);
315 DEBTRACE(
"SceneHeaderNodeItem::setExecState " << execState);