qwt_scale_draw.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_scale_draw.h"
#include "qwt_scale_div.h"
#include "qwt_scale_map.h"
#include "qwt_math.h"
#include "qwt_painter.h"
#include "qwt_text.h"
#include <qpainter.h>
#include <qpaintengine.h>
#include <qmath.h>
static inline double qwtEffectivePenWidth( const QwtAbstractScaleDraw* scaleDraw )
{
return qwtMaxF( scaleDraw->penWidthF(), 1.0 );
}
namespace QwtScaleRendererReal
{
inline qreal penWidth( const QPainter* painter, const QwtScaleDraw* scaleDraw )
{
qreal width = scaleDraw->penWidthF();
#if 1
if ( width <= 0.0 )
width = 1.0;
#endif
if ( painter->pen().isCosmetic() )
{
const QTransform& transform = painter->transform();
switch ( scaleDraw->alignment() )
{
case QwtScaleDraw::LeftScale:
case QwtScaleDraw::RightScale:
{
width /= transform.m11();
break;
}
case QwtScaleDraw::TopScale:
case QwtScaleDraw::BottomScale:
{
width /= transform.m22();
break;
}
}
}
return width;
}
inline void drawBackbone( QPainter* painter, const QwtScaleDraw* scaleDraw )
{
const qreal pw2 = 0.5 * penWidth( painter, scaleDraw );
const QPointF pos = scaleDraw->pos();
const qreal length = scaleDraw->length();
switch ( scaleDraw->alignment() )
{
case QwtScaleDraw::LeftScale:
{
const qreal x = pos.x() + 1.0 - pw2;
QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + length );
break;
}
case QwtScaleDraw::RightScale:
{
const qreal x = pos.x() - 1.0 + pw2;
QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + length );
break;
}
case QwtScaleDraw::TopScale:
{
const qreal y = pos.y() + 1.0 - pw2;
QwtPainter::drawLine( painter, pos.x(), y, pos.x() + length, y );
break;
}
case QwtScaleDraw::BottomScale:
{
const qreal y = pos.y() - 1.0 + pw2;
QwtPainter::drawLine( painter, pos.x(), y, pos.x() + length, y );
break;
}
}
}
inline void drawTick( QPainter* painter,
const QwtScaleDraw* scaleDraw, qreal tickPos, qreal tickLength )
{
const QPointF pos = scaleDraw->pos();
qreal pw = 0.0;
if ( scaleDraw->hasComponent( QwtScaleDraw::Backbone ) )
pw = penWidth( painter, scaleDraw );
const qreal length = tickLength + pw;
/*
Those correction offsets have been found by try and error.
They need to be understood and replaced by a calculation,
that makes sense. TODO ...
*/
const qreal off1 = 1.0;
const qreal off2 = ( scaleDraw->penWidthF() <= 0.0 ) ? 0.5 : 0.0;
switch ( scaleDraw->alignment() )
{
case QwtScaleDraw::LeftScale:
{
const qreal x = pos.x() + off1 - off2;
QwtPainter::drawLine( painter, x, tickPos, x - length, tickPos );
break;
}
case QwtScaleDraw::RightScale:
{
const qreal x = pos.x() - off1 + off2;
QwtPainter::drawLine( painter, x, tickPos, x + length, tickPos );
break;
}
case QwtScaleDraw::TopScale:
{
const qreal y = pos.y() + off1 - 2 * off2;
QwtPainter::drawLine( painter, tickPos, y, tickPos, y - length );
break;
}
case QwtScaleDraw::BottomScale:
{
const qreal y = pos.y() - off1 + off2;
QwtPainter::drawLine( painter, tickPos, y, tickPos, y + length );
break;
}
}
}
}
namespace QwtScaleRendererInt
{
inline void drawBackbone( QPainter* painter, const QwtScaleDraw* scaleDraw )
{
const int pw = qMax( qRound( scaleDraw->penWidthF() ), 1 );
const qreal length = scaleDraw->length();
const QPointF pos = scaleDraw->pos();
switch ( scaleDraw->alignment() )
{
case QwtScaleDraw::LeftScale:
{
const qreal x = qRound( pos.x() - ( pw - 1 ) / 2 );
QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + length );
break;
}
case QwtScaleDraw::RightScale:
{
const qreal x = qRound( pos.x() + pw / 2 );
QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + length );
break;
}
case QwtScaleDraw::TopScale:
{
const qreal y = qRound( pos.y() - ( pw - 1 ) / 2 );
QwtPainter::drawLine( painter, pos.x(), y, pos.x() + length, y );
break;
}
case QwtScaleDraw::BottomScale:
{
const qreal y = qRound( pos.y() + pw / 2 );
QwtPainter::drawLine( painter, pos.x(), y, pos.x() + length, y );
break;
}
}
}
inline void drawTick( QPainter* painter,
const QwtScaleDraw* scaleDraw, qreal tickPos, qreal tickLength )
{
const QPointF pos = scaleDraw->pos();
tickPos = qRound( tickPos );
int pw = 0;
if ( scaleDraw->hasComponent( QwtScaleDraw::Backbone ) )
pw = qMax( qRound( scaleDraw->penWidthF() ), 1 );
int len = qMax( qRound( tickLength ), 1 );
// the width of ticks at the borders might extent the backbone
len += pw;
if ( painter->pen().capStyle() == Qt::FlatCap )
len++; // the end point is not rendered
qreal off = 0.0;
if ( painter->paintEngine()->type() == QPaintEngine::X11 )
{
if ( pw == 1 )
{
// In opposite to raster, X11 paints the end point
off = 1.0;
}
}
switch ( scaleDraw->alignment() )
{
case QwtScaleDraw::LeftScale:
{
const qreal x1 = qRound( pos.x() ) + 1;
const qreal x2 = x1 - len + 1;
QwtPainter::drawLine( painter, x2, tickPos, x1 - off, tickPos );
break;
}
case QwtScaleDraw::RightScale:
{
const qreal x1 = qRound( pos.x() );
const qreal x2 = x1 + len - 1;
QwtPainter::drawLine( painter, x1, tickPos, x2 - off, tickPos );
break;
}
case QwtScaleDraw::BottomScale:
{
const qreal y1 = qRound( pos.y() );
const qreal y2 = y1 + len - 1;
QwtPainter::drawLine( painter, tickPos, y1, tickPos, y2 - off );
break;
}
case QwtScaleDraw::TopScale:
{
const qreal y1 = qRound( pos.y() );
const qreal y2 = y1 - len + 1;
QwtPainter::drawLine( painter, tickPos, y2 + 1, tickPos, y1 + 1 - off );
break;
}
}
}
}
class QwtScaleDraw::PrivateData
{
public:
PrivateData()
: len( 0 )
, alignment( QwtScaleDraw::BottomScale )
, labelRotation( 0.0 )
{
}
QPointF pos;
double len;
Alignment alignment;
Qt::Alignment labelAlignment;
double labelRotation;
};
QwtScaleDraw::QwtScaleDraw()
{
m_data = new QwtScaleDraw::PrivateData;
setLength( 100 );
}
QwtScaleDraw::~QwtScaleDraw()
{
delete m_data;
}
QwtScaleDraw::Alignment QwtScaleDraw::alignment() const
{
return m_data->alignment;
}
void QwtScaleDraw::setAlignment( Alignment align )
{
m_data->alignment = align;
}
Qt::Orientation QwtScaleDraw::orientation() const
{
switch ( m_data->alignment )
{
case TopScale:
case BottomScale:
return Qt::Horizontal;
case LeftScale:
case RightScale:
default:
return Qt::Vertical;
}
}
void QwtScaleDraw::getBorderDistHint(
const QFont& font, int& start, int& end ) const
{
start = 0;
end = 1.0;
if ( !hasComponent( QwtAbstractScaleDraw::Labels ) )
return;
const QList< double >& ticks = scaleDiv().ticks( QwtScaleDiv::MajorTick );
if ( ticks.count() == 0 )
return;
// Find the ticks, that are mapped to the borders.
// minTick is the tick, that is mapped to the top/left-most position
// in widget coordinates.
double minTick = ticks[0];
double minPos = scaleMap().transform( minTick );
double maxTick = minTick;
double maxPos = minPos;
for ( int i = 1; i < ticks.count(); i++ )
{
const double tickPos = scaleMap().transform( ticks[i] );
if ( tickPos < minPos )
{
minTick = ticks[i];
minPos = tickPos;
}
if ( tickPos > scaleMap().transform( maxTick ) )
{
maxTick = ticks[i];
maxPos = tickPos;
}
}
double e = 0.0;
double s = 0.0;
if ( orientation() == Qt::Vertical )
{
s = -labelRect( font, minTick ).top();
s -= qAbs( minPos - qRound( scaleMap().p2() ) );
e = labelRect( font, maxTick ).bottom();
e -= qAbs( maxPos - scaleMap().p1() );
}
else
{
s = -labelRect( font, minTick ).left();
s -= qAbs( minPos - scaleMap().p1() );
e = labelRect( font, maxTick ).right();
e -= qAbs( maxPos - scaleMap().p2() );
}
if ( s < 0.0 )
s = 0.0;
if ( e < 0.0 )
e = 0.0;
start = qwtCeil( s );
end = qwtCeil( e );
}
int QwtScaleDraw::minLabelDist( const QFont& font ) const
{
if ( !hasComponent( QwtAbstractScaleDraw::Labels ) )
return 0;
const QList< double >& ticks = scaleDiv().ticks( QwtScaleDiv::MajorTick );
if ( ticks.isEmpty() )
return 0;
const QFontMetrics fm( font );
const bool vertical = ( orientation() == Qt::Vertical );
QRectF bRect1;
QRectF bRect2 = labelRect( font, ticks[0] );
if ( vertical )
{
bRect2.setRect( -bRect2.bottom(), 0.0, bRect2.height(), bRect2.width() );
}
double maxDist = 0.0;
for ( int i = 1; i < ticks.count(); i++ )
{
bRect1 = bRect2;
bRect2 = labelRect( font, ticks[i] );
if ( vertical )
{
bRect2.setRect( -bRect2.bottom(), 0.0,
bRect2.height(), bRect2.width() );
}
double dist = fm.leading(); // space between the labels
if ( bRect1.right() > 0 )
dist += bRect1.right();
if ( bRect2.left() < 0 )
dist += -bRect2.left();
if ( dist > maxDist )
maxDist = dist;
}
double angle = qwtRadians( labelRotation() );
if ( vertical )
angle += M_PI / 2;
const double sinA = qFastSin( angle ); // qreal -> double
if ( qFuzzyCompare( sinA + 1.0, 1.0 ) )
return qCeil( maxDist );
const int fmHeight = fm.ascent() - 2;
// The distance we need until there is
// the height of the label font. This height is needed
// for the neighbored label.
double labelDist = fmHeight / qFastSin( angle ) * qFastCos( angle );
if ( labelDist < 0 )
labelDist = -labelDist;
// For text orientations close to the scale orientation
if ( labelDist > maxDist )
labelDist = maxDist;
// For text orientations close to the opposite of the
// scale orientation
if ( labelDist < fmHeight )
labelDist = fmHeight;
return qCeil( labelDist );
}
double QwtScaleDraw::extent( const QFont& font ) const
{
double d = 0;
if ( hasComponent( QwtAbstractScaleDraw::Labels ) )
{
if ( orientation() == Qt::Vertical )
d = maxLabelWidth( font );
else
d = maxLabelHeight( font );
if ( d > 0 )
d += spacing();
}
if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
{
d += maxTickLength();
}
if ( hasComponent( QwtAbstractScaleDraw::Backbone ) )
{
d += qwtEffectivePenWidth( this );
}
d = qwtMaxF( d, minimumExtent() );
return d;
}
int QwtScaleDraw::minLength( const QFont& font ) const
{
int startDist, endDist;
getBorderDistHint( font, startDist, endDist );
const QwtScaleDiv& sd = scaleDiv();
const uint minorCount =
sd.ticks( QwtScaleDiv::MinorTick ).count() +
sd.ticks( QwtScaleDiv::MediumTick ).count();
const uint majorCount =
sd.ticks( QwtScaleDiv::MajorTick ).count();
int lengthForLabels = 0;
if ( hasComponent( QwtAbstractScaleDraw::Labels ) )
lengthForLabels = minLabelDist( font ) * majorCount;
int lengthForTicks = 0;
if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
{
const double pw = qwtEffectivePenWidth( this );
lengthForTicks = qCeil( ( majorCount + minorCount ) * ( pw + 1.0 ) );
}
return startDist + endDist + qMax( lengthForLabels, lengthForTicks );
}
QPointF QwtScaleDraw::labelPosition( double value ) const
{
const double tval = scaleMap().transform( value );
double dist = spacing();
if ( hasComponent( QwtAbstractScaleDraw::Backbone ) )
dist += qwtEffectivePenWidth( this );
if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
dist += tickLength( QwtScaleDiv::MajorTick );
double px = 0;
double py = 0;
switch ( alignment() )
{
case RightScale:
{
px = m_data->pos.x() + dist;
py = tval;
break;
}
case LeftScale:
{
px = m_data->pos.x() - dist;
py = tval;
break;
}
case BottomScale:
{
px = tval;
py = m_data->pos.y() + dist;
break;
}
case TopScale:
{
px = tval;
py = m_data->pos.y() - dist;
break;
}
}
return QPointF( px, py );
}
void QwtScaleDraw::drawTick( QPainter* painter, double value, double len ) const
{
if ( len <= 0 )
return;
const double tval = scaleMap().transform( value );
if ( QwtPainter::roundingAlignment( painter ) )
QwtScaleRendererInt::drawTick( painter, this, tval, len );
else
QwtScaleRendererReal::drawTick( painter, this, tval, len );
}
void QwtScaleDraw::drawBackbone( QPainter* painter ) const
{
if ( QwtPainter::roundingAlignment( painter ) )
QwtScaleRendererInt::drawBackbone( painter, this );
else
QwtScaleRendererReal::drawBackbone( painter, this );
}
void QwtScaleDraw::move( const QPointF& pos )
{
m_data->pos = pos;
updateMap();
}
QPointF QwtScaleDraw::pos() const
{
return m_data->pos;
}
void QwtScaleDraw::setLength( double length )
{
#if 0
if ( length >= 0 && length < 10 )
length = 10;
// why should we accept negative lengths ???
if ( length < 0 && length > -10 )
length = -10;
#else
length = qwtMaxF( length, 10.0 );
#endif
m_data->len = length;
updateMap();
}
double QwtScaleDraw::length() const
{
return m_data->len;
}
void QwtScaleDraw::drawLabel( QPainter* painter, double value ) const
{
QwtText lbl = tickLabel( painter->font(), value );
if ( lbl.isEmpty() )
return;
QPointF pos = labelPosition( value );
QSizeF labelSize = lbl.textSize( painter->font() );
const QTransform transform = labelTransformation( pos, labelSize );
painter->save();
painter->setWorldTransform( transform, true );
lbl.draw ( painter, QRect( QPoint( 0, 0 ), labelSize.toSize() ) );
painter->restore();
}
QRect QwtScaleDraw::boundingLabelRect( const QFont& font, double value ) const
{
QwtText lbl = tickLabel( font, value );
if ( lbl.isEmpty() )
return QRect();
const QPointF pos = labelPosition( value );
QSizeF labelSize = lbl.textSize( font );
const QTransform transform = labelTransformation( pos, labelSize );
return transform.mapRect( QRect( QPoint( 0, 0 ), labelSize.toSize() ) );
}
QTransform QwtScaleDraw::labelTransformation(
const QPointF& pos, const QSizeF& size ) const
{
QTransform transform;
transform.translate( pos.x(), pos.y() );
transform.rotate( labelRotation() );
int flags = labelAlignment();
if ( flags == 0 )
{
switch ( alignment() )
{
case RightScale:
{
if ( flags == 0 )
flags = Qt::AlignRight | Qt::AlignVCenter;
break;
}
case LeftScale:
{
if ( flags == 0 )
flags = Qt::AlignLeft | Qt::AlignVCenter;
break;
}
case BottomScale:
{
if ( flags == 0 )
flags = Qt::AlignHCenter | Qt::AlignBottom;
break;
}
case TopScale:
{
if ( flags == 0 )
flags = Qt::AlignHCenter | Qt::AlignTop;
break;
}
}
}
double x, y;
if ( flags & Qt::AlignLeft )
x = -size.width();
else if ( flags & Qt::AlignRight )
x = 0.0;
else // Qt::AlignHCenter
x = -( 0.5 * size.width() );
if ( flags & Qt::AlignTop )
y = -size.height();
else if ( flags & Qt::AlignBottom )
y = 0;
else // Qt::AlignVCenter
y = -( 0.5 * size.height() );
transform.translate( x, y );
return transform;
}
QRectF QwtScaleDraw::labelRect( const QFont& font, double value ) const
{
QwtText lbl = tickLabel( font, value );
if ( lbl.isEmpty() )
return QRectF( 0.0, 0.0, 0.0, 0.0 );
const QPointF pos = labelPosition( value );
const QSizeF labelSize = lbl.textSize( font );
const QTransform transform = labelTransformation( pos, labelSize );
QRectF br = transform.mapRect( QRectF( QPointF( 0, 0 ), labelSize ) );
br.translate( -pos.x(), -pos.y() );
return br;
}
QSizeF QwtScaleDraw::labelSize( const QFont& font, double value ) const
{
return labelRect( font, value ).size();
}
void QwtScaleDraw::setLabelRotation( double rotation )
{
m_data->labelRotation = rotation;
}
double QwtScaleDraw::labelRotation() const
{
return m_data->labelRotation;
}
void QwtScaleDraw::setLabelAlignment( Qt::Alignment alignment )
{
m_data->labelAlignment = alignment;
}
Qt::Alignment QwtScaleDraw::labelAlignment() const
{
return m_data->labelAlignment;
}
int QwtScaleDraw::maxLabelWidth( const QFont& font ) const
{
double maxWidth = 0.0;
const QList< double >& ticks = scaleDiv().ticks( QwtScaleDiv::MajorTick );
for ( int i = 0; i < ticks.count(); i++ )
{
const double v = ticks[i];
if ( scaleDiv().contains( v ) )
{
const double w = labelSize( font, ticks[i] ).width();
if ( w > maxWidth )
maxWidth = w;
}
}
return qCeil( maxWidth );
}
int QwtScaleDraw::maxLabelHeight( const QFont& font ) const
{
double maxHeight = 0.0;
const QList< double >& ticks = scaleDiv().ticks( QwtScaleDiv::MajorTick );
for ( int i = 0; i < ticks.count(); i++ )
{
const double v = ticks[i];
if ( scaleDiv().contains( v ) )
{
const double h = labelSize( font, ticks[i] ).height();
if ( h > maxHeight )
maxHeight = h;
}
}
return qCeil( maxHeight );
}
void QwtScaleDraw::updateMap()
{
const QPointF pos = m_data->pos;
double len = m_data->len;
QwtScaleMap& sm = scaleMap();
if ( orientation() == Qt::Vertical )
sm.setPaintInterval( pos.y() + len, pos.y() );
else
sm.setPaintInterval( pos.x(), pos.x() + len );
}
QList< double >
QwtAbstractScaleDraw
A abstract base class for drawing scales.
Definition: qwt_abstract_scale_draw.h:32
QwtAbstractScaleDraw::scaleMap
const QwtScaleMap & scaleMap() const
Definition: qwt_abstract_scale_draw.cpp:121
QwtAbstractScaleDraw::Ticks
@ Ticks
Ticks.
Definition: qwt_abstract_scale_draw.h:45
QwtAbstractScaleDraw::Backbone
@ Backbone
Backbone = the line where the ticks are located.
Definition: qwt_abstract_scale_draw.h:42
QwtAbstractScaleDraw::Labels
@ Labels
Labels.
Definition: qwt_abstract_scale_draw.h:48
QwtAbstractScaleDraw::tickLength
double tickLength(QwtScaleDiv::TickType) const
Definition: qwt_abstract_scale_draw.cpp:338
QwtAbstractScaleDraw::hasComponent
bool hasComponent(ScaleComponent) const
Definition: qwt_abstract_scale_draw.cpp:95
QwtAbstractScaleDraw::tickLabel
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
Definition: qwt_abstract_scale_draw.cpp:393
QwtAbstractScaleDraw::maxTickLength
double maxTickLength() const
Definition: qwt_abstract_scale_draw.cpp:355
QwtAbstractScaleDraw::minimumExtent
double minimumExtent() const
Definition: qwt_abstract_scale_draw.cpp:302
QwtAbstractScaleDraw::penWidthF
qreal penWidthF() const
Definition: qwt_abstract_scale_draw.cpp:156
QwtAbstractScaleDraw::scaleDiv
const QwtScaleDiv & scaleDiv() const
Definition: qwt_abstract_scale_draw.cpp:133
QwtAbstractScaleDraw::spacing
double spacing() const
Get the spacing.
Definition: qwt_abstract_scale_draw.cpp:271
QwtPainter::roundingAlignment
static bool roundingAlignment()
Definition: qwt_painter.h:183
QwtPainter::drawLine
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
Definition: qwt_painter.h:154
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:34
QwtScaleDiv::ticks
QList< double > ticks(int tickType) const
Definition: qwt_scale_div.cpp:309
QwtScaleDiv::MediumTick
@ MediumTick
Medium ticks.
Definition: qwt_scale_div.h:46
QwtScaleDiv::MinorTick
@ MinorTick
Minor ticks.
Definition: qwt_scale_div.h:43
QwtScaleDiv::MajorTick
@ MajorTick
Major ticks.
Definition: qwt_scale_div.h:49
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:36
QwtScaleDraw::setLength
void setLength(double length)
Definition: qwt_scale_draw.cpp:732
QwtScaleDraw::boundingLabelRect
QRect boundingLabelRect(const QFont &, double value) const
Find the bounding rectangle for the label.
Definition: qwt_scale_draw.cpp:798
QwtScaleDraw::labelTransformation
QTransform labelTransformation(const QPointF &, const QSizeF &) const
Definition: qwt_scale_draw.cpp:821
QwtScaleDraw::labelAlignment
Qt::Alignment labelAlignment() const
Definition: qwt_scale_draw.cpp:982
QwtScaleDraw::move
void move(double x, double y)
Definition: qwt_scale_draw.h:118
QwtScaleDraw::labelRotation
double labelRotation() const
Definition: qwt_scale_draw.cpp:943
QwtScaleDraw::drawLabel
virtual void drawLabel(QPainter *, double value) const override
Definition: qwt_scale_draw.cpp:766
QwtScaleDraw::extent
virtual double extent(const QFont &) const override
Definition: qwt_scale_draw.cpp:523
QwtScaleDraw::getBorderDistHint
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
Definition: qwt_scale_draw.cpp:361
QwtScaleDraw::setLabelAlignment
void setLabelAlignment(Qt::Alignment)
Change the label flags.
Definition: qwt_scale_draw.cpp:973
QwtScaleDraw::minLength
int minLength(const QFont &) const
Definition: qwt_scale_draw.cpp:560
QwtScaleDraw::drawTick
virtual void drawTick(QPainter *, double value, double len) const override
Definition: qwt_scale_draw.cpp:649
QwtScaleDraw::length
double length() const
Definition: qwt_scale_draw.cpp:753
QwtScaleDraw::pos
QPointF pos() const
Definition: qwt_scale_draw.cpp:717
QwtScaleDraw::labelPosition
QPointF labelPosition(double value) const
Definition: qwt_scale_draw.cpp:596
QwtScaleDraw::setAlignment
void setAlignment(Alignment)
Definition: qwt_scale_draw.cpp:322
QwtScaleDraw::drawBackbone
virtual void drawBackbone(QPainter *) const override
Definition: qwt_scale_draw.cpp:668
QwtScaleDraw::alignment
Alignment alignment() const
Definition: qwt_scale_draw.cpp:309
QwtScaleDraw::~QwtScaleDraw
virtual ~QwtScaleDraw()
Destructor.
Definition: qwt_scale_draw.cpp:299
QwtScaleDraw::maxLabelHeight
int maxLabelHeight(const QFont &) const
Definition: qwt_scale_draw.cpp:1014
QwtScaleDraw::orientation
Qt::Orientation orientation() const
Definition: qwt_scale_draw.cpp:337
QwtScaleDraw::setLabelRotation
void setLabelRotation(double rotation)
Definition: qwt_scale_draw.cpp:934
QwtScaleDraw::maxLabelWidth
int maxLabelWidth(const QFont &) const
Definition: qwt_scale_draw.cpp:991
QwtScaleDraw::Alignment
Alignment
Definition: qwt_scale_draw.h:43
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:45
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition: qwt_scale_draw.h:48
QwtScaleDraw::RightScale
@ RightScale
The scale is right.
Definition: qwt_scale_draw.h:54
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition: qwt_scale_draw.h:51
QwtScaleDraw::minLabelDist
int minLabelDist(const QFont &) const
Definition: qwt_scale_draw.cpp:436
QwtScaleDraw::QwtScaleDraw
QwtScaleDraw()
Constructor.
Definition: qwt_scale_draw.cpp:292
QwtScaleDraw::labelRect
QRectF labelRect(const QFont &, double value) const
Definition: qwt_scale_draw.cpp:891
QwtScaleDraw::labelSize
QSizeF labelSize(const QFont &, double value) const
Definition: qwt_scale_draw.cpp:916
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:27
QwtScaleMap::transform
double transform(double s) const
Definition: qwt_scale_map.h:137
QwtScaleMap::setPaintInterval
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
Definition: qwt_scale_map.cpp:119
QwtText
A class representing a text.
Definition: qwt_text.h:52
QwtText::textSize
QSizeF textSize() const
Definition: qwt_text.cpp:570
QwtText::isEmpty
bool isEmpty() const
Definition: qwt_text.cpp:739
QwtText::draw
void draw(QPainter *painter, const QRectF &rect) const
Definition: qwt_text.cpp:615