41 #include "../scalingview.h"
51 #include <QStaticText>
61 using namespace DISPLIB;
69 const QPointF &channelPosition,
73 : m_sChannelName(channelName)
74 , m_iChannelNumber(channelNumber)
75 , m_iChannelKind(channelKind)
76 , m_iChannelUnit(channelUnit)
77 , m_iTotalNumberChannels(0)
82 , m_qpChannelPosition(channelPosition)
83 , m_colorDefault(color)
97 void AverageSceneItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
106 void AverageSceneItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
115 void AverageSceneItem::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget)
123 painter->setRenderHint(QPainter::Antialiasing,
true);
126 painter->setOpacity(0.20);
146 pen.setColor(Qt::red);
149 QFont f = painter->font();
153 painter->setPen(pen);
179 QPointF qSamplePosition;
182 for(
int dataIndex = 0; dataIndex <
m_lAverageData.size(); ++dataIndex) {
187 const double* averageData =
m_lAverageData.at(dataIndex).second.first;
206 pen.setStyle(Qt::SolidLine);
214 painter->setPen(pen);
216 for(
int i = 0; i < totalCols && path.elementCount() <=
boundingRect.width(); i += dsFactor) {
223 qSamplePosition.setX(path.currentPosition().x()+1);
225 qSamplePosition.setY(-val);
226 qSamplePosition.setX(path.currentPosition().x()+1);
229 path.lineTo(qSamplePosition);
232 painter->drawPath(path);
256 pen.setStyle(Qt::SolidLine);
257 pen.setColor(Qt::red);
259 painter->setPen(pen);
269 painter->drawPath(path);