Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 21, 2018
1 parent 757949b commit 1572314
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -246,7 +246,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla

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

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

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

void QgsLayoutDesignerDialog::updateStatusCursorPos( QPointF position )
Expand Down Expand Up @@ -1544,7 +1544,7 @@ void QgsLayoutDesignerDialog::dockVisibilityChanged( bool visible )
}
}

void QgsLayoutDesignerDialog::undoRedoOccurredForItems( const QSet<QString> itemUuids )
void QgsLayoutDesignerDialog::undoRedoOccurredForItems( const QSet<QString> &itemUuids )
{
mBlockItemOptions = true;

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

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

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

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

#ifdef Q_OS_LINUX
Expand Down Expand Up @@ -3499,12 +3499,12 @@ void QgsLayoutDesignerDialog::restoreWindowState()

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

if ( memuse > 400 ) // about 4500x4500
{
Expand Down Expand Up @@ -4165,7 +4165,7 @@ void QgsLayoutDesignerDialog::updateWindowTitle()
setWindowTitle( title );
}

void QgsLayoutDesignerDialog::selectItems( const QList<QgsLayoutItem *> items )
void QgsLayoutDesignerDialog::selectItems( const QList<QgsLayoutItem *> &items )
{
for ( QGraphicsItem *item : items )
{
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout/qgslayoutdesignerdialog.h
Expand Up @@ -132,7 +132,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
/**
* Selects the specified \a items.
*/
void selectItems( QList< QgsLayoutItem * > items );
void selectItems( const QList<QgsLayoutItem *> &items );

/**
* Returns the designer's message bar.
Expand Down Expand Up @@ -309,7 +309,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
void addPages();
void statusMessageReceived( const QString &message );
void dockVisibilityChanged( bool visible );
void undoRedoOccurredForItems( QSet< QString > itemUuids );
void undoRedoOccurredForItems( const QSet< QString > &itemUuids );
void saveAsTemplate();
void addItemsFromTemplate();
void duplicate();
Expand Down

0 comments on commit 1572314

Please sign in to comment.