mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-25 05:49:02 +08:00
Fix various clazy warnings
This commit is contained in:
parent
ca1d3fcd38
commit
8d30fc9c3c
@ -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 ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -1010,7 +1010,7 @@ bool CDockAreaWidget::isCentralWidgetArea() const
|
||||
return false;
|
||||
}
|
||||
|
||||
return dockManager()->centralWidget() == dockWidgets()[0];
|
||||
return dockManager()->centralWidget() == dockWidgets().constFirst();
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,7 +568,6 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin
|
||||
}
|
||||
else
|
||||
{
|
||||
QList<int> 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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user