1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
From: Ross Gammon <rossgammon@mail.dk>
Date: Fri, 5 Sep 2014 20:45:46 +0200
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. sip doesn't seem to like the type
QVector<double> on platforms where qreal is float.
.
Upstream do not believe changing the type to qreal will have knock-on
impacts on the native code and recommend applying the patch. It will
hopefully be merged upstream soon.
Forwarded: http://hub.qgis.org/issues/11148
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760535
Author: Peter Michael Green <plugwash@debian.org>
---
python/core/composer/qgsatlascomposition.sip | 4 ++--
src/app/composer/qgscomposer.cpp | 2 +-
src/core/composer/qgsatlascomposition.cpp | 4 ++--
src/core/composer/qgsatlascomposition.h | 6 +++---
src/gui/qgscomposerview.cpp | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
--- a/python/core/composer/qgsatlascomposition.sip
+++ b/python/core/composer/qgsatlascomposition.sip
@@ -155,7 +155,7 @@ 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.
@@ -163,7 +163,7 @@ public:
* @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.*/
--- a/src/app/composer/qgscomposer.cpp
+++ b/src/app/composer/qgscomposer.cpp
@@ -3594,7 +3594,7 @@ void QgsComposer::loadAtlasPredefinedSca
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" ) );
--- a/src/core/composer/qgsatlascomposition.cpp
+++ b/src/core/composer/qgsatlascomposition.cpp
@@ -491,7 +491,7 @@ void QgsAtlasComposition::prepareMap( Qg
// 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;
@@ -747,7 +747,7 @@ bool QgsAtlasComposition::evalFeatureFil
return true;
}
-void QgsAtlasComposition::setPredefinedScales( const QVector<double>& scales )
+void QgsAtlasComposition::setPredefinedScales( const QVector<qreal>& scales )
{
mPredefinedScales = scales;
// make sure the list is sorted
--- a/src/core/composer/qgsatlascomposition.h
+++ b/src/core/composer/qgsatlascomposition.h
@@ -183,7 +183,7 @@ class CORE_EXPORT QgsAtlasComposition :
* @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.
@@ -191,7 +191,7 @@ class CORE_EXPORT QgsAtlasComposition :
* @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.*/
@@ -320,7 +320,7 @@ class CORE_EXPORT QgsAtlasComposition :
void computeExtent( QgsComposerMap *map );
//list of predefined scales
- QVector<double> mPredefinedScales;
+ QVector<qreal> mPredefinedScales;
};
#endif
--- a/src/gui/qgscomposerview.cpp
+++ b/src/gui/qgscomposerview.cpp
@@ -869,7 +869,7 @@ void QgsComposerView::mouseReleaseEvent(
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 )
{
|