mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Fix various clazy warnings
This commit is contained in:
parent
1b5fb70647
commit
861c5115eb
@ -60,7 +60,7 @@ Similar to rule-based 2D renderer and rule-based labeling, it allows specificati
|
||||
public:
|
||||
|
||||
typedef QList<QgsRuleBased3DRenderer::Rule *> RuleList;
|
||||
typedef QMap<const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler *> RuleToHandlerMap;
|
||||
typedef QHash<const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler *> RuleToHandlerMap;
|
||||
|
||||
class Rule
|
||||
{
|
||||
|
@ -442,7 +442,7 @@ Qt3DCore::QEntity *QgsRuleBased3DRenderer::createEntity( const Qgs3DMapSettings
|
||||
for ( QgsFeature3DHandler *handler : handlers.values() )
|
||||
handler->finalize( entity, context );
|
||||
|
||||
qDeleteAll( handlers.values() );
|
||||
qDeleteAll( handlers );
|
||||
|
||||
return entity;
|
||||
|
||||
|
@ -64,7 +64,7 @@ class _3D_EXPORT QgsRuleBased3DRenderer : public QgsAbstract3DRenderer
|
||||
|
||||
class Rule;
|
||||
typedef QList<QgsRuleBased3DRenderer::Rule *> RuleList;
|
||||
typedef QMap<const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler *> RuleToHandlerMap;
|
||||
typedef QHash<const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler *> RuleToHandlerMap;
|
||||
|
||||
/**
|
||||
* \ingroup 3d
|
||||
|
@ -248,7 +248,6 @@ void QgsMeshCalcUtils::populateMaskFilter( QgsMeshMemoryDatasetGroup &filter, co
|
||||
std::shared_ptr<QgsMeshMemoryDataset> output = create( filter );
|
||||
output->time = mTimes[0];
|
||||
|
||||
const QVector<int> trianglesToNativeFaces = triangularMesh()->trianglesToNativeFaces();
|
||||
const QVector<QgsMeshVertex> &vertices = triangularMesh()->vertices();
|
||||
|
||||
if ( mOutputType == QgsMeshDatasetGroupMetadata::DataOnVertices )
|
||||
|
@ -473,7 +473,7 @@ QgsRasterCalculator::Result QgsRasterCalculator::processCalculationGPU( std::uni
|
||||
inputDesc.append( QStringLiteral( " // %1 = %2" ).arg( ref.varName ).arg( ref.name ) );
|
||||
}
|
||||
programTemplate = programTemplate.replace( QStringLiteral( "##INPUT_DESC##" ), inputDesc.join( '\n' ) );
|
||||
programTemplate = programTemplate.replace( QStringLiteral( "##INPUT##" ), inputArgs.length() ? ( inputArgs.join( ',' ).append( ',' ) ) : QChar( ' ' ) );
|
||||
programTemplate = programTemplate.replace( QStringLiteral( "##INPUT##" ), !inputArgs.isEmpty() ? ( inputArgs.join( ',' ).append( ',' ) ) : QChar( ' ' ) );
|
||||
programTemplate = programTemplate.replace( QStringLiteral( "##EXPRESSION##" ), cExpression );
|
||||
programTemplate = programTemplate.replace( QStringLiteral( "##EXPRESSION_ORIGINAL##" ), calcNode->toString( ) );
|
||||
|
||||
|
@ -93,9 +93,6 @@ class QgsRuleBased3DRendererWidget : public QgsPanelWidget, private Ui::QgsRuleB
|
||||
//! no transfer of ownership
|
||||
QgsRuleBased3DRenderer::Rule *rootRule() { return mRootRule; }
|
||||
|
||||
signals:
|
||||
void widgetChanged();
|
||||
|
||||
protected slots:
|
||||
void addRule();
|
||||
void editRule();
|
||||
|
@ -187,7 +187,7 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
|
||||
double scaleBarUnitsPerPixel = std::fabs( context.mapToPixel().mapUnitsPerPixel() );
|
||||
|
||||
// Exit if the canvas width is 0 or layercount is 0 or QGIS will freeze
|
||||
if ( !mapSettings.layers().count() || !deviceWidth || !scaleBarUnitsPerPixel )
|
||||
if ( mapSettings.layers().isEmpty() || !deviceWidth || !scaleBarUnitsPerPixel )
|
||||
return;
|
||||
|
||||
double unitsPerSegment = mPreferredSize;
|
||||
|
@ -409,7 +409,6 @@ void QgsMeshCalculatorDialog::getDatasetGroupNames()
|
||||
|
||||
bool QgsMeshCalculatorDialog::expressionValid() const
|
||||
{
|
||||
QString errorString;
|
||||
QgsMeshCalculator::Result result = QgsMeshCalculator::expression_valid(
|
||||
formulaString(),
|
||||
meshLayer()
|
||||
|
@ -133,6 +133,7 @@ class APP_NO_EXPORT QgsMeshDatasetGroupTreeModel : public QAbstractItemModel
|
||||
*/
|
||||
class APP_EXPORT QgsMeshDatasetGroupTreeItemDelagate: public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QgsMeshDatasetGroupTreeItemDelagate( QObject *parent = Q_NULLPTR );
|
||||
|
||||
|
@ -293,7 +293,8 @@ QString QgsMeshRendererActiveDatasetWidget::metadata( QgsMeshDatasetIndex datase
|
||||
.arg( tr( "Is vector" ) )
|
||||
.arg( gmeta.isVector() ? tr( "Yes" ) : tr( "No" ) );
|
||||
|
||||
for ( auto it = gmeta.extraOptions().constBegin(); it != gmeta.extraOptions().constEnd(); ++it )
|
||||
const auto options = gmeta.extraOptions();
|
||||
for ( auto it = options.constBegin(); it != options.constEnd(); ++it )
|
||||
{
|
||||
msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" ).arg( it.key() ).arg( it.value() );
|
||||
}
|
||||
|
@ -14492,7 +14492,7 @@ void QgisApp::populateProjectStorageMenu( QMenu *menu, bool saving )
|
||||
}
|
||||
}
|
||||
const QString filePath = templateDirName + QDir::separator() + templateName + QStringLiteral( ".qgz" );
|
||||
if ( QFileInfo( filePath ).exists() )
|
||||
if ( QFileInfo::exists( filePath ) )
|
||||
{
|
||||
QMessageBox msgBox( this );
|
||||
msgBox.setWindowTitle( tr( "Overwrite template" ) );
|
||||
|
@ -200,6 +200,7 @@ class QgsStyleXmlDropHandler : public QgsCustomDropHandler
|
||||
*/
|
||||
class APP_EXPORT QgsProjectRootDataItem : public QgsProjectItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -215,6 +216,7 @@ class APP_EXPORT QgsProjectRootDataItem : public QgsProjectItem
|
||||
*/
|
||||
class APP_EXPORT QgsProjectLayerTreeGroupItem : public QgsDataCollectionItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
|
@ -486,7 +486,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
||||
}
|
||||
else if ( QgsLayerTreeModelLegendNode *node = mView->layerTreeModel()->index2legendNode( idx ) )
|
||||
{
|
||||
if ( QgsSymbolLegendNode *symbolNode = dynamic_cast< QgsSymbolLegendNode * >( node ) )
|
||||
if ( QgsSymbolLegendNode *symbolNode = qobject_cast< QgsSymbolLegendNode * >( node ) )
|
||||
{
|
||||
// symbology item
|
||||
if ( symbolNode->flags() & Qt::ItemIsUserCheckable )
|
||||
@ -774,7 +774,7 @@ void QgsAppLayerTreeViewMenuProvider::editSymbolLegendNodeSymbol()
|
||||
QString layerId = action->property( "layerId" ).toString();
|
||||
QString ruleKey = action->property( "ruleKey" ).toString();
|
||||
|
||||
QgsSymbolLegendNode *node = dynamic_cast<QgsSymbolLegendNode *>( mView->layerTreeModel()->findLegendNode( layerId, ruleKey ) );
|
||||
QgsSymbolLegendNode *node = qobject_cast<QgsSymbolLegendNode *>( mView->layerTreeModel()->findLegendNode( layerId, ruleKey ) );
|
||||
if ( !node )
|
||||
return;
|
||||
|
||||
@ -809,7 +809,7 @@ void QgsAppLayerTreeViewMenuProvider::setSymbolLegendNodeColor( const QColor &co
|
||||
QString layerId = action->property( "layerId" ).toString();
|
||||
QString ruleKey = action->property( "ruleKey" ).toString();
|
||||
|
||||
QgsSymbolLegendNode *node = dynamic_cast<QgsSymbolLegendNode *>( mView->layerTreeModel()->findLegendNode( layerId, ruleKey ) );
|
||||
QgsSymbolLegendNode *node = qobject_cast<QgsSymbolLegendNode *>( mView->layerTreeModel()->findLegendNode( layerId, ruleKey ) );
|
||||
if ( !node )
|
||||
return;
|
||||
|
||||
|
@ -129,7 +129,6 @@ QPixmap QgsAppScreenShots::takeScreenshot( QWidget *widget, GrabMode mode, QRect
|
||||
linearGrad.setColorAt( 1, Qt::white );
|
||||
|
||||
// create image and fill it with gradient
|
||||
QImage image( pixmap.width(), pixmap.height(), QImage::Format_ARGB32 );
|
||||
QPainter painter( &img );
|
||||
painter.fillRect( img.rect(), linearGrad );
|
||||
pixmap = QPixmap::fromImage( img );
|
||||
@ -283,7 +282,7 @@ void QgsAppScreenShots::takeVectorLayerProperties25DSymbol()
|
||||
Q_ASSERT( idx >= 0 );
|
||||
dlg->mRendererDialog->cboRenderers->setCurrentIndex( idx );
|
||||
QCoreApplication::processEvents();
|
||||
Qgs25DRendererWidget *w = dynamic_cast<Qgs25DRendererWidget *>( dlg->mRendererDialog->mActiveWidget );
|
||||
Qgs25DRendererWidget *w = qobject_cast<Qgs25DRendererWidget *>( dlg->mRendererDialog->mActiveWidget );
|
||||
w->mHeightWidget->setField( QStringLiteral( "height" ) );
|
||||
Q_ASSERT( w->mHeightWidget->expression() == QLatin1String( "\"height\"" ) );
|
||||
QCoreApplication::processEvents();
|
||||
|
@ -757,7 +757,7 @@ bool QgsMergedBookmarksTableModel::projectAvailable() const
|
||||
void QgsMergedBookmarksTableModel::moveBookmark( QAbstractTableModel &modelFrom, QAbstractTableModel &modelTo, int row )
|
||||
{
|
||||
beginResetModel();
|
||||
QSqlTableModel *qgisModel = dynamic_cast<QSqlTableModel *>( &modelTo );
|
||||
QSqlTableModel *qgisModel = qobject_cast<QSqlTableModel *>( &modelTo );
|
||||
if ( !qgisModel )
|
||||
{
|
||||
modelTo.insertRow( -1 );
|
||||
@ -768,7 +768,7 @@ void QgsMergedBookmarksTableModel::moveBookmark( QAbstractTableModel &modelFrom,
|
||||
modelTo.index( modelTo.rowCount() - 1, column ),
|
||||
modelFrom.data( modelFrom.index( row, column ) ) );
|
||||
}
|
||||
qgisModel = dynamic_cast<QSqlTableModel *>( &modelFrom );
|
||||
qgisModel = qobject_cast<QSqlTableModel *>( &modelFrom );
|
||||
Q_ASSERT( qgisModel );
|
||||
qgisModel->removeRows( row, 1 );
|
||||
qgisModel->select();
|
||||
|
@ -61,7 +61,7 @@ QWidget *FieldSelectorDelegate::createEditor( QWidget *parent, const QStyleOptio
|
||||
|
||||
void FieldSelectorDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const
|
||||
{
|
||||
const QgsVectorLayerAndAttributeModel *m = dynamic_cast< const QgsVectorLayerAndAttributeModel *>( index.model() );
|
||||
const QgsVectorLayerAndAttributeModel *m = qobject_cast< const QgsVectorLayerAndAttributeModel *>( index.model() );
|
||||
if ( !m )
|
||||
return;
|
||||
|
||||
@ -558,7 +558,7 @@ void QgsDxfExportDialog::deSelectAll()
|
||||
|
||||
QList< QgsDxfExport::DxfLayer > QgsDxfExportDialog::layers() const
|
||||
{
|
||||
const QgsVectorLayerAndAttributeModel *model = dynamic_cast< const QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
const QgsVectorLayerAndAttributeModel *model = qobject_cast< const QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
Q_ASSERT( model );
|
||||
return model->layers();
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
|
||||
|
||||
const QList<QgsGeometryCheck *> checks = mLayerChecks[layer].topologyChecks;
|
||||
|
||||
QMap<const QgsGeometryCheck *, QgsFeedback *> feedbacks;
|
||||
QHash<const QgsGeometryCheck *, QgsFeedback *> feedbacks;
|
||||
for ( QgsGeometryCheck *check : checks )
|
||||
feedbacks.insert( check, new QgsFeedback() );
|
||||
|
||||
@ -481,7 +481,7 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
|
||||
QgsReadWriteLocker errorLocker( mTopologyCheckLock, QgsReadWriteLocker::Read );
|
||||
layer->setAllowCommit( allErrors.empty() && mLayerChecks[layer].singleFeatureCheckErrors.empty() );
|
||||
errorLocker.unlock();
|
||||
qDeleteAll( feedbacks.values() );
|
||||
qDeleteAll( feedbacks );
|
||||
futureWatcher->deleteLater();
|
||||
if ( mLayerChecks[layer].topologyCheckFutureWatcher == futureWatcher )
|
||||
mLayerChecks[layer].topologyCheckFutureWatcher = nullptr;
|
||||
|
@ -1295,8 +1295,7 @@ void QgsIdentifyResultsDialog::contextMenuEvent( QContextMenuEvent *event )
|
||||
|
||||
int featIdx = featItem->data( 0, Qt::UserRole + 1 ).toInt();
|
||||
|
||||
QList<QgsMapLayerAction *>::const_iterator actionIt;
|
||||
for ( actionIt = registeredActions.begin(); actionIt != registeredActions.end(); ++actionIt )
|
||||
for ( auto actionIt = registeredActions.constBegin(); actionIt != registeredActions.constEnd(); ++actionIt )
|
||||
{
|
||||
if ( ( *actionIt )->isEnabledOnlyWhenEditable() )
|
||||
continue;
|
||||
|
@ -42,7 +42,7 @@ void QgsLayerTreeViewBadLayerIndicatorProvider::onIndicatorClicked( const QModel
|
||||
if ( !QgsLayerTree::isLayer( node ) )
|
||||
return;
|
||||
|
||||
QgsMapLayer *layer = qobject_cast<QgsMapLayer *>( QgsLayerTree::toLayer( node )->layer() );
|
||||
QgsMapLayer *layer = QgsLayerTree::toLayer( node )->layer();
|
||||
|
||||
if ( !layer )
|
||||
return;
|
||||
|
@ -50,7 +50,7 @@ void QgsLayerTreeViewIndicatorProvider::onAddedChildren( QgsLayerTreeNode *node,
|
||||
}
|
||||
else if ( QgsLayerTree::isLayer( childNode ) )
|
||||
{
|
||||
if ( QgsLayerTreeLayer *layerNode = dynamic_cast< QgsLayerTreeLayer * >( childNode ) )
|
||||
if ( QgsLayerTreeLayer *layerNode = qobject_cast< QgsLayerTreeLayer * >( childNode ) )
|
||||
{
|
||||
if ( layerNode->layer() )
|
||||
{
|
||||
@ -99,7 +99,7 @@ void QgsLayerTreeViewIndicatorProvider::onLayerLoaded()
|
||||
if ( !( qobject_cast<QgsVectorLayer *>( layerNode->layer() ) || qobject_cast<QgsRasterLayer *>( layerNode->layer() ) ) )
|
||||
return;
|
||||
|
||||
if ( QgsMapLayer *mapLayer = qobject_cast<QgsMapLayer *>( layerNode->layer() ) )
|
||||
if ( QgsMapLayer *mapLayer = layerNode->layer() )
|
||||
{
|
||||
if ( mapLayer )
|
||||
{
|
||||
@ -131,7 +131,7 @@ void QgsLayerTreeViewIndicatorProvider::connectSignals( QgsMapLayer *layer )
|
||||
{
|
||||
if ( !( qobject_cast<QgsVectorLayer *>( layer ) || qobject_cast<QgsRasterLayer *>( layer ) ) )
|
||||
return;
|
||||
QgsMapLayer *mapLayer = qobject_cast<QgsMapLayer *>( layer );
|
||||
QgsMapLayer *mapLayer = layer;
|
||||
connect( mapLayer, &QgsMapLayer::dataSourceChanged, this, &QgsLayerTreeViewIndicatorProvider::onLayerChanged );
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ void QgsLayerTreeViewIndicatorProvider::disconnectSignals( QgsMapLayer *layer )
|
||||
{
|
||||
if ( !( qobject_cast<QgsVectorLayer *>( layer ) || qobject_cast<QgsRasterLayer *>( layer ) ) )
|
||||
return;
|
||||
QgsMapLayer *mapLayer = qobject_cast<QgsMapLayer *>( layer );
|
||||
QgsMapLayer *mapLayer = layer;
|
||||
disconnect( mapLayer, &QgsMapLayer::dataSourceChanged, this, &QgsLayerTreeViewIndicatorProvider::onLayerChanged );
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ class APP_EXPORT QgsMapToolSimplify: public QgsMapToolEdit
|
||||
|
||||
void clearSelection();
|
||||
|
||||
void setMethod( Method method );
|
||||
void setMethod( QgsMapToolSimplify::Method method );
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
||||
|
||||
// Setup OpenCL Acceleration widget
|
||||
|
||||
connect( mGPUEnableCheckBox, &QCheckBox::toggled, [ = ]( bool checked )
|
||||
connect( mGPUEnableCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
|
||||
{
|
||||
if ( checked )
|
||||
{
|
||||
|
@ -1427,7 +1427,7 @@ void QgsRasterLayerProperties::transparencyCellTextEdited( const QString &text )
|
||||
int nBands = renderer->usesBands().size();
|
||||
if ( nBands == 1 )
|
||||
{
|
||||
QLineEdit *lineEdit = dynamic_cast<QLineEdit *>( sender() );
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
|
||||
if ( !lineEdit ) return;
|
||||
int row = -1;
|
||||
int column = -1;
|
||||
|
@ -389,7 +389,7 @@ void QgsStatisticalSummaryDockWidget::layerChanged( QgsMapLayer *layer )
|
||||
|
||||
void QgsStatisticalSummaryDockWidget::statActionTriggered( bool checked )
|
||||
{
|
||||
QAction *action = dynamic_cast<QAction *>( sender() );
|
||||
QAction *action = qobject_cast<QAction *>( sender() );
|
||||
int stat = action->data().toInt();
|
||||
|
||||
QString settingsKey;
|
||||
|
@ -1246,9 +1246,7 @@ void QgsVectorLayerProperties::aboutToShowStyleMenu()
|
||||
|
||||
void QgsVectorLayerProperties::loadStyle()
|
||||
{
|
||||
|
||||
QgsSettings settings; // where we keep last used filter in persistent state
|
||||
QString myLastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
|
||||
|
||||
QString errorMsg;
|
||||
QStringList ids, names, descriptions;
|
||||
|
@ -41,7 +41,7 @@ QgsVertexEditorModel::QgsVertexEditorModel( QgsMapCanvas *canvas, QObject *paren
|
||||
: QAbstractTableModel( parent )
|
||||
, mCanvas( canvas )
|
||||
{
|
||||
QWidget *parentWidget = dynamic_cast< QWidget * >( parent );
|
||||
QWidget *parentWidget = qobject_cast< QWidget * >( parent );
|
||||
if ( parentWidget )
|
||||
mWidgetFont = parentWidget->font();
|
||||
}
|
||||
|
@ -521,7 +521,6 @@ void QgsVertexTool::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
||||
// we give them precedence.
|
||||
|
||||
// for each editable layer, select vertices
|
||||
const auto layers = canvas()->layers();
|
||||
const auto editableLayers = editableVectorLayers();
|
||||
for ( QgsVectorLayer *vlayer : editableLayers )
|
||||
{
|
||||
|
@ -258,9 +258,9 @@ class QgsAuthOAuth2Config : public QObject
|
||||
//! Set version to \a value
|
||||
void setVersion( int value );
|
||||
//! Set config type to \a value
|
||||
void setConfigType( ConfigType value );
|
||||
void setConfigType( QgsAuthOAuth2Config::ConfigType value );
|
||||
//! Set grant flow to \a value
|
||||
void setGrantFlow( GrantFlow value );
|
||||
void setGrantFlow( QgsAuthOAuth2Config::GrantFlow value );
|
||||
//! Set name to \a value
|
||||
void setName( const QString &value );
|
||||
//! Set description to \a value
|
||||
@ -291,7 +291,7 @@ class QgsAuthOAuth2Config : public QObject
|
||||
//! Set persistent token flag to \a persist
|
||||
void setPersistToken( bool persist );
|
||||
//! Set access method to \a value
|
||||
void setAccessMethod( AccessMethod value );
|
||||
void setAccessMethod( QgsAuthOAuth2Config::AccessMethod value );
|
||||
//! Set request timeout to \a value
|
||||
void setRequestTimeout( int value );
|
||||
//! Set query pairs to \a pairs
|
||||
@ -309,9 +309,9 @@ class QgsAuthOAuth2Config : public QObject
|
||||
//! Emitted when configuration version has changed
|
||||
void versionChanged( int );
|
||||
//! Emitted when configuration type has changed
|
||||
void configTypeChanged( ConfigType );
|
||||
void configTypeChanged( QgsAuthOAuth2Config::ConfigType );
|
||||
//! Emitted when configuration grant flow has changed
|
||||
void grantFlowChanged( GrantFlow );
|
||||
void grantFlowChanged( QgsAuthOAuth2Config::GrantFlow );
|
||||
//! Emitted when configuration grant flow has changed
|
||||
void nameChanged( const QString & );
|
||||
//! Emitted when configuration name has changed
|
||||
@ -343,7 +343,7 @@ class QgsAuthOAuth2Config : public QObject
|
||||
//! Emitted when configuration persist token flag has changed
|
||||
void persistTokenChanged( bool );
|
||||
//! Emitted when configuration access method has changed
|
||||
void accessMethodChanged( AccessMethod );
|
||||
void accessMethodChanged( QgsAuthOAuth2Config::AccessMethod );
|
||||
//! Emitted when configuration request timeout has changed
|
||||
void requestTimeoutChanged( int );
|
||||
//! Emitted when configuration query pair has changed
|
||||
|
@ -990,7 +990,7 @@ void QgsAuthOAuth2Edit::parseSoftwareStatement( const QString &path )
|
||||
if ( jsonData.contains( QStringLiteral( "grant_types" ) ) && jsonData.contains( QStringLiteral( "redirect_uris" ) ) )
|
||||
{
|
||||
const QStringList grantTypes( jsonData[QStringLiteral( "grant_types" ) ].toStringList() );
|
||||
if ( grantTypes.count( ) )
|
||||
if ( !grantTypes.isEmpty( ) )
|
||||
{
|
||||
QString grantType = grantTypes[0];
|
||||
if ( grantType == QLatin1Literal( "authorization_code" ) )
|
||||
@ -1004,7 +1004,7 @@ void QgsAuthOAuth2Edit::parseSoftwareStatement( const QString &path )
|
||||
}
|
||||
//Set redirect_uri
|
||||
const QStringList redirectUris( jsonData[QStringLiteral( "redirect_uris" ) ].toStringList() );
|
||||
if ( redirectUris.count( ) )
|
||||
if ( !redirectUris.isEmpty( ) )
|
||||
{
|
||||
QString redirectUri = redirectUris[0];
|
||||
leRedirectUrl->setText( redirectUri );
|
||||
|
@ -378,7 +378,7 @@ void QgsAuthOAuth2Method::onCloseBrowser()
|
||||
QgsMessageLog::logMessage( tr( "Close browser requested" ), AUTH_METHOD_KEY, Qgis::MessageLevel::Info );
|
||||
|
||||
// Bring focus back to QGIS app
|
||||
if ( qobject_cast<QApplication *>( qApp ) )
|
||||
if ( qApp )
|
||||
{
|
||||
const QList<QWidget *> widgets = QgsApplication::topLevelWidgets();
|
||||
for ( QWidget *topwdgt : widgets )
|
||||
|
@ -192,7 +192,7 @@ void QgsO2::link()
|
||||
parameters.append( qMakePair( O2_OAUTH2_STATE, state_ ) );
|
||||
parameters.append( qMakePair( QString( O2_OAUTH2_API_KEY ), apiKey_ ) );
|
||||
|
||||
for ( QVariantMap::const_iterator iter = extraReqParams_.begin(); iter != extraReqParams_.end(); ++iter )
|
||||
for ( auto iter = extraReqParams_.constBegin(); iter != extraReqParams_.constEnd(); ++iter )
|
||||
{
|
||||
parameters.append( qMakePair( iter.key(), iter.value().toString() ) );
|
||||
}
|
||||
@ -221,7 +221,7 @@ void QgsO2::link()
|
||||
parameters.append( O0RequestParameter( O2_OAUTH2_API_KEY, apiKey_.toUtf8() ) );
|
||||
|
||||
|
||||
for ( QVariantMap::const_iterator iter = extraReqParams_.begin(); iter != extraReqParams_.end(); ++iter )
|
||||
for ( auto iter = extraReqParams_.constBegin(); iter != extraReqParams_.constEnd(); ++iter )
|
||||
{
|
||||
parameters.append( O0RequestParameter( iter.key().toUtf8(), iter.value().toString().toUtf8() ) );
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidMultiLine( const GEOSGeometry *gin, QS
|
||||
}
|
||||
|
||||
GEOSGeometry *mpoint_out = nullptr;
|
||||
if ( points.count() )
|
||||
if ( !points.isEmpty() )
|
||||
{
|
||||
if ( points.count() > 1 )
|
||||
{
|
||||
@ -771,7 +771,7 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidMultiLine( const GEOSGeometry *gin, QS
|
||||
}
|
||||
|
||||
GEOSGeometry *mline_out = nullptr;
|
||||
if ( lines.count() )
|
||||
if ( !lines.isEmpty() )
|
||||
{
|
||||
if ( lines.count() > 1 )
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ void QgsLocator::fetchResults( const QString &string, const QgsLocatorContext &c
|
||||
connect( clone.get(), &QgsLocatorFilter::resultFetched, clone.get(), [this, filter]( QgsLocatorResult result )
|
||||
{
|
||||
result.filter = filter;
|
||||
emit filterSentResult( result );
|
||||
filterSentResult( result );
|
||||
} );
|
||||
clone->prepare( searchString, context );
|
||||
|
||||
|
@ -321,7 +321,6 @@ void Layer::joinConnectedFeatures()
|
||||
int connectedFeaturesId = 0;
|
||||
for ( auto it = mConnectedHashtable.constBegin(); it != mConnectedHashtable.constEnd(); ++it )
|
||||
{
|
||||
const QString labelTExt = it.key();
|
||||
QVector<FeaturePart *> parts = it.value();
|
||||
connectedFeaturesId++;
|
||||
|
||||
|
@ -876,7 +876,7 @@ QgsPointLocator::Match QgsPointLocator::nearestArea( const QgsPointXY &point, do
|
||||
}
|
||||
|
||||
MatchList mlist = pointInPolygon( point );
|
||||
if ( mlist.count() && mlist.at( 0 ).isValid() )
|
||||
if ( !mlist.isEmpty() && mlist.at( 0 ).isValid() )
|
||||
{
|
||||
return mlist.at( 0 );
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
|
||||
returnStatus = false;
|
||||
}
|
||||
const auto messages = context.takeMessages();
|
||||
if ( messages.count() )
|
||||
if ( !messages.isEmpty() )
|
||||
{
|
||||
emit loadingLayerMessageReceived( tr( "Loading layer %1" ).arg( name ), messages );
|
||||
}
|
||||
@ -3029,7 +3029,7 @@ void QgsProject::generateTsFile( const QString &locale )
|
||||
translationContext.setProject( this );
|
||||
translationContext.setFileName( QStringLiteral( "%1/%2.ts" ).arg( absolutePath(), baseName() ) );
|
||||
|
||||
emit QgsApplication::instance()->collectTranslatableObjects( &translationContext );
|
||||
QgsApplication::instance()->collectTranslatableObjects( &translationContext );
|
||||
|
||||
translationContext.writeTsFile( locale );
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ class CORE_EXPORT QgsSettings : public QObject
|
||||
v = T( value( key, static_cast<int>( defaultValue ), section ).toInt( &ok ) );
|
||||
if ( metaEnum.isValid() )
|
||||
{
|
||||
if ( !ok || !metaEnum.valueToKeys( static_cast<int>( v ) ).size() )
|
||||
if ( !ok || metaEnum.valueToKeys( static_cast<int>( v ) ).isEmpty() )
|
||||
{
|
||||
v = defaultValue;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ QgsVectorLayerExporter::QgsVectorLayerExporter( const QString &uri,
|
||||
}
|
||||
|
||||
QgsDataProvider::ProviderOptions providerOptions;
|
||||
QgsVectorDataProvider *vectorProvider = dynamic_cast< QgsVectorDataProvider * >( pReg->createProvider( providerKey, uriUpdated, providerOptions ) );
|
||||
QgsVectorDataProvider *vectorProvider = qobject_cast< QgsVectorDataProvider * >( pReg->createProvider( providerKey, uriUpdated, providerOptions ) );
|
||||
if ( !vectorProvider || !vectorProvider->isValid() || ( vectorProvider->capabilities() & QgsVectorDataProvider::AddFeatures ) == 0 )
|
||||
{
|
||||
mError = ErrInvalidLayer;
|
||||
|
@ -577,8 +577,6 @@ double QgsHillshadeRenderer::calcFirstDerY( double x11, double x21, double x31,
|
||||
|
||||
void QgsHillshadeRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
// create base structure
|
||||
QgsRasterRenderer::toSld( doc, element, props );
|
||||
|
||||
|
@ -420,8 +420,6 @@ QList<int> QgsMultiBandColorRenderer::usesBands() const
|
||||
|
||||
void QgsMultiBandColorRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
// create base structure
|
||||
QgsRasterRenderer::toSld( doc, element, props );
|
||||
|
||||
|
@ -248,8 +248,6 @@ void QgsPalettedRasterRenderer::writeXml( QDomDocument &doc, QDomElement &parent
|
||||
|
||||
void QgsPalettedRasterRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
// create base structure
|
||||
QgsRasterRenderer::toSld( doc, element, props );
|
||||
|
||||
|
@ -44,7 +44,7 @@ bool QgsRasterChecker::runTest( const QString &verifiedKey, QString verifiedUri,
|
||||
|
||||
//QgsRasterDataProvider* verifiedProvider = QgsRasterLayer::loadProvider( verifiedKey, verifiedUri );
|
||||
QgsDataProvider::ProviderOptions options;
|
||||
QgsRasterDataProvider *verifiedProvider = dynamic_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( verifiedKey, verifiedUri, options ) );
|
||||
QgsRasterDataProvider *verifiedProvider = qobject_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( verifiedKey, verifiedUri, options ) );
|
||||
if ( !verifiedProvider || !verifiedProvider->isValid() )
|
||||
{
|
||||
error( QStringLiteral( "Cannot load provider %1 with URI: %2" ).arg( verifiedKey, verifiedUri ), mReport );
|
||||
@ -52,7 +52,7 @@ bool QgsRasterChecker::runTest( const QString &verifiedKey, QString verifiedUri,
|
||||
}
|
||||
|
||||
//QgsRasterDataProvider* expectedProvider = QgsRasterLayer::loadProvider( expectedKey, expectedUri );
|
||||
QgsRasterDataProvider *expectedProvider = dynamic_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( expectedKey, expectedUri, options ) );
|
||||
QgsRasterDataProvider *expectedProvider = qobject_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( expectedKey, expectedUri, options ) );
|
||||
if ( !expectedProvider || !expectedProvider->isValid() )
|
||||
{
|
||||
error( QStringLiteral( "Cannot load provider %1 with URI: %2" ).arg( expectedKey, expectedUri ), mReport );
|
||||
|
@ -694,7 +694,7 @@ void QgsRasterFileWriter::buildPyramids( const QString &filename, QgsRasterDataP
|
||||
QgsRasterDataProvider *destProvider = destProviderIn;
|
||||
if ( !destProvider )
|
||||
{
|
||||
destProvider = dynamic_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( mOutputProviderKey, filename, providerOptions ) );
|
||||
destProvider = qobject_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( mOutputProviderKey, filename, providerOptions ) );
|
||||
if ( !destProvider || !destProvider->isValid() )
|
||||
{
|
||||
delete destProvider;
|
||||
|
@ -604,7 +604,7 @@ void QgsRasterLayer::setDataProvider( QString const &provider, const QgsDataProv
|
||||
|
||||
//mBandCount = 0;
|
||||
|
||||
mDataProvider = dynamic_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( mProviderKey, mDataSource, options ) );
|
||||
mDataProvider = qobject_cast< QgsRasterDataProvider * >( QgsProviderRegistry::instance()->createProvider( mProviderKey, mDataSource, options ) );
|
||||
if ( !mDataProvider )
|
||||
{
|
||||
//QgsMessageLog::logMessage( tr( "Cannot instantiate the data provider" ), tr( "Raster" ) );
|
||||
|
@ -155,10 +155,8 @@ void QgsRasterRenderer::copyCommonProperties( const QgsRasterRenderer *other, bo
|
||||
setMinMaxOrigin( other->minMaxOrigin() );
|
||||
}
|
||||
|
||||
void QgsRasterRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
void QgsRasterRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap & ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
QDomElement rasterSymbolizerElem = doc.createElement( QStringLiteral( "sld:RasterSymbolizer" ) );
|
||||
element.appendChild( rasterSymbolizerElem );
|
||||
|
||||
|
@ -221,8 +221,6 @@ QList<int> QgsSingleBandGrayRenderer::usesBands() const
|
||||
|
||||
void QgsSingleBandGrayRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
// create base structure
|
||||
QgsRasterRenderer::toSld( doc, element, props );
|
||||
|
||||
@ -357,8 +355,7 @@ void QgsSingleBandGrayRenderer::toSld( QDomDocument &doc, QDomElement &element,
|
||||
}
|
||||
|
||||
// create tags
|
||||
QList< QPair< QString, QColor > >::ConstIterator it;
|
||||
for ( it = colorMapping.begin(); it != colorMapping.constEnd() ; ++it )
|
||||
for ( auto it = colorMapping.constBegin(); it != colorMapping.constEnd() ; ++it )
|
||||
{
|
||||
// set low level color mapping
|
||||
QDomElement lowColorMapEntryElem = doc.createElement( QStringLiteral( "sld:ColorMapEntry" ) );
|
||||
|
@ -331,8 +331,6 @@ QList<int> QgsSingleBandPseudoColorRenderer::usesBands() const
|
||||
|
||||
void QgsSingleBandPseudoColorRenderer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
|
||||
{
|
||||
QgsStringMap newProps = props;
|
||||
|
||||
// create base structure
|
||||
QgsRasterRenderer::toSld( doc, element, props );
|
||||
|
||||
|
@ -775,7 +775,7 @@ bool QgsCptCityColorRampItem::equal( const QgsCptCityDataItem *other )
|
||||
return false;
|
||||
}
|
||||
//const QgsCptCityColorRampItem *o = qobject_cast<const QgsCptCityColorRampItem *> ( other );
|
||||
const QgsCptCityColorRampItem *o = dynamic_cast<const QgsCptCityColorRampItem *>( other );
|
||||
const QgsCptCityColorRampItem *o = qobject_cast<const QgsCptCityColorRampItem *>( other );
|
||||
return o &&
|
||||
mPath == o->mPath &&
|
||||
mName == o->mName &&
|
||||
@ -840,8 +840,8 @@ QVector< QgsCptCityDataItem * > QgsCptCityCollectionItem::childrenRamps( bool re
|
||||
const auto constChildren = children();
|
||||
for ( QgsCptCityDataItem *childItem : constChildren )
|
||||
{
|
||||
QgsCptCityCollectionItem *collectionItem = dynamic_cast<QgsCptCityCollectionItem *>( childItem );
|
||||
QgsCptCityColorRampItem *rampItem = dynamic_cast<QgsCptCityColorRampItem *>( childItem );
|
||||
QgsCptCityCollectionItem *collectionItem = qobject_cast<QgsCptCityCollectionItem *>( childItem );
|
||||
QgsCptCityColorRampItem *rampItem = qobject_cast<QgsCptCityColorRampItem *>( childItem );
|
||||
QgsDebugMsgLevel( QStringLiteral( "child path= %1 coll= %2 ramp = %3" ).arg( childItem->path() ).arg( nullptr != collectionItem ).arg( nullptr != rampItem ), 2 );
|
||||
if ( collectionItem && recursive )
|
||||
{
|
||||
@ -1288,7 +1288,7 @@ QVector<QgsCptCityDataItem *> QgsCptCityAllRampsItem::createChildren()
|
||||
const auto constMItems = mItems;
|
||||
for ( QgsCptCityDataItem *item : constMItems )
|
||||
{
|
||||
QgsCptCityCollectionItem *colItem = dynamic_cast< QgsCptCityCollectionItem * >( item );
|
||||
QgsCptCityCollectionItem *colItem = qobject_cast< QgsCptCityCollectionItem * >( item );
|
||||
if ( colItem )
|
||||
children += colItem->childrenRamps( true );
|
||||
}
|
||||
@ -1384,7 +1384,7 @@ QVariant QgsCptCityBrowserModel::data( const QModelIndex &index, int role ) cons
|
||||
return item->icon( mIconSize );
|
||||
}
|
||||
else if ( role == Qt::FontRole &&
|
||||
dynamic_cast< QgsCptCityCollectionItem * >( item ) )
|
||||
qobject_cast< QgsCptCityCollectionItem * >( item ) )
|
||||
{
|
||||
// collectionitems are larger and bold
|
||||
QFont font;
|
||||
|
@ -87,7 +87,7 @@ void QgsHtmlWidgetWrapper::setHtmlContext( )
|
||||
htmlExpression->setExpressionContext( expressionContext );
|
||||
mWidget->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
|
||||
auto frame = mWidget->page()->mainFrame();
|
||||
connect( frame, &QWebFrame::javaScriptWindowObjectCleared, [ = ]
|
||||
connect( frame, &QWebFrame::javaScriptWindowObjectCleared, frame, [ = ]
|
||||
{
|
||||
frame->addToJavaScriptWindowObject( QStringLiteral( "expression" ), htmlExpression );
|
||||
} );
|
||||
|
@ -41,6 +41,8 @@ class QgsLayerTreeView;
|
||||
*/
|
||||
class QgsLayerTreeViewProxyStyle : public QgsProxyStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QgsLayerTreeViewProxyStyle( QgsLayerTreeView *treeView );
|
||||
|
||||
|
@ -549,7 +549,7 @@ void QgsLayoutMouseHandles::setViewportCursor( Qt::CursorShape cursor )
|
||||
//workaround qt bug #3732 by setting cursor for QGraphicsView viewport,
|
||||
//rather then setting it directly here
|
||||
|
||||
if ( dynamic_cast< QgsLayoutViewToolSelect *>( mView->tool() ) )
|
||||
if ( qobject_cast< QgsLayoutViewToolSelect *>( mView->tool() ) )
|
||||
{
|
||||
mView->viewport()->setCursor( cursor );
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ void QgsBrowserDockWidget::addFavorite()
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
QgsDirectoryItem *dirItem = dynamic_cast<QgsDirectoryItem *>( item );
|
||||
QgsDirectoryItem *dirItem = qobject_cast<QgsDirectoryItem *>( item );
|
||||
if ( !dirItem )
|
||||
return;
|
||||
|
||||
|
@ -94,6 +94,7 @@ class QgsLexerExpression : public QsciLexerSQL
|
||||
|
||||
class QgsSciApisExpression : public QsciAPIs
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QgsSciApisExpression( QsciLexer *lexer );
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ void QgsExpressionBuilderWidget::mValuesListView_doubleClicked( const QModelInde
|
||||
|
||||
void QgsExpressionBuilderWidget::operatorButtonClicked()
|
||||
{
|
||||
QPushButton *button = dynamic_cast<QPushButton *>( sender() );
|
||||
QPushButton *button = qobject_cast<QPushButton *>( sender() );
|
||||
|
||||
// Insert the button text or replace selected text
|
||||
txtExpressionString->insertText( ' ' + button->text() + ' ' );
|
||||
|
@ -217,7 +217,7 @@ bool QgsFilterLineEdit::event( QEvent *event )
|
||||
/// @cond PRIVATE
|
||||
void QgsSpinBoxLineEdit::focusInEvent( QFocusEvent *e )
|
||||
{
|
||||
QLineEdit::focusInEvent( e );
|
||||
QgsFilterLineEdit::focusInEvent( e );
|
||||
if ( isNull() )
|
||||
{
|
||||
clear();
|
||||
|
@ -261,7 +261,7 @@ void QgsOptionsDialogBase::registerTextSearchWidgets()
|
||||
{
|
||||
|
||||
// get custom highlight widget in user added pages
|
||||
QMap<QWidget *, QgsOptionsDialogHighlightWidget *> customHighlightWidgets = QMap<QWidget *, QgsOptionsDialogHighlightWidget *>();
|
||||
QMap<QWidget *, QgsOptionsDialogHighlightWidget *> customHighlightWidgets;
|
||||
QgsOptionsPageWidget *opw = qobject_cast<QgsOptionsPageWidget *>( mOptStackedWidget->widget( i ) );
|
||||
if ( opw )
|
||||
{
|
||||
|
@ -736,7 +736,7 @@ void QgsRasterLayerSaveAsDialog::noDataCellTextEdited( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text )
|
||||
|
||||
QLineEdit *lineEdit = dynamic_cast<QLineEdit *>( sender() );
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
|
||||
if ( !lineEdit ) return;
|
||||
int row = -1;
|
||||
int column = -1;
|
||||
|
@ -133,7 +133,7 @@ void QgsRasterTransparencyWidget::transparencyCellTextEdited( const QString &tex
|
||||
int nBands = renderer->usesBands().size();
|
||||
if ( nBands == 1 )
|
||||
{
|
||||
QLineEdit *lineEdit = dynamic_cast<QLineEdit *>( sender() );
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
|
||||
if ( !lineEdit ) return;
|
||||
int row = -1;
|
||||
int column = -1;
|
||||
|
@ -510,7 +510,7 @@ void QgsCptCityColorRampDialog::updateListWidget( QgsCptCityDataItem *item )
|
||||
mListWidget->blockSignals( true );
|
||||
mListWidget->clear();
|
||||
mListRamps.clear();
|
||||
QgsCptCityCollectionItem *colItem = dynamic_cast<QgsCptCityCollectionItem *>( item );
|
||||
QgsCptCityCollectionItem *colItem = qobject_cast<QgsCptCityCollectionItem *>( item );
|
||||
if ( colItem )
|
||||
{
|
||||
QgsDebugMsg( "path= " + item->path() );
|
||||
@ -518,7 +518,7 @@ void QgsCptCityColorRampDialog::updateListWidget( QgsCptCityDataItem *item )
|
||||
QVector<QgsCptCityDataItem *> childrenRamps = colItem->childrenRamps( true );
|
||||
for ( int i = 0; i < childrenRamps.count(); i++ )
|
||||
{
|
||||
QgsCptCityColorRampItem *rampItem = dynamic_cast<QgsCptCityColorRampItem *>( childrenRamps[i] );
|
||||
QgsCptCityColorRampItem *rampItem = qobject_cast<QgsCptCityColorRampItem *>( childrenRamps[i] );
|
||||
if ( ! rampItem )
|
||||
{
|
||||
QgsDebugMsg( "invalid item " + childrenRamps[i]->path() );
|
||||
@ -594,7 +594,7 @@ bool QgsCptCityColorRampDialog::updateRamp()
|
||||
return false;
|
||||
}
|
||||
QgsCptCityColorRampItem *childItem =
|
||||
dynamic_cast<QgsCptCityColorRampItem *>( mModel->dataItem( modelIndex ) );
|
||||
qobject_cast<QgsCptCityColorRampItem *>( mModel->dataItem( modelIndex ) );
|
||||
if ( ! childItem )
|
||||
return false;
|
||||
if ( mRamp.schemeName() != childItem->ramp().schemeName() )
|
||||
|
@ -56,7 +56,7 @@ void QgsGraduatedSymbolRendererModel::setRenderer( QgsGraduatedSymbolRenderer *r
|
||||
{
|
||||
if ( mRenderer )
|
||||
{
|
||||
if ( mRenderer->ranges().size() )
|
||||
if ( !mRenderer->ranges().isEmpty() )
|
||||
{
|
||||
beginRemoveRows( QModelIndex(), 0, mRenderer->ranges().size() - 1 );
|
||||
mRenderer = nullptr;
|
||||
@ -69,7 +69,7 @@ void QgsGraduatedSymbolRendererModel::setRenderer( QgsGraduatedSymbolRenderer *r
|
||||
}
|
||||
if ( renderer )
|
||||
{
|
||||
if ( renderer->ranges().size() )
|
||||
if ( !renderer->ranges().isEmpty() )
|
||||
{
|
||||
beginInsertRows( QModelIndex(), 0, renderer->ranges().size() - 1 );
|
||||
mRenderer = renderer;
|
||||
|
@ -947,7 +947,6 @@ void QgsAmsTiledImageDownloadHandler::tileReplyFinished()
|
||||
QVariant status = reply->attribute( QNetworkRequest::HttpStatusCodeAttribute );
|
||||
if ( !status.isNull() && status.toInt() >= 400 )
|
||||
{
|
||||
QVariant phrase = reply->attribute( QNetworkRequest::HttpReasonPhraseAttribute );
|
||||
mReplies.removeOne( reply );
|
||||
reply->deleteLater();
|
||||
|
||||
|
@ -210,8 +210,8 @@ bool QgsMdalProvider::persistDatasetGroup( const QString &path,
|
||||
if ( !g )
|
||||
return true;
|
||||
|
||||
auto end = meta.extraOptions().cend();
|
||||
for ( auto it = meta.extraOptions().cbegin(); it != end; ++it )
|
||||
const auto extraOptions = meta.extraOptions();
|
||||
for ( auto it = extraOptions.cbegin(); it != extraOptions.cend(); ++it )
|
||||
{
|
||||
MDAL_G_setMetadata( g, it.key().toStdString().c_str(), it.value().toStdString().c_str() );
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ QgsGeoPackageProjectStorageDialog::QgsGeoPackageProjectStorageDialog( bool savin
|
||||
mFileWidget->lineEdit()->hide();
|
||||
mFileWidget->setFilter( QgsVectorFileWriter::filterForDriver( QStringLiteral( "GPKG" ) ) );
|
||||
|
||||
connect( mFileWidget, &QgsFileWidget::fileChanged, [ = ]( const QString & path )
|
||||
connect( mFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & path )
|
||||
{
|
||||
const QString fileName{QFileInfo( path ).fileName()};
|
||||
if ( mCboConnection->findData( path ) == -1 )
|
||||
|
@ -241,7 +241,7 @@ namespace QgsWfs
|
||||
}
|
||||
|
||||
// get propertyList from query
|
||||
QStringList propertyList = query.propertyList;
|
||||
const QStringList propertyList = query.propertyList;
|
||||
|
||||
//Using pending attributes and pending fields
|
||||
QgsAttributeList attrIndexes = vlayer->attributeList();
|
||||
@ -261,7 +261,7 @@ namespace QgsWfs
|
||||
propertynames.append( fields.field( idx ).name().replace( ' ', '_' ).replace( cleanTagNameRegExp, QString() ) );
|
||||
}
|
||||
QString fieldName;
|
||||
for ( plstIt = propertyList.begin(); plstIt != propertyList.end(); ++plstIt )
|
||||
for ( plstIt = propertyList.constBegin(); plstIt != propertyList.constEnd(); ++plstIt )
|
||||
{
|
||||
fieldName = *plstIt;
|
||||
int fieldNameIdx = propertynames.indexOf( fieldName );
|
||||
@ -548,9 +548,9 @@ namespace QgsWfs
|
||||
{
|
||||
QStringList propertyList;
|
||||
|
||||
QStringList attrList = propertyName.split( ',' );
|
||||
const QStringList attrList = propertyName.split( ',' );
|
||||
QStringList::const_iterator alstIt;
|
||||
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
|
||||
for ( alstIt = attrList.constBegin(); alstIt != attrList.constEnd(); ++alstIt )
|
||||
{
|
||||
QString fieldName = *alstIt;
|
||||
fieldName = fieldName.trimmed();
|
||||
@ -623,9 +623,9 @@ namespace QgsWfs
|
||||
{
|
||||
QStringList propertyList;
|
||||
|
||||
QStringList attrList = propertyName.split( ',' );
|
||||
const QStringList attrList = propertyName.split( ',' );
|
||||
QStringList::const_iterator alstIt;
|
||||
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
|
||||
for ( alstIt = attrList.constBegin(); alstIt != attrList.constEnd(); ++alstIt )
|
||||
{
|
||||
QString fieldName = *alstIt;
|
||||
fieldName = fieldName.trimmed();
|
||||
|
@ -390,7 +390,7 @@ namespace QgsWfs
|
||||
QDomElement geometryElem = action.geometryElement;
|
||||
// get field information
|
||||
QgsFields fields = provider->fields();
|
||||
QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
const QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
QMap<QString, int>::const_iterator fieldMapIt;
|
||||
QString fieldName;
|
||||
bool conversionSuccess;
|
||||
@ -754,7 +754,7 @@ namespace QgsWfs
|
||||
|
||||
// Get Layer Field Information
|
||||
QgsFields fields = provider->fields();
|
||||
QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
const QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
QMap<QString, int>::const_iterator fieldMapIt;
|
||||
|
||||
for ( int i = 0; i < featureNodeList.count(); i++ )
|
||||
|
@ -370,7 +370,7 @@ namespace QgsWfs
|
||||
QDomElement geometryElem = action.geometryElement;
|
||||
// get field information
|
||||
QgsFields fields = provider->fields();
|
||||
QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
const QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
QMap<QString, int>::const_iterator fieldMapIt;
|
||||
QString fieldName;
|
||||
bool conversionSuccess;
|
||||
@ -731,7 +731,7 @@ namespace QgsWfs
|
||||
|
||||
// Get Layer Field Information
|
||||
QgsFields fields = provider->fields();
|
||||
QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
const QMap<QString, int> fieldMap = provider->fieldNameMap();
|
||||
QMap<QString, int>::const_iterator fieldMapIt;
|
||||
|
||||
for ( int i = 0; i < featureNodeList.count(); i++ )
|
||||
|
@ -29,7 +29,6 @@ QgsLayerRestorer::QgsLayerRestorer( const QList<QgsMapLayer *> &layers )
|
||||
QgsLayerSettings settings;
|
||||
settings.name = layer->name();
|
||||
|
||||
QString style = layer->styleManager()->currentStyle();
|
||||
settings.mNamedStyle = layer->styleManager()->currentStyle();
|
||||
|
||||
// set a custom property allowing to keep in memory if a SLD file has
|
||||
|
@ -1515,8 +1515,8 @@ namespace QgsWms
|
||||
if ( layerSelections.contains( layer ) )
|
||||
{
|
||||
QMultiMap<QString, QString>::const_iterator it;
|
||||
it = layerSelections.find( layer );
|
||||
while ( it != layerSelections.end() && it.key() == layer )
|
||||
it = layerSelections.constFind( layer );
|
||||
while ( it != layerSelections.constEnd() && it.key() == layer )
|
||||
{
|
||||
param.mSelection << it.value().split( ',' );
|
||||
++it;
|
||||
@ -1584,9 +1584,9 @@ namespace QgsWms
|
||||
QList<QgsWmsParametersExternalLayer> externalLayers;
|
||||
|
||||
QStringList layers = allLayersNickname();
|
||||
QStringList::const_iterator rit = std::remove_if( layers.begin(), layers.end(), notExternalLayer );
|
||||
QStringList::iterator rit = std::remove_if( layers.begin(), layers.end(), notExternalLayer );
|
||||
|
||||
for ( QStringList::const_iterator it = layers.begin(); it != rit; ++it )
|
||||
for ( QStringList::iterator it = layers.begin(); it != rit; ++it )
|
||||
{
|
||||
externalLayers << externalLayerParameter( *it );
|
||||
}
|
||||
|
@ -1194,7 +1194,7 @@ namespace QgsWms
|
||||
QString layerName = queryLayer;
|
||||
|
||||
//check if the layer is given a different name for GetFeatureInfo output
|
||||
QHash<QString, QString>::const_iterator layerAliasIt = layerAliasMap.find( layerName );
|
||||
QHash<QString, QString>::const_iterator layerAliasIt = layerAliasMap.constFind( layerName );
|
||||
if ( layerAliasIt != layerAliasMap.constEnd() )
|
||||
{
|
||||
layerName = layerAliasIt.value();
|
||||
|
Loading…
x
Reference in New Issue
Block a user