Skip to content

Commit dba353c

Browse files
mbernasocchimhugent
authored andcommittedMar 12, 2013
fix qreal vs double issues
1 parent 4d8f644 commit dba353c

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed
 

‎src/core/composer/qgscomposerlegend.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
9696

9797
setColumns( atomList );
9898

99-
double maxColumnWidth = 0;
99+
qreal maxColumnWidth = 0;
100100
if ( mEqualColumnWidth )
101101
{
102102
foreach ( Atom atom, atomList )
@@ -112,7 +112,7 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
112112
QPointF point( mBoxSpace, columnTop );
113113
bool firstInColumn = true;
114114
double columnMaxHeight = 0;
115-
double columnWidth = 0;
115+
qreal columnWidth = 0;
116116
int column = 0;
117117
foreach ( Atom atom, atomList )
118118
{
@@ -212,8 +212,8 @@ QSizeF QgsComposerLegend::drawTitle( QPainter* painter, QPointF point, Qt::Align
212212
for ( QStringList::Iterator titlePart = lines.begin(); titlePart != lines.end(); ++titlePart )
213213
{
214214
// it does not draw the last world if rectangle width is exactly text width
215-
double width = textWidthMillimeters( mTitleFont, *titlePart ) + 1;
216-
double height = fontAscentMillimeters( mTitleFont ) + fontDescentMillimeters( mTitleFont );
215+
qreal width = textWidthMillimeters( mTitleFont, *titlePart ) + 1;
216+
qreal height = fontAscentMillimeters( mTitleFont ) + fontDescentMillimeters( mTitleFont );
217217

218218
double left = halignment == Qt::AlignLeft ? point.x() : point.x() - width / 2;
219219

@@ -249,7 +249,7 @@ QSizeF QgsComposerLegend::drawGroupItemTitle( QgsComposerGroupItem* groupItem, Q
249249
{
250250
y += fontAscentMillimeters( mGroupFont );
251251
if ( painter ) drawText( painter, point.x(), y, *groupPart, mGroupFont );
252-
double width = textWidthMillimeters( mGroupFont, *groupPart );
252+
qreal width = textWidthMillimeters( mGroupFont, *groupPart );
253253
size.rwidth() = qMax( width, size.width() );
254254
if ( groupPart != lines.end() )
255255
{
@@ -277,7 +277,7 @@ QSizeF QgsComposerLegend::drawLayerItemTitle( QgsComposerLayerItem* layerItem, Q
277277
{
278278
y += fontAscentMillimeters( mLayerFont );
279279
if ( painter ) drawText( painter, point.x(), y, *layerItemPart , mLayerFont );
280-
double width = textWidthMillimeters( mLayerFont, *layerItemPart );
280+
qreal width = textWidthMillimeters( mLayerFont, *layerItemPart );
281281
size.rwidth() = qMax( width, size.width() );
282282
if ( layerItemPart != lines.end() )
283283
{
@@ -401,7 +401,7 @@ QgsComposerLegend::Nucleon QgsComposerLegend::drawSymbolItem( QgsComposerLegendI
401401
for ( QStringList::Iterator itemPart = lines.begin(); itemPart != lines.end(); ++itemPart )
402402
{
403403
if ( painter ) drawText( painter, labelX, labelY, *itemPart , mItemFont );
404-
labelSize.rwidth() = qMax( textWidthMillimeters( mItemFont, *itemPart ), labelSize.width() );
404+
labelSize.rwidth() = qMax( textWidthMillimeters( mItemFont, *itemPart ), double(labelSize.width()) );
405405
if ( itemPart != lines.end() )
406406
{
407407
labelY += mlineSpacing + textHeight;
@@ -1012,7 +1012,7 @@ void QgsComposerLegend::setColumns( QList<Atom>& atomList )
10121012
// Divide atoms to columns
10131013
double totalHeight = 0;
10141014
bool first = true;
1015-
double maxAtomHeight = 0;
1015+
qreal maxAtomHeight = 0;
10161016
foreach ( Atom atom, atomList )
10171017
{
10181018
if ( !first )
@@ -1073,7 +1073,7 @@ void QgsComposerLegend::setColumns( QList<Atom>& atomList )
10731073
}
10741074

10751075
// Alling labels of symbols for each layr/column to the same labelXOffset
1076-
QMap<QString, double> maxSymbolWidth;
1076+
QMap<QString, qreal> maxSymbolWidth;
10771077
for ( int i = 0; i < atomList.size(); i++ )
10781078
{
10791079
for ( int j = 0; j < atomList[i].nucleons.size(); j++ )

‎src/core/composer/qgscomposerlegend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
147147
QColor mFontColor;
148148

149149
/**Space between item box and contents*/
150-
double mBoxSpace;
150+
qreal mBoxSpace;
151151
/**Space between columns*/
152152
double mColumnSpace;
153153
/**Vertical space between group entries*/

‎src/core/qgscoordinatetransform.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,16 @@ void QgsCoordinateTransform::transformPolygon( QPolygonF& poly, TransformDirecti
323323
{
324324
//create x, y arrays
325325
int nVertices = poly.size();
326-
QVector<qreal> x( nVertices );
327-
QVector<qreal> y( nVertices );
328-
QVector<qreal> z( nVertices );
326+
327+
#ifdef ANDROID
328+
QVector<double> x( nVertices );
329+
QVector<double> y( nVertices );
330+
QVector<double> z( nVertices );
331+
#else
332+
QVector<qreal> x( nVertices );
333+
QVector<qreal> y( nVertices );
334+
QVector<qreal> z( nVertices );
335+
#endif
329336

330337
for ( int i = 0; i < nVertices; ++i )
331338
{

0 commit comments

Comments
 (0)
Please sign in to comment.