Help plugin: Replace foreach with ranged for loop

Change-Id: Idf7a7182e88aba35dff57ef92e1c873b33cb42a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-10-05 13:13:48 +02:00
parent 9accbdac02
commit ebcc51ecbf
2 changed files with 5 additions and 4 deletions

View File

@@ -425,7 +425,7 @@ void GeneralSettingsPage::updateFontSizeSelector()
// try to maintain selection or select closest.
if (!pointSizes.empty()) {
QString n;
foreach (int pointSize, pointSizes)
for (int pointSize : qAsConst(pointSizes))
m_widget->sizeComboBox->addItem(n.setNum(pointSize), QVariant(pointSize));
const int closestIndex = closestPointSizeIndex(m_font.pointSize());
if (closestIndex != -1)
@@ -446,7 +446,7 @@ void GeneralSettingsPage::updateFontStyleSelector()
if (!styles.empty()) {
int normalIndex = -1;
const QString normalStyle = "Normal";
foreach (const QString &style, styles) {
for (const QString &style : styles) {
// try to maintain selection or select 'normal' preferably
const int newIndex = m_widget->styleComboBox->count();
m_widget->styleComboBox->addItem(style);