Skip to content
Permalink
Browse files

Merge pull request #1577 from RossGammon/master

Description: Fix qreal VS double issues.
  • Loading branch information
jef-n committed Sep 10, 2014
2 parents 890f921 + 79b3a8f commit 615145951898d11f8193e5cd3cf798143560bfd0
@@ -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 6151459

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