47 #include <QStaticText>
57 using namespace DISPLIB;
65 QPointF channelPosition,
70 : m_sChannelName(channelName)
71 , m_iChannelNumber(channelNumber)
72 , m_qpChannelPosition(channelPosition)
73 , m_cChannelColor(channelColor)
74 , m_bHighlightItem(false)
75 , m_iChannelKind(channelKind)
76 , m_iChannelUnit(channelUnit)
77 , m_bIsBadChannel(bIsBadChannel)
79 this->setAcceptHoverEvents(
true);
80 this->setFlag(QGraphicsItem::ItemIsSelectable,
true);
87 return QRectF(-25, -30, 50, 50);
93 const QStyleOptionGraphicsItem *option,
102 painter->setPen(Qt::NoPen);
103 painter->setBrush(Qt::darkGray);
104 painter->drawEllipse(-12, -12, 30, 30);
108 painter->setBrush(Qt::red);
109 painter->drawEllipse(-15, -15, 30, 30);
112 painter->drawEllipse(-15, -15, 30, 30);
116 if(this->isSelected()){
118 painter->setPen(QPen(Qt::red, 5));
119 painter->drawEllipse(-15, -15, 30, 30);
140 painter->setPen(QPen(Qt::black, 1));
142 QSizeF sizeText = staticElectrodeName.size();
143 painter->drawStaticText(-15+((30-sizeText.width())/2), -32, staticElectrodeName);