diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-11-08 13:27:30 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-11-19 15:35:46 +0100 |
commit | fc42c9d35665dbe9d5bce72d50ea14d1c6091628 (patch) | |
tree | b2ac99b215c7c8af979469dbe5bfd59267d38c32 /src/designer/src/components/formeditor/templateoptionspage.cpp | |
parent | 01b12aabdc40a2d2c3f38fc03dfde9659458491b (diff) |
Qt Designer: Prepare for deprecation of classes in Qt 6
- Use auto for QStringRef.
- Use auto for QList and iterators, refactoring some loops.
Task-number: QTBUG-79896
Change-Id: I065d5b6d49404e51a10a7e1d7373eff41f9cb032
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer/src/components/formeditor/templateoptionspage.cpp')
-rw-r--r-- | src/designer/src/components/formeditor/templateoptionspage.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/designer/src/components/formeditor/templateoptionspage.cpp b/src/designer/src/components/formeditor/templateoptionspage.cpp index e50260406..4e638c913 100644 --- a/src/designer/src/components/formeditor/templateoptionspage.cpp +++ b/src/designer/src/components/formeditor/templateoptionspage.cpp @@ -96,7 +96,7 @@ void TemplateOptionsWidget::addTemplatePath() if (templatePath.isEmpty()) return; - const QList<QListWidgetItem *> existing + const auto existing = m_ui->m_templatePathListWidget->findItems(templatePath, Qt::MatchExactly); if (!existing.isEmpty()) return; @@ -108,8 +108,7 @@ void TemplateOptionsWidget::addTemplatePath() void TemplateOptionsWidget::removeTemplatePath() { - const QList<QListWidgetItem *> selectedPaths - = m_ui->m_templatePathListWidget->selectedItems(); + const auto selectedPaths = m_ui->m_templatePathListWidget->selectedItems(); if (selectedPaths.isEmpty()) return; delete selectedPaths.constFirst(); @@ -117,7 +116,7 @@ void TemplateOptionsWidget::removeTemplatePath() void TemplateOptionsWidget::templatePathSelectionChanged() { - const QList<QListWidgetItem *> selectedPaths = m_ui->m_templatePathListWidget->selectedItems(); + const auto selectedPaths = m_ui->m_templatePathListWidget->selectedItems(); m_ui->m_removeTemplatePathButton->setEnabled(!selectedPaths.isEmpty()); } |