Gui: Use auto and range-based for (#7481)

* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent f7c84dfd09
commit ae53c9b0a4
175 changed files with 2051 additions and 2057 deletions

View File

@@ -69,14 +69,14 @@ TaskCSysDragger::~TaskCSysDragger()
void TaskCSysDragger::setupGui()
{
Gui::TaskView::TaskBox *incrementsBox = new Gui::TaskView::TaskBox(
auto incrementsBox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("button_valid"),
tr("Increments"), true, nullptr);
QGridLayout *gridLayout = new QGridLayout();
auto gridLayout = new QGridLayout();
gridLayout->setColumnStretch(1, 1);
QLabel *tLabel = new QLabel(tr("Translation Increment:"), incrementsBox);
auto tLabel = new QLabel(tr("Translation Increment:"), incrementsBox);
gridLayout->addWidget(tLabel, 0, 0, Qt::AlignRight);
int spinBoxWidth = QApplication::fontMetrics().averageCharWidth() * 20;
@@ -87,7 +87,7 @@ void TaskCSysDragger::setupGui()
tSpinBox->setMinimumWidth(spinBoxWidth);
gridLayout->addWidget(tSpinBox, 0, 1, Qt::AlignLeft);
QLabel *rLabel = new QLabel(tr("Rotation Increment:"), incrementsBox);
auto rLabel = new QLabel(tr("Rotation Increment:"), incrementsBox);
gridLayout->addWidget(rLabel, 1, 0, Qt::AlignRight);
rSpinBox = new QuantitySpinBox(incrementsBox);