31 #include <QtGui/QBrush>
32 #include <QGraphicsScene>
45 this->setAcceptHoverEvents(
true);
46 this->setFlag(QGraphicsItem::ItemIsFocusable,
true);
57 this->setPen(QPen(color));
58 this->setBrush(QBrush(color));
67 if(qGray(pen().color().rgb()) > 255/2)
73 _placeHolder->setBrush(QBrush(QColor ( 255, 255, 255, 170 )));
76 text->setDefaultTextColor(this->pen().color().rgb());
78 int octave =
_kpt.octave & 255;
79 octave = octave < 128 ? octave : (-128 | octave);
80 float scale = octave >= 0 ? 1.f/(1 << octave) : (
float)(1 << -octave);
83 text->setPlainText(QString(
"Id = %1\n"
94 text->setPlainText(QString(
"Id = %1\n"
112 QPen pen = this->pen();
113 this->setPen(QPen(pen.color(),
_width+2));
125 this->setPen(QPen(pen().color(),
_width));
130 QGraphicsScene * scene = this->scene();
131 if(scene && scene->focusItem() == 0)
137 this->setPen(QPen(pen().color(),
_width+2));
139 QGraphicsEllipseItem::hoverEnterEvent(event);
144 if(!this->hasFocus())
148 QGraphicsEllipseItem::hoverEnterEvent(event);
154 QGraphicsEllipseItem::focusInEvent(event);
160 QGraphicsEllipseItem::focusOutEvent(event);