diff --git a/examples/dockindock/dockindock.cpp b/examples/dockindock/dockindock.cpp index cf9bbeb..bacf42c 100644 --- a/examples/dockindock/dockindock.cpp +++ b/examples/dockindock/dockindock.cpp @@ -206,11 +206,15 @@ void DockInDockWidget::fillPerspectivesMenu( QMenu* menu ) if ( !perspectiveNames.isEmpty() ) { QMenu* load = menu->addMenu( "Load perspective" ); - for ( auto name : perspectiveNames ) - load->addAction( new LoadPerspectiveAction( load, name, *this ) ); + for (const auto& name : perspectiveNames) + { + load->addAction(new LoadPerspectiveAction( load, name, *this)); + } QMenu* remove = menu->addMenu( "Remove perspective" ); - for ( auto name : perspectiveNames ) - remove->addAction( new RemovePerspectiveAction( remove, name, *this ) ); + for (const auto& name : perspectiveNames) + { + remove->addAction( new RemovePerspectiveAction( remove, name, *this )); + } } } diff --git a/examples/dockindock/perspectives.cpp b/examples/dockindock/perspectives.cpp index 29002b3..e788c22 100644 --- a/examples/dockindock/perspectives.cpp +++ b/examples/dockindock/perspectives.cpp @@ -219,8 +219,10 @@ void PerspectivesManager::loadPerspectives() // load group info: mainSettings->beginGroup(GROUP_PREFIX); - for ( auto key : mainSettings->allKeys() ) + for (const auto& key : mainSettings->allKeys()) + { m_perspectives[perspective].groups[key] = mainSettings->value( key ).toStringList(); + } mainSettings->endGroup(); } else diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index ab42bd2..6557ce7 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -1010,7 +1010,7 @@ bool CDockAreaWidget::isCentralWidgetArea() const return false; } - return dockManager()->centralWidget() == dockWidgets()[0]; + return dockManager()->centralWidget() == dockWidgets().constFirst(); } diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 1d2539a..979e5ef 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -568,7 +568,6 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin } else { - QList NewSplitterSizes; QSplitter* NewSplitter = newSplitter(InsertParam.orientation()); int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height(); bool AdjustSplitterSizes = true; @@ -692,7 +691,6 @@ void DockContainerWidgetPrivate::moveToNewSection(QWidget* Widget, CDockAreaWidg } else { - auto Sizes = TargetAreaSplitter->sizes(); int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height(); QSplitter* NewSplitter = newSplitter(InsertParam.orientation()); NewSplitter->addWidget(TargetArea); diff --git a/src/DockManager.cpp b/src/DockManager.cpp index ea98221..8ef5de5 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -928,7 +928,7 @@ void CDockManager::removePerspective(const QString& Name) void CDockManager::removePerspectives(const QStringList& Names) { int Count = 0; - for (auto Name : Names) + for (const auto& Name : Names) { Count += d->Perspectives.remove(Name); }