Skip to content

Commit cc08771

Browse files
committed
Fix clang-tidy warnings
1 parent a14ddc8 commit cc08771

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/qgsvectorlayerproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
233233

234234
if ( mLayer->dataProvider() )//enable spatial index button group if supported by provider
235235
{
236-
int capabilities = mLayer->dataProvider()->capabilities();
236+
QgsVectorDataProvider::Capabilities capabilities = mLayer->dataProvider()->capabilities();
237237
if ( !( capabilities & QgsVectorDataProvider::CreateSpatialIndex ) )
238238
{
239239
pbnIndex->setEnabled( false );
@@ -1669,7 +1669,7 @@ void QgsVectorLayerProperties::updateAuxiliaryStoragePage()
16691669
mAuxiliaryStorageKeyLineEdit->setText( alayer->joinInfo().targetFieldName() );
16701670

16711671
// update feature count
1672-
int features = alayer->featureCount();
1672+
long features = alayer->featureCount();
16731673
mAuxiliaryStorageFeaturesLineEdit->setText( QString::number( features ) );
16741674

16751675
// update actions

src/core/qgsmaprendererjob.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ bool QgsMapRendererJob::prepareLabelCache() const
8787

8888
// calculate which layers will be labeled
8989
QSet< QgsMapLayer * > labeledLayers;
90-
Q_FOREACH ( const QgsMapLayer *ml, mSettings.layers() )
90+
const QList<QgsMapLayer *> layers = mSettings.layers();
91+
for ( const QgsMapLayer *ml : layers )
9192
{
9293
QgsVectorLayer *vl = const_cast< QgsVectorLayer * >( qobject_cast<const QgsVectorLayer *>( ml ) );
9394
if ( vl && QgsPalLabeling::staticWillUseLayer( vl ) )
@@ -314,7 +315,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
314315
job.cached = true;
315316
job.imageInitialized = true;
316317
job.img = new QImage( mCache->cacheImage( ml->id() ) );
317-
job.img->setDevicePixelRatio( mSettings.devicePixelRatio() );
318+
job.img->setDevicePixelRatio( static_cast<qreal>( mSettings.devicePixelRatio() ) );
318319
job.renderer = nullptr;
319320
job.context.setPainter( nullptr );
320321
continue;
@@ -328,7 +329,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
328329
// Flattened image for drawing when a blending mode is set
329330
QImage *mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
330331
mSettings.outputImageFormat() );
331-
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
332+
mypFlattenedImage->setDevicePixelRatio( static_cast<qreal>( mSettings.devicePixelRatio() ) );
332333
if ( mypFlattenedImage->isNull() )
333334
{
334335
mErrors.append( Error( ml->id(), tr( "Insufficient memory for image %1x%2" ).arg( mSettings.outputSize().width() ).arg( mSettings.outputSize().height() ) ) );

0 commit comments

Comments
 (0)