27 #include <QGraphicsSceneMouseEvent>
28 #include <QApplication>
38 using namespace YACS::ENGINE;
39 using namespace YACS::HMI;
43 QString label,
Subject *subject)
61 DEBTRACE(
" SceneObserverItem::update " <<
eventName(event)<<
" " << type <<
" " << son);
65 DEBTRACE(
"SceneObserverItem::update EMPHASIZE " << type);
70 QGraphicsItem::update();
79 DEBTRACE(
"SceneObserverItem::select " <<
_label.toStdString() <<
" " << isSelected);
86 else setSelected(
false);
91 DEBTRACE(
"SceneObserverItem::getToolTip");
98 val = item->
data(0, Qt::ToolTipRole).toString();
104 DEBTRACE(
"SceneObserverItem::mousePressEvent " <<
_label.toStdString()
105 <<
" " << acceptedMouseButtons ());
111 setCursor(Qt::ClosedHandCursor);
113 _dragModifier=
event->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier);
128 if (QLineF(event->screenPos(),
130 < QApplication::startDragDistance())
135 QDrag *drag =
new QDrag(event->widget());
137 drag->setMimeData(mime);
141 mime->setControl(
false);
143 mime->setControl(
true);
145 QPixmap pixmap(34, 34);
146 pixmap.fill(Qt::white);
148 QPainter painter(&pixmap);
149 painter.translate(15, 15);
150 painter.setRenderHint(QPainter::Antialiasing);
151 paint(&painter, 0, 0);
154 pixmap.setMask(pixmap.createHeuristicMask());
156 drag->setPixmap(pixmap);
157 drag->setHotSpot(QPoint(15, 20));
161 setCursor(Qt::ArrowCursor);
171 setCursor(Qt::ArrowCursor);
192 DEBTRACE(
"SceneObserverItem::activateSelection " <<
_label.toStdString()<<
" " << selected);
203 return "yacs/subject";