Skip to content

Commit 6151459

Browse files
committed
Merge pull request #1577 from RossGammon/master
Description: Fix qreal VS double issues.
2 parents 890f921 + 79b3a8f commit 6151459

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

python/core/composer/qgsatlascomposition.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ public:
155155
* @see setPredefinedScales
156156
* @see QgsComposerMap::atlasScalingMode
157157
*/
158-
const QVector<double>& predefinedScales() const;
158+
const QVector<qreal>& predefinedScales() const;
159159

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

168168
/** Begins the rendering. Returns true if successful, false if no matching atlas
169169
features found.*/

src/app/composer/qgscomposer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3629,7 +3629,7 @@ void QgsComposer::loadAtlasPredefinedScalesFromProject()
36293629
return;
36303630
}
36313631
QgsAtlasComposition& atlasMap = mComposition->atlasComposition();
3632-
QVector<double> pScales;
3632+
QVector<qreal> pScales;
36333633
// first look at project's scales
36343634
QStringList scales( QgsProject::instance()->readListEntry( "Scales", "/ScalesList" ) );
36353635
bool hasProjectScales( QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" ) );

src/core/composer/qgsatlascomposition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ void QgsAtlasComposition::prepareMap( QgsComposerMap* map )
506506
// choose one of the predefined scales
507507
double newWidth = mOrigExtent.width();
508508
double newHeight = mOrigExtent.height();
509-
const QVector<double>& scales = mPredefinedScales;
509+
const QVector<qreal>& scales = mPredefinedScales;
510510
for ( int i = 0; i < scales.size(); i++ )
511511
{
512512
double ratio = scales[i] / originalScale;
@@ -768,7 +768,7 @@ bool QgsAtlasComposition::evalFeatureFilename()
768768
return true;
769769
}
770770

771-
void QgsAtlasComposition::setPredefinedScales( const QVector<double>& scales )
771+
void QgsAtlasComposition::setPredefinedScales( const QVector<qreal>& scales )
772772
{
773773
mPredefinedScales = scales;
774774
// make sure the list is sorted

src/core/composer/qgsatlascomposition.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
183183
* @see setPredefinedScales
184184
* @see QgsComposerMap::atlasScalingMode
185185
*/
186-
const QVector<double>& predefinedScales() const { return mPredefinedScales; }
186+
const QVector<qreal>& predefinedScales() const { return mPredefinedScales; }
187187

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

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

338338
//list of predefined scales
339-
QVector<double> mPredefinedScales;
339+
QVector<qreal> mPredefinedScales;
340340
};
341341

342342
#endif

src/gui/qgscomposerview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
865865
else
866866
{
867867
QgsComposerAttributeTable* newTable = new QgsComposerAttributeTable( composition() );
868-
newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), 15.0 ) ) );
868+
newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), (qreal)15.0 ) ) );
869869
QList<const QgsComposerMap*> mapItemList = composition()->composerMapItems();
870870
if ( mapItemList.size() > 0 )
871871
{

0 commit comments

Comments
 (0)