Fix qreal vs double.

In qt4 on arm architectures qreal is defined as float while on other
architectures it is defined as double. This can cause problems if qreal
and double are carelessly mixed.

In this particular case the problem is that qMin/qMax are templates defined
to take two parameters of the same type. If two different types are passed
in then C++ can't resolve what type the template parameter should be and
bails out. The fix is simple, typecast one of the parameters so they
match.

Author: Peter Michael Green <plugwash@debian.org>
Bug-Debian: http://bugs.debian.org/737814
This commit is contained in:
Bas Couwenberg 2014-03-28 10:39:35 +01:00
parent 03b028dbf7
commit 7db6ae5412
2 changed files with 3 additions and 3 deletions

View File

@ -433,7 +433,7 @@ void QwtPolarCurve::drawLines( QPainter *painter,
if ( !clipRect.isEmpty() )
{
double off = qCeil( qMax( 1.0, painter->pen().widthF() ) );
double off = qCeil( qMax((qreal)1.0,painter->pen().widthF() ) );
clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
polyline = QwtClipper::clipPolygonF( clipRect, polyline );
}

View File

@ -278,7 +278,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
// We don't allow vertical legends to take more than
// half of the available space.
dim = qMin( hint.width(), rect.width() * d_data->legendRatio );
dim = qMin( hint.width(), (qreal)(rect.width() * d_data->legendRatio) );
if ( !( options & IgnoreScrollbars ) )
{
@ -293,7 +293,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
}
else
{
dim = qMin( hint.height(), rect.height() * d_data->legendRatio );
dim = qMin( hint.height(), (qreal)(rect.height() * d_data->legendRatio) );
dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
}