Skip to content

Commit 497d6ef

Browse files
committed
Minor clean ups
1 parent 421ab4f commit 497d6ef

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

src/app/qgsstatusbarmagnifierwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@
2323
#include "qgsstatusbarmagnifierwidget.h"
2424
#include "qgsdoublespinbox.h"
2525

26-
QgsStatusBarMagnifierWidget::QgsStatusBarMagnifierWidget( QWidget* parent ) :
27-
QWidget( parent )
26+
QgsStatusBarMagnifierWidget::QgsStatusBarMagnifierWidget( QWidget* parent )
27+
: QWidget( parent )
2828
{
2929
QSettings settings;
3030
int minimumFactor = ( int ) 100 * settings.value( "/qgis/magnifier_factor_min", 0.1 ).toDouble();
3131
int maximumFactor = ( int ) 100 * settings.value( "/qgis/magnifier_factor_max", 10 ).toDouble();
3232
int defaultFactor = ( int ) 100 * settings.value( "/qgis/magnifier_factor_default", 1.0 ).toDouble();
3333

3434
// label
35-
mLabel = new QLabel( this );
35+
mLabel = new QLabel();
3636
mLabel->setMinimumWidth( 10 );
3737
mLabel->setMargin( 3 );
3838
mLabel->setAlignment( Qt::AlignCenter );
3939
mLabel->setFrameStyle( QFrame::NoFrame );
4040
mLabel->setText( tr( "Magnifier" ) );
4141
mLabel->setToolTip( tr( "Magnifier" ) );
4242

43-
mSpinBox = new QgsDoubleSpinBox( this );
43+
mSpinBox = new QgsDoubleSpinBox();
4444
mSpinBox->setSuffix( "%" );
4545
mSpinBox->setKeyboardTracking( false );
4646
mSpinBox->setMaximumWidth( 120 );

src/app/qgsstatusbarmagnifierwidget.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ class APP_EXPORT QgsStatusBarMagnifierWidget : public QWidget
3737

3838
/** Constructor
3939
* @param parent is the parent widget
40-
* @param canvas the map canvas
4140
*/
42-
QgsStatusBarMagnifierWidget( QWidget* parent = 0 );
41+
QgsStatusBarMagnifierWidget( QWidget* parent = nullptr );
4342

4443
/** Destructor */
4544
virtual ~QgsStatusBarMagnifierWidget();

src/app/qgsstatusbarscalewidget.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ QgsStatusBarScaleWidget::QgsStatusBarScaleWidget( QgsMapCanvas *canvas, QWidget
3030
, mMapCanvas( canvas )
3131
{
3232
// add a label to show current scale
33-
mLabel = new QLabel( QString(), this );
34-
mLabel->setObjectName( "mScaleLable" );
33+
mLabel = new QLabel();
34+
mLabel->setObjectName( "mScaleLabel" );
3535
mLabel->setMinimumWidth( 10 );
3636
//mScaleLabel->setMaximumHeight( 20 );
3737
mLabel->setMargin( 3 );
@@ -40,7 +40,7 @@ QgsStatusBarScaleWidget::QgsStatusBarScaleWidget( QgsMapCanvas *canvas, QWidget
4040
mLabel->setText( tr( "Scale" ) );
4141
mLabel->setToolTip( tr( "Current map scale" ) );
4242

43-
mScale = new QgsScaleComboBox( this );
43+
mScale = new QgsScaleComboBox();
4444
mScale->setObjectName( "mScaleEdit" );
4545
// seems setFont() change font only for popup not for line edit,
4646
// so we need to set font for it separately
@@ -49,7 +49,7 @@ QgsStatusBarScaleWidget::QgsStatusBarScaleWidget( QgsMapCanvas *canvas, QWidget
4949
mScale->setWhatsThis( tr( "Displays the current map scale" ) );
5050
mScale->setToolTip( tr( "Current map scale (formatted as x:y)" ) );
5151

52-
mLockButton = new QToolButton( this );
52+
mLockButton = new QToolButton();
5353
mLockButton->setIcon( QIcon( QgsApplication::getThemeIcon( "/locked.svg" ) ) );
5454
mLockButton->setToolTip( tr( "Lock the scale to use magnifier to zoom in or out." ) );
5555
mLockButton->setCheckable( true );
@@ -80,7 +80,7 @@ void QgsStatusBarScaleWidget::setScale( double scale )
8080
mScale->setScale( scale );
8181
}
8282

83-
bool QgsStatusBarScaleWidget::isLocked()
83+
bool QgsStatusBarScaleWidget::isLocked() const
8484
{
8585
return mLockButton->isChecked();
8686
}
@@ -96,7 +96,7 @@ void QgsStatusBarScaleWidget::updateScales( const QStringList &scales )
9696
mScale->updateScales( scales );
9797
}
9898

99-
void QgsStatusBarScaleWidget::userScale()
99+
void QgsStatusBarScaleWidget::userScale() const
100100
{
101101
// Why has MapCanvas the scale inverted?
102102
mMapCanvas->zoomScale( 1.0 / mScale->scale() );

src/app/qgsstatusbarscalewidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class APP_EXPORT QgsStatusBarScaleWidget : public QWidget
5252
* @brief isLocked check if the scale should be locked to use magnifier instead of scale to zoom in/out
5353
* @return True if the scale shall be locked
5454
*/
55-
bool isLocked();
55+
bool isLocked() const;
5656

5757
/** Set the font of the text
5858
* @param font the font to use
@@ -63,7 +63,7 @@ class APP_EXPORT QgsStatusBarScaleWidget : public QWidget
6363
void updateScales( const QStringList &scales = QStringList() );
6464

6565
private slots:
66-
void userScale();
66+
void userScale() const;
6767

6868
signals:
6969
void scaleLockChanged( bool );

src/core/qgsmaprenderercustompainterjob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void QgsMapRendererCustomPainterJob::start()
7474
#ifndef QT_NO_DEBUG
7575
QPaintDevice* thePaintDevice = mPainter->device();
7676
QString errMsg = QString( "pre-set DPI not equal to painter's DPI (%1 vs %2)" ).arg( thePaintDevice->logicalDpiX() ).arg( mSettings.outputDpi() );
77-
Q_ASSERT_X( thePaintDevice->logicalDpiX() == mSettings.outputDpi(), "Job::startRender()", errMsg.toAscii().data() );
77+
Q_ASSERT_X( qgsDoubleNear( thePaintDevice->logicalDpiX(), mSettings.outputDpi() ), "Job::startRender()", errMsg.toAscii().data() );
7878
#endif
7979

8080
delete mLabelingEngine;

0 commit comments

Comments
 (0)