1 #include "ConnectionItem.h"
3 #include "Dispatcher.h"
4 #include "Parameters.h"
5 #include "AbstractBoxItem.h"
6 #include "ConnectedInterface.h"
7 #include "InterfaceItem.h"
8 #include "AbstractBlock.h"
10 //int ConnectionItem::counter = 0;
12 ConnectionItem::ConnectionItem(InterfaceItem* _fromInterfaceItem,
13 InterfaceItem* _toInterfaceItem,
14 Dispatcher* _dispatcher,
15 Parameters* _params) : QGraphicsItem() {
18 dispatcher = _dispatcher;
20 fromInterfaceItem = _fromInterfaceItem;
21 toInterfaceItem = _toInterfaceItem;
23 /* NOTE: originally, the following was testing the correct order
24 * to connect the 2 interfaces. Presently, the order is predetermined
25 * when testing the AbstractInterface objets that must be connected.
27 ConnectedInterface* ref1 = _iface1->refInter;
28 ConnectedInterface* ref2 = _iface2->refInter;
30 case 1 : ref1 is group interface, and ref2 block interface of a block within the group
31 case 2 : the opposite of case 1
32 case 3 : ref1 and ref2 are block interface of blocks that are both within the same parent group.
33 case 4 : ref1 is stimuli interface and ref2 interface of top group
34 case 5 : the opposite of case 4
36 if (ref1->getOwner() == ref2->getOwner()->getParent()) {
38 if (ref1->getDirection() == AbstractInterface::Input) {
39 fromInterfaceItem = _iface1;
40 toInterfaceItem = _iface2;
42 else if (ref1->getDirection() == AbstractInterface::InOut) {
43 fromInterfaceItem = _iface1;
44 toInterfaceItem = _iface2;
46 else if (ref1->getDirection() == AbstractInterface::Output) {
47 toInterfaceItem = _iface1;
48 fromInterfaceItem = _iface2;
51 else if (ref1->getOwner()->getParent() == ref2->getOwner()) {
53 if (ref1->getDirection() == AbstractInterface::Input) {
54 fromInterfaceItem = _iface2;
55 toInterfaceItem = _iface1;
57 else if (ref1->getDirection() == AbstractInterface::InOut) {
58 fromInterfaceItem = _iface2;
59 toInterfaceItem = _iface1;
61 else if (ref1->getDirection() == AbstractInterface::Output) {
62 toInterfaceItem = _iface2;
63 fromInterfaceItem = _iface1;
66 // NB : this case is in fact similar to the previous. Kept here for clarity
67 else if (ref1->getOwner()->getParent() == ref2->getOwner()->getParent()) {
69 if (ref1->getDirection() == AbstractInterface::Input) {
70 fromInterfaceItem = _iface2;
71 toInterfaceItem = _iface1;
73 else if (ref1->getDirection() == AbstractInterface::InOut) {
74 fromInterfaceItem = _iface2;
75 toInterfaceItem = _iface1;
77 else if (ref1->getDirection() == AbstractInterface::Output) {
78 toInterfaceItem = _iface2;
79 fromInterfaceItem = _iface1;
82 else if ((ref1->getOwner()->isStimuliBlock()) && (ref2->getOwner()->isTopGroupBlock())) {
83 fromInterfaceItem = _iface1;
84 toInterfaceItem = _iface2;
86 else if ((ref2->getOwner()->isStimuliBlock()) && (ref1->getOwner()->isTopGroupBlock())) {
87 fromInterfaceItem = _iface2;
88 toInterfaceItem = _iface1;
92 // adding this to interface items
93 fromInterfaceItem->addConnectionItem(this);
94 toInterfaceItem->addConnectionItem(this);
97 marginConn = params->arrowLineLength+params->arrowWidth;
99 setFlag(ItemIsSelectable);
100 setAcceptHoverEvents(true);
101 setFlag(ItemSendsGeometryChanges);
102 setCursor(Qt::PointingHandCursor);
105 if (fromInterfaceItem->refInter->getPurpose() == AbstractInterface::Data) {
116 ConnectionItem::ConnectionItem(const ConnectionItem ©) {
117 pointFrom = copy.pointFrom;
118 pointTo = copy.pointTo;
119 interPoint1 = copy.interPoint1;
120 interPoint2 = copy.interPoint2;
121 interPoint3 = copy.interPoint3;
122 interPoint4 = copy.interPoint4;
125 ConnectionItem::~ConnectionItem() {
128 ConnectionItem::ConnectionItem() {
131 QPainterPath ConnectionItem::shape() const {
135 QRectF ConnectionItem::boundingRect() const {
139 if(pointFrom.x() < pointTo.x()){
140 start.setX(pointFrom.x()-20);
141 end.setX(pointTo.x()+20);
143 start.setX(pointTo.x()-20);
144 end.setX(pointFrom.x()+20);
146 if(pointFrom.y() < pointTo.y()){
147 start.setY(pointFrom.y()-20);
148 end.setY(pointTo.y()+20);
150 start.setY(pointTo.y()-20);
151 end.setY(pointFrom.y()+20);
153 return QRectF(start, end);
156 void ConnectionItem::paint(QPainter *painter,
157 const QStyleOptionGraphicsItem *option,
160 if (!visible) return;
162 painter->setPen(Qt::blue);
164 painter->setPen(Qt::red);
167 painter->drawPath(pathPaint);
170 void ConnectionItem::addInterPoint(QPointF point) {
174 void ConnectionItem::setPath() {
176 // signals to the scene that this connection is going to change of shape.
177 prepareGeometryChange();
179 bool withinGroup = false;
181 1: from group input iface to box input iface
182 2: from output box iface to group output iface
183 3: from output box iface to input box iface
184 4: from source output iface to input group iface
186 For cases 1 & 2, the position of group iface is given by getStartPosition
187 For all other cases, the iface from and to position is given by getEndPosition
189 if ((fromInterfaceItem->getOwner()->isGroupItem()) && (toInterfaceItem->getOwner()->isBoxItem())) {
190 pointFrom = fromInterfaceItem->getStartPosition();
191 pointTo = toInterfaceItem->getEndPosition();
194 else if ((toInterfaceItem->getOwner()->isGroupItem()) && (fromInterfaceItem->getOwner()->isBoxItem())) {
195 pointFrom = fromInterfaceItem->getEndPosition();
196 pointTo = toInterfaceItem->getStartPosition();
200 pointFrom = fromInterfaceItem->getEndPosition();
201 pointTo = toInterfaceItem->getEndPosition();
205 oriFrom = fromInterfaceItem->getOrientation();
206 oriTo = toInterfaceItem->getOrientation();
208 /* NB: if src or dest is onwed by a GroupItem the orientation
209 must be changed as it is a block.
212 if(fromInterfaceItem->owner->isGroupItem()){
213 switch(fromInterfaceItem->getOrientation()){
214 case Parameters::North :
215 oriFrom = Parameters::South;
217 case Parameters::South :
218 oriFrom = Parameters::North;
220 case Parameters::East :
221 oriFrom = Parameters::West;
223 case Parameters::West :
224 oriFrom = Parameters::East;
228 else if(toInterfaceItem->owner->isGroupItem()){
229 switch(toInterfaceItem->getOrientation()){
230 case Parameters::North :
231 oriTo = Parameters::South;
233 case Parameters::South :
234 oriTo = Parameters::North;
236 case Parameters::East :
237 oriTo = Parameters::West;
239 case Parameters::West :
240 oriTo = Parameters::East;
248 if(oriFrom == Parameters::South) {
250 // FROM SOUTH TO SOUTH
251 if(oriTo == Parameters::South) {
252 computeElle(oriFrom);
254 // FROM SOUTH TO NORTH
255 else if(oriTo == Parameters::North) {
256 gap1 = pointTo.y() - pointFrom.y();
257 if (gap1 > 2*marginConn) {
258 computeStaircase(oriFrom);
261 computeEsse(oriFrom);
264 // FROM SOUTH TO EAST OR WEST
265 else if ((oriTo == Parameters::East) || (oriTo == Parameters::West)){
267 gap1 = pointTo.x() - pointFrom.x();
268 if (oriTo == Parameters::West) gap1 = -gap1;
269 gap2 = pointTo.y() - pointFrom.y();
273 computeHookSmallEnd(oriFrom,oriTo);
276 computeOpenRect(oriFrom,oriTo);
281 computeCorner(oriFrom);
284 computeHookSmallStart(oriFrom,oriTo);
289 else if(oriFrom == Parameters::North) {
291 // FROM NORTH TO SOUTH
292 if(oriTo == Parameters::South) {
293 gap1 = pointFrom.y() - pointTo.y();
294 if (gap1 > 2*marginConn) {
295 computeStaircase(oriFrom);
298 computeEsse(oriFrom);
301 // FROM NORTH TO NORTH
302 else if(oriTo == Parameters::North) {
303 computeElle(oriFrom);
305 // FROM NORTH TO EAST OR WEST
306 else if ((oriTo == Parameters::East) || (oriTo == Parameters::West)){
308 gap1 = pointTo.x() - pointFrom.x();
309 if (oriTo == Parameters::West) gap1 = -gap1;
310 gap2 = pointFrom.y() - pointTo.y();
314 computeHookSmallEnd(oriFrom,oriTo);
317 computeOpenRect(oriFrom,oriTo);
322 computeCorner(oriFrom);
325 computeHookSmallStart(oriFrom,oriTo);
330 else if(oriFrom == Parameters::East) {
331 // FROM EAST TO NORTH OR SOUTH
332 if ((oriTo == Parameters::South) || (oriTo == Parameters::North)){
334 gap1 = pointFrom.x() - pointTo.x();
335 gap2 = pointFrom.y() - pointTo.y();
336 if (oriTo == Parameters::North) gap2 = -gap2;
340 computeHookSmallStart(oriFrom,oriTo);
343 computeOpenRect(oriFrom,oriTo);
348 computeCorner(oriFrom);
351 computeHookSmallEnd(oriFrom,oriTo);
355 else if(oriTo == Parameters::East) {
356 computeElle(oriFrom);
358 else if (oriTo == Parameters::West) {
359 gap1 = pointTo.x() - pointFrom.x();
360 if (gap1 > 2*marginConn) {
361 computeStaircase(oriFrom);
364 computeEsse(oriFrom);
368 else if (oriFrom == Parameters::West) {
370 // FROM WEST TO NORTH OR SOUTH
371 if ((oriTo == Parameters::South) || (oriTo == Parameters::North)){
373 gap1 = pointTo.x() - pointFrom.x();
374 gap2 = pointFrom.y() - pointTo.y();
375 if (oriTo == Parameters::North) gap2 = -gap2;
379 computeHookSmallStart(oriFrom,oriTo);
382 computeOpenRect(oriFrom,oriTo);
387 computeCorner(oriFrom);
390 computeHookSmallEnd(oriFrom,oriTo);
394 else if(oriTo == Parameters::East) {
395 gap1 = pointFrom.x() - pointTo.x();
396 if (gap1 > 2*marginConn) {
397 computeStaircase(oriFrom);
400 computeEsse(oriFrom);
403 else if (oriTo == Parameters::West) {
404 computeElle(oriFrom);
409 //pathShape = pps.createStroke(pathPaint);
413 void ConnectionItem::computeEsse(int orientationFrom) {
415 //cout << "drawing an esse" << endl;
416 pathPaint = QPainterPath(pointFrom);
419 double gap = marginConn;
421 if ((orientationFrom == Parameters::North)||(orientationFrom == Parameters::West)) gap = -gap;
424 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
426 // must draw a complete esse
427 p = QPointF(pointFrom.x()+gap,pointFrom.y());
430 interPoints.append(p);
431 p = QPointF(pointFrom.x()+gap,(pointFrom.y()+pointTo.y())/2.0);
434 interPoints.append(p);
435 p = QPointF(pointTo.x()-gap,(pointFrom.y()+pointTo.y())/2.0);
438 interPoints.append(p);
439 p = QPointF(pointTo.x()-gap,pointTo.y());
442 interPoints.append(p);
443 pathPaint.lineTo(pointTo);
445 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
447 // must draw a complete esse
448 p = QPointF(pointFrom.x(),pointFrom.y()+gap);
451 interPoints.append(p);
452 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointFrom.y()+gap);
455 interPoints.append(p);
456 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointTo.y()-gap);
459 interPoints.append(p);
460 p = QPointF(pointTo.x(), pointTo.y()-gap);
463 interPoints.append(p);
464 pathPaint.lineTo(pointTo);
467 pathShape = pps.createStroke(s);
470 void ConnectionItem::computeStaircase(int orientationFrom) {
472 pathPaint = QPainterPath(pointFrom);
474 double gap = marginConn;
478 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
480 if (orientationFrom == Parameters::West) gap = -gap;
481 p = QPointF(pointFrom.x()+gap,pointFrom.y());
484 if (pointFrom.y() == pointTo.y()) {
485 //cout << "drawing straight line" << endl;
486 pathPaint.lineTo(pointTo);
490 //cout << "drawing a staircase" << endl;
491 // sufficient place to draw a simple staircase
492 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointFrom.y());
495 interPoints.append(p);
496 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointTo.y());
499 interPoints.append(p);
500 pathPaint.lineTo(pointTo);
502 p = QPointF(pointTo.x()-gap,pointTo.y());
505 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
507 if (orientationFrom == Parameters::North) gap = -gap;
509 p = QPointF(pointFrom.x(),pointFrom.y()+gap);
512 if (pointFrom.x() == pointTo.x()) {
513 //cout << "drawing straight line" << endl;
514 pathPaint.lineTo(pointTo);
517 //cout << "drawing a staircase" << endl;
518 // sufficient place to draw a simple staircase
519 p = QPointF(pointFrom.x(),(pointFrom.y()+pointTo.y())/2.0);
522 interPoints.append(p);
523 p = QPointF(pointTo.x(),(pointFrom.y()+pointTo.y())/2.0);
526 interPoints.append(p);
527 pathPaint.lineTo(pointTo);
529 p = QPointF(pointTo.x(),pointTo.y()-gap);
533 pathShape = pps.createStroke(s);
538 A Corner has the following shape :
543 void ConnectionItem::computeCorner(int orientationFrom) {
545 pathPaint = QPainterPath(pointFrom);
549 double gap = marginConn;
551 //cout << "drawing a corner" << endl;
553 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
554 if (orientationFrom == Parameters::West) gap = -gap;
555 p = QPointF(pointFrom.x()+gap,pointFrom.y());
557 p = QPointF(pointTo.x(),pointFrom.y());
560 interPoints.append(p);
561 pathPaint.lineTo(pointTo);
562 p = QPointF(pointTo.x(),pointTo.y()-gap);
565 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
566 if (orientationFrom == Parameters::North) gap = -gap;
567 p = QPointF(pointFrom.x(),pointFrom.y()+gap);
569 p = QPointF(pointFrom.x(),pointTo.y());
572 interPoints.append(p);
573 pathPaint.lineTo(pointTo);
574 p = QPointF(pointTo.x()-gap,pointTo.y());
578 pathShape = pps.createStroke(s);
583 A OpenRect has the following shape :
588 Its beginning and end have always a size of marginConn
590 void ConnectionItem::computeOpenRect(int orientationFrom, int orientationTo) {
591 pathPaint = QPainterPath(pointFrom);
594 double gap1 = marginConn;
595 double gap2 = marginConn;
597 //cout << "drawing an OpenRect" << endl;
599 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
600 if (orientationFrom == Parameters::West) {
603 if (orientationTo == Parameters::North) {
606 p = QPointF(pointFrom.x()+gap1,pointFrom.y());
609 interPoints.append(p);
610 p = QPointF(pointFrom.x()+gap1,pointTo.y()+gap2);
613 interPoints.append(p);
614 p = QPointF(pointTo.x(),pointTo.y()+gap2);
617 interPoints.append(p);
618 pathPaint.lineTo(pointTo);
621 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
622 if (orientationFrom == Parameters::North) {
625 if (orientationTo == Parameters::West) {
628 p = QPointF(pointFrom.x(),pointFrom.y()+gap1);
631 interPoints.append(p);
632 p = QPointF(pointTo.x()+gap2,pointFrom.y()+gap1);
635 interPoints.append(p);
636 p = QPointF(pointTo.x()+gap2,pointTo.y());
639 interPoints.append(p);
640 pathPaint.lineTo(pointTo);
643 pathShape = pps.createStroke(s);
647 /* drawHookSmallEnd():
649 A Hook has the following shape :
653 Its end has always a size of marginConn
655 void ConnectionItem::computeHookSmallEnd(int orientationFrom, int orientationTo) {
656 pathPaint = QPainterPath(pointFrom);
660 double gap2 = marginConn;
661 double gap1 = marginConn;
662 //cout << "drawing a Hook with small end" << endl;
664 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
666 if (orientationFrom == Parameters::West) gap1 = -gap1;
667 if (orientationTo == Parameters::North) gap2 = -gap2;
669 p = QPointF(pointFrom.x()+gap1,pointFrom.y());
671 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointFrom.y());
674 interPoints.append(p);
675 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointTo.y()+gap2);
678 interPoints.append(p);
679 p = QPointF(pointTo.x(),pointTo.y()+gap2);
682 interPoints.append(p);
683 pathPaint.lineTo(pointTo);
686 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
688 if (orientationFrom == Parameters::North) gap1 = -gap1;
689 if (orientationTo == Parameters::West) gap2 = -gap2;
691 p = QPointF(pointFrom.x(),pointFrom.y()+gap1);
693 p = QPointF(pointFrom.x(),(pointFrom.y()+pointTo.y())/2.0);
696 interPoints.append(p);
697 p = QPointF(pointTo.x()+gap2,(pointFrom.y()+pointTo.y())/2.0);
700 interPoints.append(p);
701 p = QPointF(pointTo.x()+gap2,pointTo.y());
704 interPoints.append(p);
705 pathPaint.lineTo(pointTo);
708 pathShape = pps.createStroke(s);
711 /* drawHookSmallStart():
713 A Hook has the following shape :
717 Its start has always a size of marginConn
719 void ConnectionItem::computeHookSmallStart(int orientationFrom, int orientationTo) {
720 pathPaint = QPainterPath(pointFrom);
724 double gap1 = marginConn;
725 double gap2 = marginConn;
726 //cout << "drawing a Hook with small start" << endl;
728 if ((orientationFrom == Parameters::East)||(orientationFrom == Parameters::West)) {
730 if (orientationFrom == Parameters::West) gap1 = -gap1;
731 if (orientationTo == Parameters::North) gap2 = -gap2;
733 p = QPointF(pointFrom.x()+gap1,pointFrom.y());
736 interPoints.append(p);
737 p = QPointF(pointFrom.x()+gap1,(pointFrom.y()+pointTo.y())/2.0);
740 interPoints.append(p);
741 p = QPointF(pointTo.x(),(pointFrom.y()+pointTo.y())/2.0);
744 interPoints.append(p);
745 pathPaint.lineTo(pointTo);
746 p = QPointF(pointTo.x(),pointFrom.y()+gap2);
749 else if ((orientationFrom == Parameters::South)||(orientationFrom == Parameters::North)) {
751 if (orientationFrom == Parameters::North) gap1 = -gap1;
752 if (orientationTo == Parameters::West) gap2 = -gap2;
754 p = QPointF(pointFrom.x(),pointFrom.y()+gap1);
757 interPoints.append(p);
758 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointFrom.y()+gap1);
761 interPoints.append(p);
762 p = QPointF((pointFrom.x()+pointTo.x())/2.0,pointTo.y());
765 interPoints.append(p);
766 pathPaint.lineTo(pointTo);
767 p = QPointF(pointTo.x()+gap2,pointFrom.y());
771 pathShape = pps.createStroke(s);
776 An Elle has the following shape :
781 void ConnectionItem::computeElle(int orientationFrom) {
783 pathPaint = QPainterPath(pointFrom);
787 double gap = marginConn;
791 if ((orientationFrom == Parameters::North) || (orientationFrom == Parameters::South)) {
792 double diffPos = pointFrom.y() - pointTo.y();
793 if (orientationFrom == Parameters::North) {
797 p = QPointF(pointFrom.x(),pointFrom.y()+gap);
799 if (diffPos >= 0.0) {
801 interPoints.append(p);
802 p = QPointF(pointTo.x(),pointFrom.y()+gap);
805 interPoints.append(p);
806 pathPaint.lineTo(pointTo);
807 p = QPointF(pointTo.x(),pointTo.y()+gap);
811 p = QPointF(pointFrom.x(),pointTo.y()+gap);
814 interPoints.append(p);
815 p = QPointF(pointTo.x(),pointTo.y()+gap);
818 interPoints.append(p);
819 pathPaint.lineTo(pointTo);
822 else if ((orientationFrom == Parameters::West) || (orientationFrom == Parameters::East)) {
823 double diffPos = pointFrom.x() - pointTo.x();
824 if (orientationFrom == Parameters::West) {
828 p = QPointF(pointFrom.x()+gap,pointFrom.y());
830 if (diffPos >= 0.0) {
832 interPoints.append(p);
833 p = QPointF(pointTo.x()+gap,pointFrom.y());
836 interPoints.append(p);
837 pathPaint.lineTo(pointTo);
838 p = QPointF(pointTo.x()+gap,pointTo.y());
842 p = QPointF(pointFrom.x()+gap,pointTo.y());
845 interPoints.append(p);
846 p = QPointF(pointTo.x()+gap,pointTo.y());
849 interPoints.append(p);
850 pathPaint.lineTo(pointTo);
855 pathShape = pps.createStroke(s);
858 void ConnectionItem::setSelected(bool selected) {
859 this->selected = selected;
867 void ConnectionItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
868 QGraphicsItem::mousePressEvent(event);
869 setZValue(zValue()+100);
870 setSelected(!selected);
871 update(boundingRect());
874 void ConnectionItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
875 QGraphicsItem::mouseReleaseEvent(event);
876 setZValue(zValue()-100);
879 void ConnectionItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
880 QGraphicsItem::mouseMoveEvent(event);
883 void ConnectionItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
884 /* have to check if the connection can be removed.
885 If the from or to InterfaceItem is owned by a group item, and this item
886 is both connected to and from, thus it is impossible to remove this connection
887 because there would be a group interface alone and not connected and this situation is not allowed.
889 Nevertheless, there are 2 exceptions :
890 - a from group interface is connected to more than one input interface
891 - the connection is between a source block outside the top group and the top group
893 bool canRemove = true;
895 if (fromInterfaceItem->getOwner()->isGroupItem()) {
896 ConnectedInterface* ref = fromInterfaceItem->refInter;
897 if ((ref->isConnectedFrom()) && (ref->getConnectedTo().length() == 1)) {
901 else if ((toInterfaceItem->getOwner()->isGroupItem()) && (! toInterfaceItem->getOwner()->getRefBlock()->isTopGroupBlock())) {
902 ConnectedInterface* ref = toInterfaceItem->refInter;
903 if ((ref->isConnectedFrom()) && (ref->isConnectedTo())) {
910 QAction* titleAction = menu.addAction("Connection operations");
911 titleAction->setEnabled(false);
913 QAction* removeAction = menu.addAction("Remove");
914 QAction * selectedAction= menu.exec(event->screenPos());
916 if(selectedAction == removeAction){
917 dispatcher->removeConnection(Dispatcher::Design, this);
922 void ConnectionItem::prepareChange() {
923 prepareGeometryChange();
926 QDataStream &operator <<(QDataStream &out, ConnectionItem &c) {
927 out.setVersion(QDataStream::Qt_4_8);
930 QDataStream toWrite(&connData, QIODevice::WriteOnly);
933 toWrite << c.getFromInterfaceItem()->getId();
934 toWrite << c.getToInterfaceItem()->getId();
941 QDataStream &operator >>(QDataStream &in, ConnectionItem &c) {
942 in.setVersion(QDataStream::Qt_4_8);