class timingSignal: public QwtIntervalSymbol
{
public:
virtual void draw
( QPainter * painter, Qt
::Orientation o,
const QPointF
& from,
const QPointF
& to
) const {
// 2----------3
// 1 / \ 4
// \ /
// 6------------5
polygon << from // 1
<<
QPointF(from.
x()+10 , from.
y()-10) // 2 <<
QPointF(to.
x() -10 , to.
y() -10) // 3 << to // 4
<<
QPointF(to.
x() -10 , to.
y() +10) // 6 <<
QPointF(from.
x()+10 , from.
y()+10);
// 7
///QwtPainter::drawText(painter, from, "blubb");
pen.setWidth(2);
// pen.setStyle(Qt::SolidLine);
// pen.setBrush(Qt::red);
pen.setCapStyle(Qt::SquareCap);
pen.setJoinStyle(Qt::RoundJoin);
painter
->setBrush
(QBrush(QColor(120,
120,
120,
200),Qt
::SolidPattern));
painter->setPen(pen);
}
};
class timingSignal: public QwtIntervalSymbol
{
public:
virtual void draw( QPainter * painter, Qt::Orientation o, const QPointF& from, const QPointF& to ) const
{
// 2----------3
// 1 / \ 4
// \ /
// 6------------5
QPolygonF polygon;
polygon << from // 1
<< QPointF(from.x()+10 , from.y()-10) // 2
<< QPointF(to.x() -10 , to.y() -10) // 3
<< to // 4
<< QPointF(to.x() -10 , to.y() +10) // 6
<< QPointF(from.x()+10 , from.y()+10); // 7
///QwtPainter::drawText(painter, from, "blubb");
QPen pen;
pen.setWidth(2);
// pen.setStyle(Qt::SolidLine);
// pen.setBrush(Qt::red);
pen.setCapStyle(Qt::SquareCap);
pen.setJoinStyle(Qt::RoundJoin);
painter->setBrush(QBrush(QColor(120,120,120,200),Qt::SolidPattern));
painter->setPen(pen);
QwtPainter::drawPolygon( painter, polygon);
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks