Skip to content

Commit 1572314

Browse files
committedJun 21, 2018
Fix some warnings
1 parent 757949b commit 1572314

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed
 

‎src/app/layout/qgslayoutdesignerdialog.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
246246

247247
connect( mActionOptions, &QAction::triggered, this, [ = ]
248248
{
249-
QgisApp::instance()->showOptionsDialog( this, QString( "mOptionsPageComposer" ) );
249+
QgisApp::instance()->showOptionsDialog( this, QStringLiteral( "mOptionsPageComposer" ) );
250250
} );
251251

252252
mView = new QgsLayoutView();
@@ -322,7 +322,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
322322
mActionsToolbar->addWidget( resizeToolButton );
323323

324324
QToolButton *atlasExportToolButton = new QToolButton( mAtlasToolbar );
325-
atlasExportToolButton->setIcon( QgsApplication::getThemeIcon( "mActionExport.svg" ) );
325+
atlasExportToolButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionExport.svg" ) ) );
326326
atlasExportToolButton->setPopupMode( QToolButton::InstantPopup );
327327
atlasExportToolButton->setAutoRaise( true );
328328
atlasExportToolButton->setToolButtonStyle( Qt::ToolButtonIconOnly );
@@ -1462,7 +1462,7 @@ void QgsLayoutDesignerDialog::updateStatusZoom()
14621462
zoomLevel = mView->transform().m11() * 100 / scale100;
14631463
}
14641464
whileBlocking( mStatusZoomCombo )->lineEdit()->setText( tr( "%1%" ).arg( zoomLevel, 0, 'f', 1 ) );
1465-
whileBlocking( mStatusZoomSlider )->setValue( zoomLevel );
1465+
whileBlocking( mStatusZoomSlider )->setValue( static_cast< int >( zoomLevel ) );
14661466
}
14671467

14681468
void QgsLayoutDesignerDialog::updateStatusCursorPos( QPointF position )
@@ -1544,7 +1544,7 @@ void QgsLayoutDesignerDialog::dockVisibilityChanged( bool visible )
15441544
}
15451545
}
15461546

1547-
void QgsLayoutDesignerDialog::undoRedoOccurredForItems( const QSet<QString> itemUuids )
1547+
void QgsLayoutDesignerDialog::undoRedoOccurredForItems( const QSet<QString> &itemUuids )
15481548
{
15491549
mBlockItemOptions = true;
15501550

@@ -2327,7 +2327,7 @@ void QgsLayoutDesignerDialog::printAtlas()
23272327
progressDialog->setWindowTitle( tr( "Printing Atlas" ) );
23282328
connect( feedback.get(), &QgsFeedback::progressChanged, this, [ & ]( double progress )
23292329
{
2330-
progressDialog->setValue( progress );
2330+
progressDialog->setValue( static_cast< int >( progress ) );
23312331
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;
23322332

23332333
#ifdef Q_OS_LINUX
@@ -2498,7 +2498,7 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster()
24982498
progressDialog->setWindowTitle( tr( "Exporting Atlas" ) );
24992499
connect( feedback.get(), &QgsFeedback::progressChanged, this, [ & ]( double progress )
25002500
{
2501-
progressDialog->setValue( progress );
2501+
progressDialog->setValue( static_cast< int >( progress ) );
25022502
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;
25032503

25042504
#ifdef Q_OS_LINUX
@@ -2649,7 +2649,7 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg()
26492649
progressDialog->setWindowTitle( tr( "Exporting Atlas" ) );
26502650
connect( feedback.get(), &QgsFeedback::progressChanged, this, [ & ]( double progress )
26512651
{
2652-
progressDialog->setValue( progress );
2652+
progressDialog->setValue( static_cast< int >( progress ) );
26532653
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;
26542654

26552655
#ifdef Q_OS_LINUX
@@ -2856,7 +2856,7 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
28562856
progressDialog->setWindowTitle( tr( "Exporting Atlas" ) );
28572857
connect( feedback.get(), &QgsFeedback::progressChanged, this, [ & ]( double progress )
28582858
{
2859-
progressDialog->setValue( progress );
2859+
progressDialog->setValue( static_cast< int >( progress ) );
28602860
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;
28612861

28622862
#ifdef Q_OS_LINUX
@@ -3499,12 +3499,12 @@ void QgsLayoutDesignerDialog::restoreWindowState()
34993499

35003500
if ( !restoreState( settings.value( QStringLiteral( "LayoutDesigner/state" ), QByteArray::fromRawData( reinterpret_cast< const char * >( defaultLayerDesignerUIstate ), sizeof defaultLayerDesignerUIstate ), QgsSettings::App ).toByteArray() ) )
35013501
{
3502-
QgsDebugMsg( "restore of layout UI state failed" );
3502+
QgsDebugMsg( QStringLiteral( "restore of layout UI state failed" ) );
35033503
}
35043504
// restore window geometry
35053505
if ( !restoreGeometry( settings.value( QStringLiteral( "LayoutDesigner/geometry" ), QgsSettings::App ).toByteArray() ) )
35063506
{
3507-
QgsDebugMsg( "restore of layout UI geometry failed" );
3507+
QgsDebugMsg( QStringLiteral( "restore of layout UI geometry failed" ) );
35083508
// default to 80% of screen size, at 10% from top left corner
35093509
resize( QDesktopWidget().availableGeometry( this ).size() * 0.8 );
35103510
QSize pos = QDesktopWidget().availableGeometry( this ).size() * 0.1;
@@ -3727,11 +3727,11 @@ bool QgsLayoutDesignerDialog::showFileSizeWarning()
37273727
// Image size
37283728
double oneInchInLayoutUnits = mLayout->convertToLayoutUnits( QgsLayoutMeasurement( 1, QgsUnitTypes::LayoutInches ) );
37293729
QSizeF maxPageSize = mLayout->pageCollection()->maximumPageSize();
3730-
int width = ( int )( mLayout->renderContext().dpi() * maxPageSize.width() / oneInchInLayoutUnits );
3731-
int height = ( int )( mLayout->renderContext().dpi() * maxPageSize.height() / oneInchInLayoutUnits );
3730+
int width = static_cast< int >( mLayout->renderContext().dpi() * maxPageSize.width() / oneInchInLayoutUnits );
3731+
int height = static_cast< int >( mLayout->renderContext().dpi() * maxPageSize.height() / oneInchInLayoutUnits );
37323732
int memuse = width * height * 3 / 1000000; // pixmap + image
3733-
QgsDebugMsg( QString( "Image %1x%2" ).arg( width ).arg( height ) );
3734-
QgsDebugMsg( QString( "memuse = %1" ).arg( memuse ) );
3733+
QgsDebugMsg( QStringLiteral( "Image %1x%2" ).arg( width ).arg( height ) );
3734+
QgsDebugMsg( QStringLiteral( "memuse = %1" ).arg( memuse ) );
37353735

37363736
if ( memuse > 400 ) // about 4500x4500
37373737
{
@@ -4165,7 +4165,7 @@ void QgsLayoutDesignerDialog::updateWindowTitle()
41654165
setWindowTitle( title );
41664166
}
41674167

4168-
void QgsLayoutDesignerDialog::selectItems( const QList<QgsLayoutItem *> items )
4168+
void QgsLayoutDesignerDialog::selectItems( const QList<QgsLayoutItem *> &items )
41694169
{
41704170
for ( QGraphicsItem *item : items )
41714171
{

‎src/app/layout/qgslayoutdesignerdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
132132
/**
133133
* Selects the specified \a items.
134134
*/
135-
void selectItems( QList< QgsLayoutItem * > items );
135+
void selectItems( const QList<QgsLayoutItem *> &items );
136136

137137
/**
138138
* Returns the designer's message bar.
@@ -309,7 +309,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
309309
void addPages();
310310
void statusMessageReceived( const QString &message );
311311
void dockVisibilityChanged( bool visible );
312-
void undoRedoOccurredForItems( QSet< QString > itemUuids );
312+
void undoRedoOccurredForItems( const QSet< QString > &itemUuids );
313313
void saveAsTemplate();
314314
void addItemsFromTemplate();
315315
void duplicate();

0 commit comments

Comments
 (0)
Please sign in to comment.