Skip to content
Permalink
Browse files

Description: Fix qreal VS double issues.

 This patch tries to fix qreal VS double issues for ARM

 There are two seperate issues, the first is trivial just a typecast on
 a const.

 The second is however less-trivial and needs to be checked
 before merging. sip doesn't seem to like the type
 QVector<double> on platforms where qreal is float but changing
 the type to qreal may have knock-on impacts on the native code.

 QGIS Issue: http://hub.qgis.org/issues/11148
 Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760535

Author: Peter Michael Green <plugwash@debian.org>
  • Loading branch information
RossGammon committed Sep 5, 2014
1 parent 86987b5 commit 79b3a8f88937bf57190e1297213781af4ed2bbe7
@@ -155,15 +155,15 @@ public:
* @see setPredefinedScales
* @see QgsComposerMap::atlasScalingMode
*/
const QVector<double>& predefinedScales() const;
const QVector<qreal>& predefinedScales() const;

/**Sets the list of predefined scales for the atlas. This is used
* for maps which are set to the predefined atlas scaling mode.
* @param scales a vector of doubles representing predefined scales
* @see predefinedScales
* @see QgsComposerMap::atlasScalingMode
*/
void setPredefinedScales( const QVector<double>& scales );
void setPredefinedScales( const QVector<qreal>& scales );

/** Begins the rendering. Returns true if successful, false if no matching atlas
features found.*/
@@ -3629,7 +3629,7 @@ void QgsComposer::loadAtlasPredefinedScalesFromProject()
return;
}
QgsAtlasComposition& atlasMap = mComposition->atlasComposition();
QVector<double> pScales;
QVector<qreal> pScales;
// first look at project's scales
QStringList scales( QgsProject::instance()->readListEntry( "Scales", "/ScalesList" ) );
bool hasProjectScales( QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" ) );
@@ -506,7 +506,7 @@ void QgsAtlasComposition::prepareMap( QgsComposerMap* map )
// choose one of the predefined scales
double newWidth = mOrigExtent.width();
double newHeight = mOrigExtent.height();
const QVector<double>& scales = mPredefinedScales;
const QVector<qreal>& scales = mPredefinedScales;
for ( int i = 0; i < scales.size(); i++ )
{
double ratio = scales[i] / originalScale;
@@ -768,7 +768,7 @@ bool QgsAtlasComposition::evalFeatureFilename()
return true;
}

void QgsAtlasComposition::setPredefinedScales( const QVector<double>& scales )
void QgsAtlasComposition::setPredefinedScales( const QVector<qreal>& scales )
{
mPredefinedScales = scales;
// make sure the list is sorted
@@ -183,15 +183,15 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
* @see setPredefinedScales
* @see QgsComposerMap::atlasScalingMode
*/
const QVector<double>& predefinedScales() const { return mPredefinedScales; }
const QVector<qreal>& predefinedScales() const { return mPredefinedScales; }

/**Sets the list of predefined scales for the atlas. This is used
* for maps which are set to the predefined atlas scaling mode.
* @param scales a vector of doubles representing predefined scales
* @see predefinedScales
* @see QgsComposerMap::atlasScalingMode
*/
void setPredefinedScales( const QVector<double>& scales );
void setPredefinedScales( const QVector<qreal>& scales );

/** Begins the rendering. Returns true if successful, false if no matching atlas
features found.*/
@@ -336,7 +336,7 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
void computeExtent( QgsComposerMap *map );

//list of predefined scales
QVector<double> mPredefinedScales;
QVector<qreal> mPredefinedScales;
};

#endif
@@ -865,7 +865,7 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
else
{
QgsComposerAttributeTable* newTable = new QgsComposerAttributeTable( composition() );
newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), 15.0 ) ) );
newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), (qreal)15.0 ) ) );
QList<const QgsComposerMap*> mapItemList = composition()->composerMapItems();
if ( mapItemList.size() > 0 )
{

0 comments on commit 79b3a8f

Please sign in to comment.
You can’t perform that action at this time.