From f708cbd948571762b27713146ff4daaba1ab1eb6 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 3 Dec 2024 11:52:33 +1000 Subject: [PATCH] Remove duplicate map canvas member in subclass, use base class member instead --- src/gui/labeling/qgslabelinggui.cpp | 8 ++++---- src/gui/labeling/qgslabelinggui.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/labeling/qgslabelinggui.cpp b/src/gui/labeling/qgslabelinggui.cpp index b88f86b89453..280929abb4ad 100644 --- a/src/gui/labeling/qgslabelinggui.cpp +++ b/src/gui/labeling/qgslabelinggui.cpp @@ -41,9 +41,9 @@ QgsExpressionContext QgsLabelingGui::createExpressionContext() const { QgsExpressionContext expContext; - if ( mCanvas ) + if ( mMapCanvas ) { - expContext = mCanvas->createExpressionContext(); + expContext = mMapCanvas->createExpressionContext(); } else { @@ -275,9 +275,9 @@ QgsLabelingGui::QgsLabelingGui( QgsMapLayer *layer, QgsMapCanvas *mapCanvas, con mFieldExpressionWidget->registerExpressionContextGenerator( this ); - mMinScaleWidget->setMapCanvas( mCanvas ); + mMinScaleWidget->setMapCanvas( mMapCanvas ); mMinScaleWidget->setShowCurrentScaleButton( true ); - mMaxScaleWidget->setMapCanvas( mCanvas ); + mMaxScaleWidget->setMapCanvas( mMapCanvas ); mMaxScaleWidget->setShowCurrentScaleButton( true ); mGeometryGeneratorExpressionButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); diff --git a/src/gui/labeling/qgslabelinggui.h b/src/gui/labeling/qgslabelinggui.h index 99c17d13ce7d..36f38b368707 100644 --- a/src/gui/labeling/qgslabelinggui.h +++ b/src/gui/labeling/qgslabelinggui.h @@ -87,7 +87,6 @@ class GUI_EXPORT QgsLabelingGui : public QgsTextFormatWidget QgsPalLayerSettings mSettings; LabelMode mMode; QgsFeature mPreviewFeature; - QgsMapCanvas *mCanvas = nullptr; QgsLabelObstacleSettings mObstacleSettings; QgsLabelLineSettings mLineSettings;