PD: modernize C++: use range-based for loop
This commit is contained in:
@@ -121,8 +121,8 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView, bool /*newObj
|
||||
}
|
||||
// the spine edges
|
||||
std::vector<std::string> strings = pipe->Spine.getSubValues();
|
||||
for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {
|
||||
QString label = QString::fromStdString(*it);
|
||||
for (const auto & string : strings) {
|
||||
QString label = QString::fromStdString(string);
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(label);
|
||||
item->setData(Qt::UserRole, QByteArray(label.toUtf8()));
|
||||
@@ -255,8 +255,8 @@ void TaskPipeParameters::removeFromListWidget(QListWidget* widget, QString items
|
||||
{
|
||||
QList<QListWidgetItem*> items = widget->findItems(itemstr, Qt::MatchExactly);
|
||||
if (!items.empty()) {
|
||||
for (QList<QListWidgetItem*>::const_iterator i = items.cbegin(); i != items.cend(); i++) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(*i));
|
||||
for (auto item : items) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(item));
|
||||
delete it;
|
||||
}
|
||||
}
|
||||
@@ -577,8 +577,8 @@ TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newO
|
||||
ui->profileBaseEdit->setText(QString::fromUtf8(pipe->AuxillerySpine.getValue()->Label.getValue()));
|
||||
|
||||
std::vector<std::string> strings = pipe->AuxillerySpine.getSubValues();
|
||||
for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {
|
||||
QString label = QString::fromStdString(*it);
|
||||
for (const auto & string : strings) {
|
||||
QString label = QString::fromStdString(string);
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(label);
|
||||
item->setData(Qt::UserRole, QByteArray(label.toUtf8()));
|
||||
@@ -751,8 +751,8 @@ void TaskPipeOrientation::removeFromListWidget(QListWidget* widget, QString name
|
||||
{
|
||||
QList<QListWidgetItem*> items = widget->findItems(name, Qt::MatchExactly);
|
||||
if (!items.empty()) {
|
||||
for (QList<QListWidgetItem*>::const_iterator i = items.cbegin(); i != items.cend(); i++) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(*i));
|
||||
for (auto item : items) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(item));
|
||||
delete it;
|
||||
}
|
||||
}
|
||||
@@ -980,8 +980,8 @@ void TaskPipeScaling::removeFromListWidget(QListWidget* widget, QString name)
|
||||
{
|
||||
QList<QListWidgetItem*> items = widget->findItems(name, Qt::MatchExactly);
|
||||
if (!items.empty()) {
|
||||
for (QList<QListWidgetItem*>::const_iterator i = items.cbegin(); i != items.cend(); i++) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(*i));
|
||||
for (auto item : items) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(item));
|
||||
delete it;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user