167 setPen( QPen( color, width, style ) );
201 const QPointF &from,
const QPointF &to )
const 220 if ( ( orientation == Qt::Horizontal )
221 && ( p1.y() == p2.y() ) )
225 const double y = p1.y() - sw / 2;
227 p1.x(), y, p1.x(), y + sw );
229 p2.x(), y, p2.x(), y + sw );
231 else if ( ( orientation == Qt::Vertical )
232 && ( p1.x() == p2.x() ) )
236 const double x = p1.x() - sw / 2;
238 x, p1.y(), x + sw, p1.y() );
240 x, p2.y(), x + sw, p2.y() );
246 const double dx = p2.x() - p1.x();
247 const double dy = p2.y() - p1.y();
248 const double angle = std::atan2( dy, dx ) +
M_PI_2;
249 double dw2 = sw / 2.0;
251 const double cx = qFastCos( angle ) * dw2;
252 const double sy = qFastSin( angle ) * dw2;
255 p1.x() - cx, p1.y() - sy,
256 p1.x() + cx, p1.y() + sy );
258 p2.x() - cx, p2.y() - sy,
259 p2.x() + cx, p2.y() + sy );
272 if ( ( orientation == Qt::Horizontal )
273 && ( p1.y() == p2.y() ) )
279 p1.x(), y, p2.x() - p1.x(), sw );
281 else if ( ( orientation == Qt::Vertical )
282 && ( p1.x() == p2.x() ) )
288 x, p1.y(), sw, p2.y() - p1.y() );
294 const double dx = p2.x() - p1.x();
295 const double dy = p2.y() - p1.y();
296 const double angle = std::atan2( dy, dx ) +
M_PI_2;
297 double dw2 = sw / 2.0;
299 const double cx = qFastCos( angle ) * dw2;
300 const double sy = qFastSin( angle ) * dw2;
303 polygon += QPointF( p1.x() - cx, p1.y() - sy );
304 polygon += QPointF( p1.x() + cx, p1.y() + sy );
305 polygon += QPointF( p2.x() + cx, p2.y() + sy );
306 polygon += QPointF( p2.x() - cx, p2.y() - sy );
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
virtual ~QwtIntervalSymbol()
Destructor.
QwtIntervalSymbol & operator=(const QwtIntervalSymbol &)
Assignment operator.
static qreal effectivePenWidth(const QPen &)
QwtIntervalSymbol::Style style
bool operator!=(const QwtIntervalSymbol &) const
Compare two symbols.
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
QwtIntervalSymbol(Style=NoSymbol)
const QBrush & brush() const
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
A drawing primitive for displaying an interval like an error bar.
static void drawRect(QPainter *, qreal x, qreal y, qreal w, qreal h)
Wrapper for QPainter::drawRect()
virtual void draw(QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
bool operator==(const PrivateData &other) const
No Style. The symbol cannot be drawn.
bool operator==(const QwtIntervalSymbol &) const
Compare two symbols.
void setBrush(const QBrush &)
Assign a brush.
static bool roundingAlignment()